Commit Graph

612 Commits

Author SHA1 Message Date
danno@chromium.org
78b09625d5 Enable stub generation using Hydrogen/Lithium (again)
This initial implementation generates only KeyedLoadICs using the new Hydrogen stub infrastructure.

Committed: https://code.google.com/p/v8/source/detail?r=13105

Review URL: https://codereview.chromium.org/10701054

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13117 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-12-03 15:51:05 +00:00
danno@chromium.org
0a3bcc8c05 Revert 13105: "Enable stub generation using Hydrogen/Lithium."
TBR=jkummerow@chromium.org

Review URL: https://codereview.chromium.org/11414262

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13106 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-30 17:45:45 +00:00
danno@chromium.org
c115ff4e33 Enable stub generation using Hydrogen/Lithium.
This initial implementation generates only KeyedLoadICs using the new Hydrogen stub infrastructure.

Review URL: https://codereview.chromium.org/10701054

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13105 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-30 17:31:30 +00:00
jkummerow@chromium.org
79563b22c9 Faster implementation of Math.exp()
Review URL: https://codereview.chromium.org/11418149

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13054 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-26 13:12:35 +00:00
mmassi@chromium.org
a0582112f8 Revert r13025 and r13026 (they introduced a bug on arm and regressed octane crypto).
BUG=

Review URL: https://chromiumcodereview.appspot.com/11316151

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13039 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-23 10:53:03 +00:00
rossberg@chromium.org
ce05280bfc Get rid of static module allocation, do it in code.
Modules now have their own local scope, represented by their own context.
Module instance objects have an accessor for every export that forwards
access to the respective slot from the module's context. (Exports that are
modules themselves, however, are simple data properties.)

All modules have a _hosting_ scope/context, which (currently) is the
(innermost) enclosing global scope. To deal with recursion, nested modules
are hosted by the same scope as global ones.

For every (global or nested) module literal, the hosting context has an
internal slot that points directly to the respective module context. This
enables quick access to (statically resolved) module members by 2-dimensional
access through the hosting context. For example,

  module A {
    let x;
    module B { let y; }
  }
  module C { let z; }

allocates contexts as follows:

[header| .A | .B | .C | A | C ]  (global)
          |    |    |
          |    |    +-- [header| z ]  (module)
          |    |
          |    +------- [header| y ]  (module)
          |
          +------------ [header| x | B ]  (module)

Here, .A, .B, .C are the internal slots pointing to the hosted module
contexts, whereas A, B, C hold the actual instance objects (note that every
module context also points to the respective instance object through its
extension slot in the header).

To deal with arbitrary recursion and aliases between modules,
they are created and initialized in several stages. Each stage applies to
all modules in the hosting global scope, including nested ones.

1. Allocate: for each module _literal_, allocate the module contexts and
   respective instance object and wire them up. This happens in the
   PushModuleContext runtime function, as generated by AllocateModules
   (invoked by VisitDeclarations in the hosting scope).

2. Bind: for each module _declaration_ (i.e. literals as well as aliases),
   assign the respective instance object to respective local variables. This
   happens in VisitModuleDeclaration, and uses the instance objects created
   in the previous stage.
   For each module _literal_, this phase also constructs a module descriptor
   for the next stage. This happens in VisitModuleLiteral.

3. Populate: invoke the DeclareModules runtime function to populate each
   _instance_ object with accessors for it exports. This is generated by
   DeclareModules (invoked by VisitDeclarations in the hosting scope again),
   and uses the descriptors generated in the previous stage.

4. Initialize: execute the module bodies (and other code) in sequence. This
   happens by the separate statements generated for module bodies. To reenter
   the module scopes properly, the parser inserted ModuleStatements.

R=mstarzinger@chromium.org,svenpanne@chromium.org
BUG=

Review URL: https://codereview.chromium.org/11093074

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13033 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-22 10:25:22 +00:00
mmassi@chromium.org
ce81fb7b13 Fix build (and fix brown paper bug as well...).
BUG=

Review URL: https://chromiumcodereview.appspot.com/11419115

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13026 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-21 12:17:18 +00:00
mmassi@chromium.org
5e7f30a596 Use the property load IC for accessing the array length.
BUG=

Review URL: https://chromiumcodereview.appspot.com/11299004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13025 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-21 11:49:15 +00:00
yangguo@chromium.org
2b5e6bae60 Fix --hydrogen-stats.
Timing happens in a scope.  Since crankshaft has been chopped up into three methods, this approach is wrong.

BUG=

Review URL: https://chromiumcodereview.appspot.com/11411065

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12998 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-19 14:20:57 +00:00
svenpanne@chromium.org
d5f589808d Removed a bunch of GetExistingThreadLocal calls by threading the Isolate.
For Octane, the number of calls go down from 7341629 to 1947880, i.e. they are
reduced by more than 73%. TLS access is not especially cheap, so this exercise
seems worthwhile.

Review URL: https://codereview.chromium.org/11412007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12979 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-16 08:38:11 +00:00
jkummerow@chromium.org
1c086d1202 Lattice-based representation inference, powered by left/right specific type feedback for BinaryOps and comparisons
Review URL: https://chromiumcodereview.appspot.com/10837165

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12961 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-14 15:59:45 +00:00
verwaest@chromium.org
deae08bd23 Consolidate polymorphic calls due to elements transitions.
Review URL: https://chromiumcodereview.appspot.com/11359104

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12960 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-14 12:10:51 +00:00
svenpanne@chromium.org
50f6e07e67 Nano-refactoring: Simplify initialization
Review URL: https://codereview.chromium.org/11368078

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12856 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-05 14:37:28 +00:00
ulan@chromium.org
f106c9c9f7 Add rotate-right instruction to hydrogen and use it instead of bitwise operations
of the form ((x >>> i) | (x << (32 - i))).

This CL is based on https://chromiumcodereview.appspot.com/10984057/
by Jay Conrod <dconrod@codeaurora.org>.

R=danno@chromium.org,mstarzinger@chromium.org,dconrod@codeaurora.org

Review URL: https://chromiumcodereview.appspot.com/11033005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12855 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-05 13:28:10 +00:00
svenpanne@chromium.org
24bb0668e6 Simplified HCheckMaps handling a bit.
This is a refactoring-only CL which simplifies the way we emit combinations of
Smi+map checks.

Review URL: https://codereview.chromium.org/11343011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12848 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-05 10:06:24 +00:00
svenpanne@chromium.org
9de1d40d28 Improve handling of property loads on the proto chain.
Previously Crankshaft emitted a generic load for these, now we emit a load of a
named field, guarded by a proto chain check.

LCheckPrototypeMaps now returns the holder, which is for free, because it
already had to check its map as the last step, anyway. This is in sync with what
StubCompiler::CheckPrototype does.

Review URL: https://codereview.chromium.org/11338030

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12847 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-05 08:53:54 +00:00
mvstanton@chromium.org
a85fd03caa Consolidated all the key store/load classes in the Hydrogen and Lithium
space into just two:
HLoadKeyed/HLoadKeyedGeneric and HStoreKeyed/HStoreKeyedGeneric
LLoadKeyed/LLoadKeyedGeneric and LStoreKeyed/LStoreKeyedGeneric
BUG=

Review URL: https://codereview.chromium.org/11238016

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12839 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-02 09:18:53 +00:00
svenpanne@chromium.org
5a0176222b Consistently make the bounds check for AccessArgumentsAt explicit.
This has the advantage that AccessArgumentsAt itself can't deopt anymore and the
bounds check is visible for the elimination phase. Furthermore, things are
simply more consistent now, a good thing in itself. :-)

Review URL: https://codereview.chromium.org/11106012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12721 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-10-15 07:25:20 +00:00
svenpanne@chromium.org
f03fd70d9e Added a simple dead code removal phase.
We iteratively remove all dead Hydrogen instruction until we reach a fixed point. We consider an instruction dead if it is unused, has no observable side effects and is deletable. The last part of the condition is currently not very nice: We basically have to whitelist "safe" instructions, because we are missing more detailed dependencies and/or more detailed tracking of side effects.

We disable dead code elimination for now in our test runners, because we have tons of poorly written tests which wouldn't test anymore what they are supposed to test with this phase enabled. To get test coverage for dead code elimination itself, we should enable it on a few build bots. This is not really a perfect state, but the best we can do for now.

This patch includes a few const-correctness fixes, most of them were necessary for this CL.

Review URL: https://codereview.chromium.org/11088027

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12697 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-10-11 10:52:58 +00:00
svenpanne@chromium.org
f81b06dde5 Make sure that the context argument of HAdd is never NULL.
Although this doesn't hurt currently, it hurts any future compiler
pass relying on the invariant that no operand is NULL.

R=jkummerow@chromium.org

Review URL: https://codereview.chromium.org/11088026

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12681 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-10-09 13:53:24 +00:00
verwaest@chromium.org
efe955587e Allow optimistically hoisting elements transitions over accesses.
Review URL: https://chromiumcodereview.appspot.com/10972011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12642 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-10-01 16:22:43 +00:00
mstarzinger@chromium.org
f0dcaf9a19 Fix lost arguments dropping in HLeaveInlined.
This fixes HleaveInlined to correctly drop pushed arguments on all code
paths and addresses a corner case where the arguments stack height
mismatched at an OSR entry point.

R=jkummerow@chromium.org
BUG=chromium:150545
TEST=mjsunit/regress/regress-crbug-150545

Review URL: https://codereview.chromium.org/10938016

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12543 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-09-19 08:13:46 +00:00
mmassi@chromium.org
22aed1cddd Fixed bounds check removal by restricting it to int32 indexes (and reenabled both ABCR and index dehoisting).
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10905232

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12493 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-09-12 17:00:25 +00:00
mstarzinger@chromium.org
f37f504de5 Fix arguments object materialization during deopt.
This fixes materialization of arguments objects for strict mode functions during
deoptimization. We materialize arguments from the stack area where optimized
code pushes the arguments when entering the inlined environment. For adapted
invocations we use the arguments adaptor frame for materialization.

R=svenpanne@chromium.org
BUG=v8:2261
TEST=mjsunit/regress/regress-2261,mjsunit/compiler/inline-arguments

Review URL: https://chromiumcodereview.appspot.com/10908194

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12489 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-09-12 12:28:42 +00:00
mmassi@chromium.org
bff3d2a8a6 Fix array index dehoisting.
BUG=141395
TEST=

Review URL: https://chromiumcodereview.appspot.com/10919214

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12484 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-09-11 14:14:32 +00:00
svenpanne@chromium.org
7af6883098 Fixed deoptimization of inlined getters.
It is necessary to explicitly handle the internal frame lying between the caller
of the getter and the getter itself in the deoptimizer: When the getter is
inlined, leaving the internal frame restores the correct context.

BUG=http://crbug/134609
TEST=mjsunit/regress/regress-crbug-134609

Review URL: https://chromiumcodereview.appspot.com/10910110

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12470 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-09-07 09:01:54 +00:00
verwaest@chromium.org
a4f7ebe5a0 Removed trailing whitespace.
Review URL: https://chromiumcodereview.appspot.com/10916020

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12414 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-08-30 18:10:09 +00:00
verwaest@chromium.org
90db487390 Elements load depends on the type of the receiver.
R=jkummerow@chromium.org

Review URL: https://chromiumcodereview.appspot.com/10918005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12413 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-08-30 17:31:32 +00:00
rossberg@chromium.org
a6e45ce7b8 Introduce some predicates over variable modes.
These should be handy when we add more declaration forms for Harmony.

R=svenpanne@chromium.org
BUG=

Review URL: https://chromiumcodereview.appspot.com/10897010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12404 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-08-29 09:19:53 +00:00
verwaest@chromium.org
78037d0a4e Use a special EnumLength field to indicate number of valid enum cache values.
This is preparatory work for sharing Enum Caches.

Review URL: https://chromiumcodereview.appspot.com/10824079

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12400 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-08-28 14:20:50 +00:00
svenpanne@chromium.org
f6f4798189 Print reason for disabling optimization. Kill --trace-bailout flag.
The reason for disabling optimization of a given function is carried around in
CompilationInfo. The new mechanism is general enough that --trace-opt now
subsumes everything --trace-bailout could print, so we nuked the latter flag.

Review URL: https://chromiumcodereview.appspot.com/10868106

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12391 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-08-28 07:18:06 +00:00
danno@chromium.org
3544e2e875 Disable speculative LICM when it may lead to unnecessary deopts
BUG=v8:2250
R=vegorov@chromium.org
TEST=tests/mjsunit/regress/regress-2250.js

Review URL: https://chromiumcodereview.appspot.com/10867033

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12375 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-08-23 21:08:58 +00:00
vegorov@chromium.org
106a83252d Fix DoDeferredNumberTagU to keep the value in xmm1 instead of xmm0 on x64.
xmm0 is not saved across runtime call on x64 because MacroAssembler::EnterExitFrameEpilogue preserves only allocatable XMM registers unlike on ia32 where it preserves all registers.

Cleanup handling of shifts: SHR can deoptimize only when its a shift by 0, all other shift never deoptimize.

Fix type inference for i-to-t change instruction. On X64 this ensures that write-barrier is generated correctly.

R=danno@chromium.org

Review URL: https://chromiumcodereview.appspot.com/10868032

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12373 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-08-23 16:14:01 +00:00
vegorov@chromium.org
96f55352fc When processing collected uint32 instructions skip those with non-Integer32 representation.
R=danno@chromium.org
BUG=test262 S15.4.4.8_A2_T3.js

Review URL: https://chromiumcodereview.appspot.com/10867017

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12369 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-08-22 19:00:02 +00:00
vegorov@chromium.org
f476d4d431 Allow uint32 value on optimized frames if they are consumed by safe operations.
Safe operations are those that either do not observe unsignedness or have special support for uint32 values:

- all binary bitwise operations: they perform ToInt32 on inputs;
- >> and << shifts: they perform ToInt32 on left hand side and ToUint32 on right hand side;
- >>> shift: it performs ToUint32 on both inputs;
- stores to integer external arrays (not pixel, float or double ones): these stores are "bitwise";
- HChange: special support added for conversions of uint32 values to double and tagged values;
- HSimulate: special support added for deoptimization with uint32 values in registers and stack slots;
- HPhi: phis that have only safe uses and only uint32 operands are uint32 themselves.

BUG=v8:2097
TEST=test/mjsunit/compiler/uint32.js

Review URL: https://chromiumcodereview.appspot.com/10778029

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12367 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-08-22 15:44:17 +00:00
rossberg@chromium.org
42552808ab Rename "global context" to "native context",
in anticipation of the upcoming lexical global scope.

Mostly automatised as:

for FILE in `egrep -ril "global[ _]?context" src test/cctest`
do
  echo $FILE
  sed "s/Global context/Native context/g" <$FILE >$FILE.0
  sed "s/global context/native context/g" <$FILE.0 >$FILE.1
  sed "s/global_context/native_context/g" <$FILE.1 >$FILE.2
  sed "s/GLOBAL_CONTEXT/NATIVE_CONTEXT/g" <$FILE.2 >$FILE.3
  sed "s/GlobalContext/NativeContext/g" <$FILE.3 >$FILE
  rm $FILE.[0-9]
done

R=mstarzinger@chromium.org
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10832342

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12325 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-08-17 09:03:08 +00:00
svenpanne@chromium.org
018670f2e4 Change the maximum optimization count into a commandline flag.
This is needed for some unit tests, which otherwise do not test what people
think they do. ;-)

Review URL: https://chromiumcodereview.appspot.com/10823362

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12318 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-08-16 11:40:03 +00:00
svenpanne@chromium.org
f5f8ebd4ed Fix accessor lookup in crankshaft.
Seeing monomorphic type feedback plus an AccessorPair does not necessarily imply
that the corresponding getter/setter is really there, so we have to check for
this explictly.

TEST=mjsunit/object-define-property

Review URL: https://chromiumcodereview.appspot.com/10825384

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12317 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-08-16 10:35:39 +00:00
svenpanne@chromium.org
f9aea9fcef Inline simple setter calls.
Currently only simple setter calls are handled (i.e. no calls in count
operations or compound assignments), and deoptimization in the setter is not
handled at all. Because of the latter, we temporarily hide this feature behind
the --inline-accessors flag, just like inlining getters.

We now use an enum everywhere we depend on the handling of a return value,
passing around several boolean would be more confusing.

Made VisitReturnStatement and the final parts of TryInline more similar, so
matching them visually is a bit easier now.

Simplified the signature of AddLeaveInlined, the target of the HGoto can simply
be retrieved from the function state.

Review URL: https://chromiumcodereview.appspot.com/10836133

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12286 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-08-10 09:05:42 +00:00
svenpanne@chromium.org
22e3c0ae04 Use the correct oracle in TestContext::BuildBranch.
When inlining is being done, it is crucial to use the correct type feedback
oracle with a given type feedback ID. To ensure this, TestContext now carries an
oracle which is associated with the context's condition, and these are both used
together in TestContext::BuildBranch.

Note that in VisitReturnStatement and TryInline we are currently lucky that the
oracles don't go out of sync in an observable way, but this will change when we
inline setters. Therefore, there is no separate test case...

Review URL: https://chromiumcodereview.appspot.com/10834247

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12284 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-08-09 11:44:56 +00:00
svenpanne@chromium.org
5deec59302 Unify handling of bailout IDs for property loads.
Renamed Property::ReturnId to Property::LoadId, which describes its use more
accurately. Compound assignments and CountOperations now consistently use
Property::LoadId() instead of their own CompoundLoadId/CountId.

Review URL: https://chromiumcodereview.appspot.com/10832157

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12268 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-08-07 14:06:25 +00:00
jkummerow@chromium.org
23a270c6e7 Refactor Math.min/max to be a single HInstruction.
That allows us to dynamically compute representations and insert appropriate HChange instructions.

Review URL: https://chromiumcodereview.appspot.com/10829169

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12265 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-08-06 14:28:27 +00:00
erik.corry@gmail.com
92f30d1df5 Improve load IC so it can call a native accessor even if the holder is
in dictionary mode.  Add a flag to all maps to indicate whether they are
used for dictionary (normalized) objects or fast mode objects.
Review URL: https://chromiumcodereview.appspot.com/10831153

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12264 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-08-06 14:25:19 +00:00
svenpanne@chromium.org
b5da7279b1 Introduced TypeFeedbackId and BailoutId types.
This is a refactoring-only CL which improves the typing of IDs associated with
AST nodes. The interesting parts are in utils.h and ast.h, the rest of the CL
basically follows mechanically.

Review URL: https://chromiumcodereview.appspot.com/10831172

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12263 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-08-06 14:13:09 +00:00
svenpanne@chromium.org
83fc4205f6 Fixed compound/count operations with getter-only accessor properties.
The underlying problem is that for compound/count operations we use the *load*
type feedback for storing, too. For normal properties this doesn't matter, but
for accessor properties we should better use the *store* type feedback, which
would be available, too. This consistent feedback usage could be guaranteed if
we removed the heavy copy-n-paste in the crankshaft code generation for
compound/count operations and assignments/property loads.

To be on the safe side, we postpone this refactoring and do a quick and easily
mergeable fix.

BUG=140083
TEST=mjsunit/regress/regress-crbug-140083.js

Review URL: https://chromiumcodereview.appspot.com/10828146

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12252 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-08-03 09:45:08 +00:00
danno@chromium.org
9641c25573 Improve constant element index access code generation
R=jkummerow@chromium.org

Review URL: https://chromiumcodereview.appspot.com/10831049

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12232 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-31 08:44:51 +00:00
svenpanne@chromium.org
cb4840c0e5 Inline simple getter calls.
Currently only simple getter calls are handled (i.e. no calls in count
operations or compound assignments), and deoptimization in the getter is not
handled at all. Because of the latter, we temporarily hide this feature behind a
new flag --inline-accessors, which is false by default.

Review URL: https://chromiumcodereview.appspot.com/10828066

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12223 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-30 10:42:21 +00:00
svenpanne@chromium.org
7fd21aa7a1 Move some Pop/Drop calls directly to the places where they are needed.
This is a refactoring-only CL and the fourth one in a series for enabling
inlining of accessors. Later when we try to inline accessor calls, their
arguments must still be on the expression stack, so we must not remove them too
early.

Review URL: https://chromiumcodereview.appspot.com/10828049

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12213 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-27 12:35:44 +00:00
svenpanne@chromium.org
0923caccee Move BuildCallGetter/BuildCallSetter up in the call chain.
This is a refactoring-only CL and the third one in a series for enabling
inlining of accessors. The goal of this CL is to move the builders for accessors
to the places where we might be able to inline them later, i.e. the VisitFoo and
HandleBar member functions of HGraphBuilder.

Extracted duplicate code into LookupAccessorPair.

Review URL: https://chromiumcodereview.appspot.com/10831047

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12209 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-27 09:43:06 +00:00
svenpanne@chromium.org
eddf5edb62 Cleaned up BuildLoadNamed/BuildStoreNamed.
This is a refactoring-only CL and the second one in a series for enabling
inlining of accessors. It makes BuildLoadNamed and BuildStoreNamed a bit more
uniform and makes it clear that they both handle monomorphic accesses only.

Review URL: https://chromiumcodereview.appspot.com/10820028

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12205 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-27 06:27:47 +00:00
svenpanne@chromium.org
0f800eef8e Cleaned up Hydrogen function signatures related to property access.
This is a refactoring-only CL and the first one in a series for enabling
inlining of accessors. The naming and argument order has been unified a bit, and
some tests have been pushed to the caller in order to get a simpler
signature. Note that the latter temporarily introduces some code redundancy, but
this will be cleaned up in one of the next CLs.

Review URL: https://chromiumcodereview.appspot.com/10826028

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12198 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-26 08:55:22 +00:00
danno@chromium.org
3667f92cbb Add dependency to HLoadKeyed* instructions to prevent invalid hoisting
BUG=chromium:137768
TEST=test/mjsunit/regress/regress-137768.js

Review URL: https://chromiumcodereview.appspot.com/10802038

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12173 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-23 13:59:24 +00:00
danno@chromium.org
8c89cc4cab Optimize Smi keys for KeyedLoads
Allows KeyeLoad/KeyedStore operations where the key is a Smi to fold the untagging of the key into the element offset calculation.

Review URL: https://chromiumcodereview.appspot.com/10735020

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12156 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-20 11:00:33 +00:00
sanjoy@chromium.org
693c7643d2 Optimize functions on a second thread.
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10807024

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12148 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-19 18:58:23 +00:00
svenpanne@chromium.org
e81b194fcf Simplify TryInline's signature.
We don't actually need the arguments of the call, just their count. This change
is needed because in an accessor call there is no explicit argument list.

Review URL: https://chromiumcodereview.appspot.com/10795029

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12144 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-19 10:46:03 +00:00
svenpanne@chromium.org
b24f8912bc Maintain the invariant that all HGraphBuilder::VisitFoo methods return void.
Additionally, this enables the use of a CHECK_ALIVE macro instead of
copy-n-paste code at one place.

This CL is part of a series of several yak-shaving CLs to prepare the inlining
of JavaScript accessors.

Review URL: https://chromiumcodereview.appspot.com/10783017

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12093 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-16 12:22:46 +00:00
svenpanne@chromium.org
f17ce0cc6a Make it clear that HInstruction's position is a write-once variable.
Review URL: https://chromiumcodereview.appspot.com/10782010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12087 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-16 09:49:00 +00:00
svenpanne@chromium.org
43e87a65e1 Added Crankshaft support for setters.
Refactored ComputeLoadStoreField a bit on the way to clarify a bit what it
actually does.

Review URL: https://chromiumcodereview.appspot.com/10692187

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12072 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-13 07:14:28 +00:00
sanjoy@chromium.org
2b0f88cc67 Install guards for new invariants required for parallel compilation.
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10700185

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12068 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-12 15:40:05 +00:00
sanjoy@chromium.org
31027880b0 Rename LChunkBase to LChunk, LChunk to LPlatformChunk and remove some unneeded explicit constructor attributes.
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10701157

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12067 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-12 15:29:14 +00:00
sanjoy@chromium.org
c1ee1b457f Break Crankshaft into phases.
Crankshaft now runs by calling CreateGraph on the HGraphBuilder, then
calling Optimize and Codegen on the HGraph.

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10700115

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12064 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-12 15:10:34 +00:00
svenpanne@chromium.org
b8a7abd1fc Perform HasFastProperties check on prototypes when computing call targets in Crankshaft, part 2.
The previous fix was for "real" calls, this one is for getters. It is a bit
unfortunate that this has to be fixed twice: We should really break up
Call::ComputeTarget into a predicate and 1 or 2 getters, so code can be reused.

The regression test has been modified a bit to make things more uniform.

Review URL: https://chromiumcodereview.appspot.com/10702164

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12053 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-12 09:32:26 +00:00
sanjoy@chromium.org
5765fa2546 Defer creating Handles for HConstants to the code generation phase.
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10544196

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12048 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-11 16:17:02 +00:00
sanjoy@chromium.org
951b64d55f Remove duplicated LChunk code.
Divide the LChunk class into an arch-independent LChunkBase and an
arch-dependent LChunk which inherits from LChunkBase.

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10701141

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12045 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-11 14:42:17 +00:00
svenpanne@chromium.org
b3422df4ca Re-land "Removed one copy-n-paste clone of HGraphBuilder::BuildStoreNamed."
The previous CL used the wrong map in some cases, leading to a wrong decision
regarding monomorphic usage and therefore some performance regressions.

Review URL: https://chromiumcodereview.appspot.com/10694129

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12037 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-11 07:59:58 +00:00
mmassi@chromium.org
c74871f37b Fixed array bounds check elimination (Chromium issue 132114).
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10698125

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12025 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-10 11:01:29 +00:00
svenpanne@chromium.org
5b69228e56 Revert "Removed one copy-n-paste clone of HGraphBuilder::BuildStoreNamed."
It inadvertently introduced some performance regressions, e.g. for the
'richards' benchmark.

Review URL: https://chromiumcodereview.appspot.com/10704127

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12023 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-10 09:15:03 +00:00
svenpanne@chromium.org
9bcc823064 Removed one copy-n-paste clone of HGraphBuilder::BuildStoreNamed.
Review URL: https://chromiumcodereview.appspot.com/10689129

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12018 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-09 13:59:28 +00:00
svenpanne@chromium.org
9068d56f7f Added Crankshaft support for JavaScript getters.
Instead of calling the getter via a stub, we now call it more directly via a
(guarded) CallConstantFunction instruction.

Review URL: https://chromiumcodereview.appspot.com/10735023

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12013 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-09 11:33:53 +00:00
sanjoy@chromium.org
4a46de19e4 Add a second kind of HandleScope that ties the lifetime of Handles created in its scope to the lifetime of a given CompilationInfo.
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10697094

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11998 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-06 09:31:31 +00:00
svenpanne@chromium.org
dc92b21c06 Slightly generalize AddCheckConstantFunction.
This is needed for crankshafted accessors, which are syntactically not a Call.

Review URL: https://chromiumcodereview.appspot.com/10702109

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11997 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-06 08:34:48 +00:00
verwaest@chromium.org
d7a5b7d5e2 Separating transitions from descriptors.
In this design maps contain descriptor arrays, which in turn can contain transition arrays. If transitions are needed when no descriptor array is present, a descriptor array without real descriptors is inserted just so it can point at the transition array.

The transition array does not contain details about the field it transitions to. In order to weed out transitions to FIELDs from CONSTANT_FUNCTION (what used to be MAP_TRANSITION vs CONSTANT_TRANSITION), the transition needs to be followed and the details need to be looked up in the target map. CALLBACKS transitions are still easy to recognize since the transition targets are stored as an AccessorPair containing the maps, rather than the maps directly.

Currently AccessorPairs containing a transition and an accessor are shared between the descriptor array and the transition array. This simplifies lookup since we only have to look in one of both arrays. This will change in subsequent revisions, when descriptor arrays will become shared between multiple maps, since transitions cannot be shared.

Review URL: https://chromiumcodereview.appspot.com/10697015

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11994 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-05 13:54:20 +00:00
sanjoy@chromium.org
10441e954b Don't actually create Handles for the constant hole, the true value and the false value. This is required to have some parts of Crankshaft run without creating Handles.
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10699052

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11980 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-03 10:42:03 +00:00
danno@chromium.org
ec65e4fe78 Consolidate similar KeyedLoads to worst case instead of transitioning elements
R=jkummerow@chromium.org

Review URL: https://chromiumcodereview.appspot.com/10692043

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11959 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-06-29 22:27:25 +00:00
sanjoy@chromium.org
d9d76b7a5c Revert 11939 'Add a CompilationHandleScope' since it breaks array-sort.js in Win32 Release.
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10698031

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11943 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-06-28 12:34:51 +00:00
mstarzinger@chromium.org
df35732ab2 Allow inlining of functions containing RegExp literals.
R=yangguo@chromium.org
BUG=v8:1322
TEST=mjsunit/compiler/inline-literals

Review URL: https://chromiumcodereview.appspot.com/10703005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11940 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-06-27 11:49:37 +00:00
sanjoy@chromium.org
64e7c6b13e Add a second kind of HandleScope that ties the lifetime of Handles created in its scope to the lifetime of a given CompilationInfo.
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10640012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11939 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-06-27 11:47:47 +00:00
verwaest@chromium.org
1cff0c498e Cleaning up usage of lookup results.
- Ensure that IsFound() is only used when not in combination with other
  checks. To do so, the default type is NONEXISTENT rather than NORMAL;
  and NotFound() also resets the type to NONEXISTENT.
- Use test methods rather than .type() == A_PROPERTY_TYPE.

Review URL: https://chromiumcodereview.appspot.com/10626004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11899 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-06-21 15:32:52 +00:00
sanjoy@chromium.org
9e4fbb45c1 One Zone per CompilationInfo.
The CompilationInfo record now saves a Zone, and the compiler pipeline
allocates memory from the Zone in the CompilationInfo.  Before
compiling a function, we create a Zone on the stack and save a pointer
to that Zone to the CompilationInfo; which then gets picked up and
allocated from.

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10534139

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11877 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-06-20 08:58:41 +00:00
rossberg@chromium.org
3e6b01df18 Fix crash bug in Hydrogen occurring with empty prototype chain.
(Thanks for diagnosing this.)

R=vegorov@chromium.org
BUG=115100
TEST=

Review URL: https://chromiumcodereview.appspot.com/10576013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11861 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-06-19 13:44:07 +00:00
mmassi@chromium.org
f6b5dc6628 Remove default from switch.
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10555026

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11849 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-06-18 12:56:49 +00:00
mmassi@chromium.org
8367ca9980 Reimplemented HGraph::Postorder and HGraph::PostorderLoopBlocks iteratively to avoid stack overflows.
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10543138

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11843 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-06-18 11:59:02 +00:00
fschneider@chromium.org
bb0a2ea766 Share optimized code for closures.
Each SharedFunctionInfo gets an optimized code map to store
one optimized code object per context. When allocating a new
closure we consult this map and check if there is optimized code
that can be shared.

This patch is based on an original patch
by Anton Muhin (http://codereview.chromium.org/6793013/).

BUG=v8:2087, v8:2094
TEST=test/mjsunit/compiler/optimized-closures.js
Review URL: https://chromiumcodereview.appspot.com/10103035

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11817 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-06-14 14:06:22 +00:00
danno@chromium.org
43a1f5e25d Eliminate redundant smi checks
R=mstarzinger@chromium.org

Review URL: https://chromiumcodereview.appspot.com/10543094

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11774 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-06-12 12:16:19 +00:00
vegorov@chromium.org
75ca3e3395 Reimplement dynamic frame alignment for frames that are compiled via OSR or have more than 2 double spill slots.
The first spill slot is now reserved on all optimized frames to distinguish frames that were aligned.

Review URL: https://chromiumcodereview.appspot.com/10532066

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11772 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-06-12 10:22:33 +00:00
sanjoy@chromium.org
6125718f37 Remove TLS access for current Zone.
By passing around a Zone object explicitly we no longer need to do a
TLS access at the sites that allocate memory from the current Zone.

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10534006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11761 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-06-11 12:42:31 +00:00
mmassi@chromium.org
d9f393d1c9 Add guard against self assignment.
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10537024

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11756 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-06-11 11:25:10 +00:00
danno@chromium.org
4e525b85fc Optimistically assume that elements IC only transition once.
Thanks to Zheng Liu for identifying this issue.

R=jkummerow@chromium.org
BUG=v8:2141
TEST=test/mjsunit/elements-kind.js

Review URL: https://chromiumcodereview.appspot.com/10532063

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11739 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-06-08 13:06:24 +00:00
vegorov@chromium.org
d04ba1b2fb Improve representation inference
- Extend HValue interface to allow splitting observed input representation (comming from type feedback) from required input representation (dictated by instruction itself). Currently all instructions except for bitwise binary operations have this representations match. For bitwise binary operations hydrogen builder unconditionaly forces Integer32 representation for those operations that have Double type feedback. Thus causing representation inference to incorrectly count such uses as Integer32 instead of Double. This change also prepares for more fine grained type feedback for inputs of binary operations.

- For phies that are not convertable to Integer32 discard direct and indirect use count of Integer32 type to avoid propagation of these uses to connected phies.

R=jkummerow@chromium.org
BUG=v8:2096

Review URL: https://chromiumcodereview.appspot.com/10540049

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11737 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-06-08 09:21:23 +00:00
rossberg@chromium.org
4ea1fc0d27 Remove one more case behind --es5_readonly flag.
Plus add a couple of assertions.

R=mstarzinger@chromium.org
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10535011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11719 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-06-05 16:56:53 +00:00
mmassi@chromium.org
bf3a25b337 Transform HGlobalValueNumberer::AnalyzeBlock from recursive into an iteraive loop keeping the traversal state in the zone instead of on the stack.
Fixed issue 129536.

BUG=129536
TEST=

Review URL: https://chromiumcodereview.appspot.com/10520004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11712 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-06-05 08:59:39 +00:00
sanjoy@chromium.org
98db16d94f Progress towards making Zones independent of Isolates and Threads.
This CL changes some parts of the code to explicitly pass around a
Zone.  Not passing in a zone is okay too (in fact most of v8 still
doesn't), but that may incur a TLS lookup.

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10443114

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11709 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-06-04 14:42:58 +00:00
rossberg@chromium.org
e4c472a7af Implement correct checking for inherited readonliness on assignment.
Removes 6 out of 8 of our remaining unintentional failures on test262.

Also fixes treatment of inherited setters added after the fact.

Specifically:

- In the runtime, when looking for setter callbacks in the prototype chain,
  also look for read-only properties. If one is found, reject (exception in
  strict mode). If a proxy is found, invoke proper trap.
  Note: this folds in the CanPut function from the spec and avoids an extra
  lookup over the prototype chain.

- In generated code for stores, insert a test for the maps from the prototype
  chain, but only up to the object where the property already exists (which
  may be the object itself).
  In Hydrogen, if the found property is read-only or not cacheable (e.g. a
  proxy), bail out; in a stub, generate an unconditional miss (to get an
  exception in strict mode).

- Add test cases and adapt existing test expectations.

R=mstarzinger@chromium.org
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10388047

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11694 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-06-01 10:51:36 +00:00
danno@chromium.org
9910edbb9a Implement tracking and optimizations of packed arrays
R=jkummerow@chromium.org
TEST=jkummerow@chromium.org

Review URL: https://chromiumcodereview.appspot.com/10170030

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11636 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-05-23 14:24:29 +00:00
mmassi@chromium.org
2fd1e1bbc2 Array index computation dehoisting.
When an array index (in an array access) is a simple "expression + constant", just embed the constant in the array access operation so that the full index expression is (potentially) no longer used and its live range can be much shorter.
This is effective in conjunction with array bounds check removal (otherwise the index is anyway used in the check).

Review URL: https://chromiumcodereview.appspot.com/10382055

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11596 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-05-21 07:59:50 +00:00
erik.corry@gmail.com
3d45e98b5e Remove %_SwapElements. This inlined runtime contained an optimization that was dangerous in the presence of incremental compaction. It also prevented QuickSort from array.js from being optimized by Crankshaft, so it is probably better to do without it. We have high hopes that this will fix bug=117879.
Review URL: https://chromiumcodereview.appspot.com/10392150

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11588 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-05-17 20:53:32 +00:00
erik.corry@gmail.com
9889994c08 Fix function sorter from 11482 with correct fix. The sorter
was reverted from trunk 3.10.8.1, with this change we can
repush it.
Review URL: https://chromiumcodereview.appspot.com/10377043

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11526 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-05-08 12:30:36 +00:00
erik.corry@gmail.com
cb8df6e624 Sort functions when doing megamorphic dispatch/inlining so their
order does not depend on the hash seed.
Review URL: https://chromiumcodereview.appspot.com/10270032

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11482 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-05-02 13:07:31 +00:00
danno@chromium.org
4b920a20ab Reduce expense of TraceGVN when --trace-gvn is off
R=mstarzinger@chromium.org

Review URL: https://chromiumcodereview.appspot.com/10233004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11444 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-04-26 09:07:39 +00:00
danno@chromium.org
b3f6c0b237 Fix 64-bit windows size_t assert
R=mstarzinger@chromium.org
TEST=Windows 64 bit build goes green

Review URL: https://chromiumcodereview.appspot.com/10221006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11438 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-04-25 15:41:57 +00:00
mmassi@chromium.org
93113da5a2 Eliminate redundant array bound checks (checks already performed earlier in the DT).
As a special case, for checks on index expressions with the form (expr + constant) if a smaller constant is checked later in the DT also eliminate the check.
Finally, if a larger constant is checked later in the same BB do the more general check (larger constant) earlier instead of the less general one.
This will not cause useless deoptimizations because, since we are in the same BB, all the checks would have been executed anyway.
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10032029

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11437 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-04-25 14:32:27 +00:00
danno@chromium.org
a1a4a1cf2f Use safe string utilities to fix Windows build error.
R=mstarzinger@chromium.org
TEST=waterfall goes green

Review URL: https://chromiumcodereview.appspot.com/10173023

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11434 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-04-25 13:12:00 +00:00
danno@chromium.org
39fa51d452 Improve --trace-gvn debug output
R=mstarzinger@chromium.org

Review URL: https://chromiumcodereview.appspot.com/10203010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11433 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-04-25 12:04:23 +00:00
svenpanne@chromium.org
cac8bbff6e Replaced the --limit-inling flag by three separate flags and bumped hard limits.
This change makes experiments with inlining limits much easier. Note that the
default values for the limits keep their old values for now. Renamed things a
bit for more consistency.

Review URL: https://chromiumcodereview.appspot.com/10162001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11397 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-04-20 10:42:12 +00:00
vegorov@chromium.org
fd9bd722bc Simplify invocation sequence at monomorphic function invocation sites.
Provide known target as a hint to HInvokeFunction instruction so that it can statically determine if arguments adaptation is required.

R=fschneider@chromium.org
BUG=v8:2079

Review URL: https://chromiumcodereview.appspot.com/10116021

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11364 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-04-18 09:38:45 +00:00
mstarzinger@chromium.org
47d07b8a7b Fix fast array literals to ignore prototype chain.
This makes sure that boilerplate objects for array literals with
non-constant elements (which will contain the hole at non-constant
positions) will not cause prototype chain lookups when generating
optimized code.

R=erik.corry@gmail.com
BUG=chromium:123512
TEST=mjsunit/regress/regress-123512

Review URL: https://chromiumcodereview.appspot.com/10105025

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11350 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-04-17 11:12:37 +00:00
rossberg@chromium.org
ab26fb6b21 Implement rudimentary module linking.
Constructs the (generally cyclic) graph of module instance objects
and populates their exports. Any exports other than nested modules
are currently set to 'undefined' (but already present as properties).

Details:
- Added new type JSModule for instance objects: a JSObject carrying a context.
- Statically allocate instance objects for all module literals (in parser 8-}).
- Extend interfaces to record and unify concrete instance objects,
  and to support iteration over members.
- Introduce new runtime function for pushing module contexts.
- Generate code for allocating, initializing, and setting module contexts,
  and for populating instance objects from module literals.
  Currently, all non-module exports are still initialized with 'undefined'.
- Module aliases are resolved statically, so no special code is required.
- Make sure that code containing module constructs is never optimized
  (macrofy AST node construction flag setting while we're at it).
- Add test case checking linkage.

Baseline: http://codereview.chromium.org/9722043/

R=svenpanne@chromium.org,mstarzinger@chromium.org
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/9844002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11336 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-04-16 14:43:27 +00:00
rossberg@chromium.org
ed68932861 Refactor code generation for global declarations.
(Baseline is http://codereview.chromium.org/9704054/)

R=fschneider@chromium.org
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/9722043

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11332 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-04-16 12:26:16 +00:00
rossberg@chromium.org
43a52c4cee Refactoring of code generation for declarations, in preparation for modules.
Do proper dispatch on declaration type instead of mingling together
different code generation paths. Once we add more declaration forms,
this is more scalable.

In separate steps, I'd like to (1) clean up the logic for DeclareGlobal,
and (2) try to reduce the special handling of the name function var if
possible.

R=fschneider@chromium.org
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/9704054

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11331 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-04-16 11:48:20 +00:00
vegorov@chromium.org
983d521fe9 Reland arguments access support for inlined functions (r11109,r11118).
When pushing arguments use correct initial values instead of fetching them from the environment which can be modified.

R=fschneider@chromium.org
TEST=test/mjsunit/compiler/inline-arguments.js

Review URL: https://chromiumcodereview.appspot.com/10033028

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11274 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-04-11 13:40:55 +00:00
mstarzinger@chromium.org
82cde7c832 Remove write-barriers for stores to new-space objects.
This change allows hydrogen instructions to keep track of instructions
that dominate certain side-effects (GVN flags) in the hydrogen graph. We
use the GVN pass to keep track of side-effects because accurate flags
are already in place.

It also adds a new side-effect (kChangesNewSpacePromotion) indicating
whether an instruction can cause a GC and have objects be promoted to
old-space. An object allocated in new-space is sure to stay on paths not
having said side-effect.

R=erik.corry@gmail.com
TEST=mjsunit/compiler/inline-construct

Review URL: https://chromiumcodereview.appspot.com/10031031

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11270 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-04-11 10:56:16 +00:00
vegorov@chromium.org
e831ec2c4e Bailout on possible direct eval calls.
Environment structure for such calls is different from normal global calls.

R=fschneider@chromium.org
BUG=chromium:122681

Review URL: https://chromiumcodereview.appspot.com/10024060

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11256 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-04-10 13:41:00 +00:00
mstarzinger@chromium.org
78226352b7 Ensure HAllocateObject always allocates in new-space.
This is needed so that we can start removing write-barriers in optimized
code if we can prove that the receiver object is always in new-space.

TEST=cctest/test-heap/OptimizedAllocationAlwaysInNewSpace

Review URL: https://chromiumcodereview.appspot.com/10008007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11243 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-04-05 15:36:31 +00:00
ulan@chromium.org
3861063018 Check for NaN in inlined versions of Math.min, Math.max.
R=danno@chromium.org
BUG=V8:2056
TEST=mjsunit/regress/regress-2056.js

Review URL: https://chromiumcodereview.appspot.com/10006008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11237 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-04-05 13:24:52 +00:00
vegorov@chromium.org
8360ec877e Ensure that arguments object is materialized when deoptimizing from inlined function.
Lithium translation rebuilds hydrogen environments from scratch so we have to ensure that arguments object is correctly bound on function entry otherwise deoptimization will not materialize it.

This fix was implemented as part of r11109 and then reverted.

R=danno@chromium.org
BUG=v8:2045
TEST=test/mjsunit/regress/regress-2045.js

Review URL: https://chromiumcodereview.appspot.com/9963008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11194 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-30 13:22:39 +00:00
mstarzinger@chromium.org
057371da13 Fix polymorphic load on named fields.
This fixes polymorphic loads to correctly compare in-object offsets
instead of indices, because indices might coincide even though the
actual slot is different because of different instance sizes.

R=danno@chromium.org
BUG=v8:2030
TEST=mjsunit/regress/regress-2030,mjsunit/mirror-array

Review URL: https://chromiumcodereview.appspot.com/9864028

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11153 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-27 10:42:38 +00:00
mstarzinger@chromium.org
ab4e4cd917 Improve polymorphic loads on single slots.
If all property lookups for a polymorphic load actually result in the
same field index under all maps, we can actually emit a monomorphic load
that is guarded by a map check that verifies that the actual map is in
the set of handled maps. This also allows GVN to get rid of redundant
such map checks.

R=danno@chromium.org

Review URL: https://chromiumcodereview.appspot.com/9616014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11132 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-23 16:37:54 +00:00
vegorov@chromium.org
3ccc885c78 Revert arguments access support for inlined functions (r11109,r11118).
We are inserting HPushArgument instructions after HEnterInlined based on the environment at the point of the first arguments access. Which might create use before def if there are redundant phis in the environment. 
Review URL: https://chromiumcodereview.appspot.com/9837041

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11128 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-23 15:39:34 +00:00
mmassi@chromium.org
c39c2089a7 First implementation of fast path for instantiation of array literals composed of doubles.
Review URL: https://chromiumcodereview.appspot.com/9814006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11114 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-23 10:14:51 +00:00
vegorov@chromium.org
b7dca5d5a7 Support arguments object access from inlined functions.
R=fschneider@chromium.org
TEST=test/mjsunit/compiler/inline-arguments.js

Review URL: https://chromiumcodereview.appspot.com/9837002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11109 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-22 13:53:28 +00:00
fschneider@chromium.org
30a2f2c4ef When running with --always-opt, don't deoptimize named loads with uninitialized type feedback.
This avoids tests taking too long because of repeated deoptimizations.
Review URL: https://chromiumcodereview.appspot.com/9812004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11100 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-21 09:23:09 +00:00
vegorov@chromium.org
790219ec55 Use correct arguments adaptation environment when inlining function containing arguments.
R=mstarzinger@google.com
BUG=V8:2014
TEST=test/mjsunit/compile/inline-arguments.js

Review URL: https://chromiumcodereview.appspot.com/9750007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11098 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-20 18:15:31 +00:00
fschneider@chromium.org
e081a3bfba Insert explicit deoptimization for named loads that have "uninitialized" type feedback.
We already do this for binary-ops, unary-ops and comparisons. Typefeedback for named loads can now also
be in "uninitialized" state which means that the corresponding load IC was never executed.
Review URL: https://chromiumcodereview.appspot.com/9722041

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11087 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-19 15:54:37 +00:00
fschneider@chromium.org
1c99c90be7 Re-enable constructor inlining and inline === comparison with boolean constants.
This change reverts r10974 which disabled those two optimizations.
They were not responsible for the problem in earley-boyer.

BUG=v8:2009
Review URL: https://chromiumcodereview.appspot.com/9699117

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11076 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-19 07:51:37 +00:00
vegorov@chromium.org
211a867943 Improve representation inference for HUnknownOSRValue.
Use corresponding phi from the loop entry as a hint to infer proper representation for HUnkownOSRValue and dependent phis.

R=fschneider@chromium.org

Review URL: https://chromiumcodereview.appspot.com/9704012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11055 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-15 12:21:29 +00:00
mstarzinger@chromium.org
fe1440f339 Remove unused local variable after r11023.
R=svenpanne@chromium.org

Review URL: https://chromiumcodereview.appspot.com/9699023

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11044 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-14 14:08:36 +00:00
vegorov@chromium.org
966ebf8f55 Don't take UnkownOSRValues into account when infering Phi's representation.
For DIV with uninitialized result assume double result representation.

R=fschneider@chromium.org

Review URL: https://chromiumcodereview.appspot.com/9664070

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11041 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-14 12:59:49 +00:00
vegorov@chromium.org
262c8bddd5 Always create HArgumentsObject on function entry.
We do not know if we are going to need it and creating it lazyly might cause us to insert it at the block that does not dominate all uses.

R=mstarzinger@chromium.org
TEST=mjsunit/compiler/inline-arguments.js

Review URL: https://chromiumcodereview.appspot.com/9692046

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11024 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-13 14:45:03 +00:00
mstarzinger@chromium.org
0ab3fb8b00 Implement non-generic stores for object literals.
This uses the type feedback already present for computed value stores
into object literals to generate optimized stores in Crankshaft, thus
avoiding unnecessary generic stores with side effects.

R=svenpanne@chromium.org

Review URL: https://chromiumcodereview.appspot.com/9692036

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11023 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-13 12:11:46 +00:00
vegorov@chromium.org
da03f56b1f Inline functions that use arguments object in f.apply(o, arguments) pattern.
Support arguments materialization after deoptimization in all frames (not only in topmost one).

R=fschneider@chromium.org

Review URL: https://chromiumcodereview.appspot.com/9643001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11008 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-12 12:49:41 +00:00
ulan@chromium.org
1767fef60b Implement date library functions in C++.
Developed together with Andreas Rossberg based on:
  https://chromiumcodereview.appspot.com/9117034/
  https://chromiumcodereview.appspot.com/9307083/

R=rossberg@chromium.org

Review URL: https://chromiumcodereview.appspot.com/9572008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10983 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-09 12:07:29 +00:00
rossberg@chromium.org
8604da7f06 New class for Date objects: caches individual date components.
First step, cache slots not used yet.

R=ulan@chromium.org
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/9117034

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10981 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-09 11:11:55 +00:00
ulan@chromium.org
e6576f0938 Revert r10435 and r10923 because of failures.
r10435 CL: http://codereview.chromium.org/9195005
r10923 CL: https://chromiumcodereview.appspot.com/9601010

R=fschneider@chromium.org

Review URL: https://chromiumcodereview.appspot.com/9653025

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10974 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-09 09:04:39 +00:00
fschneider@chromium.org
886a1c6469 Avoid starting a new basic block when inlining a function.
Instead of creating a fresh basic block for the inlined body,
I just simulate the outer environment in the middle of the current
block before updating the current environment to the inlined environment and
emitting the enter-inlined instruction.
Review URL: https://chromiumcodereview.appspot.com/9618052

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10954 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-07 12:04:28 +00:00
mstarzinger@chromium.org
30305150fe Blocks that contain soft deopts have no side effects.
R=fschneider@chromium.org

Review URL: https://chromiumcodereview.appspot.com/9188005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10938 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-06 10:57:54 +00:00
fschneider@chromium.org
dfe0101cad Fix column formatting of --hydrogen-stats output by shortening a line.
TBR=ulan@chromium.org
Review URL: https://chromiumcodereview.appspot.com/9578013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10921 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-05 13:07:32 +00:00
mstarzinger@chromium.org
240e818f0c Fix inlining of strict mode constructors.
Inlined strict mode functions (that are not called as methods) will get
their receiver reset to undefined. This should not happen when inlining
constructors.

This change also simplifies the test suite to reuse the same closures
into which constructors get inlined and use gc() to force V8 to forget
collected type feedback.

R=vegorov@chromium.org
TEST=mjsunit/compiler/inline-construct

Review URL: https://chromiumcodereview.appspot.com/9597017

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10920 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-05 12:46:50 +00:00
yangguo@chromium.org
5ce562cda8 Reland r10908 (Ensure consistent result of transcendental function0.)
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/9583037

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10915 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-05 08:17:16 +00:00
yangguo@chromium.org
f2699b66cf Revert r10908 due to flakiness and crashes.
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/9580007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10909 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-02 15:00:52 +00:00
yangguo@chromium.org
12f2099993 Ensure consistent result of transcendental functions.
BUG=
TEST=regress-transcendental.js

Review URL: https://chromiumcodereview.appspot.com/9572009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10908 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-02 14:33:15 +00:00
fschneider@chromium.org
751d53d9d2 Make trace-hydrogen output more visualizer-friendly.
Review URL: https://chromiumcodereview.appspot.com/9580005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10904 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-02 13:05:59 +00:00
vegorov@chromium.org
ff6ebf7dff Introduce basic type feedback for for-in statements to avoid deopts.
R=fschneider@chromium.org

Review URL: https://chromiumcodereview.appspot.com/9571001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10901 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-02 11:33:33 +00:00
fschneider@chromium.org
1e40f7ac2c Fix a register assignment bug in typed array stores without SSE3 available.
The old code used a separate HToInt32 instruction which had a wrong register
constraint for the input register which caused wrong result when the stored value
is used after a typed array store. (UseRegister instead of UseTempRegister) when no
SSE3 is available.

This change fixes it by replacing HToInt32 with the corresponding HChange
instruction which has correct register contraints.

TEST=mjsunit/compiler/regress-toint32.js
Review URL: https://chromiumcodereview.appspot.com/9565007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10891 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-01 12:45:46 +00:00
mstarzinger@chromium.org
4eaaced657 Improve constructor inlining backout.
This improves the generated hydrogen graph by also removing the obsolete
HCheckFunction instruction if we backout of inlining constructors.

R=danno@chromium.org

Review URL: https://chromiumcodereview.appspot.com/9537004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10884 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-01 11:50:11 +00:00
fschneider@chromium.org
a8980079a0 Add flag --trace-phase to selectively produce IR trace output.
By default --trace-hydrogen only generates the final IR (before
code generation). The other phases can be printed by specifying
them by their first letter. Currently H=HIR, L=LIR or Z=final IR (default)
are recognized.
Review URL: https://chromiumcodereview.appspot.com/9535009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10882 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-01 11:33:37 +00:00
mstarzinger@chromium.org
fd5640cf7a Implement inlined object allocation in Crankshaft.
Generates inlined code for object allocation specific to the initial map
of the given constructor function. Also forces completion of inobject
slack tracking while crankshafting to finalize instance size of these
objects.

R=vegorov@chromium.org
TEST=mjsunit/compiler/alloc-object

Review URL: https://chromiumcodereview.appspot.com/9370019

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10881 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-03-01 11:10:28 +00:00
fschneider@chromium.org
b854d09721 Eliminate overflow check after integer add and sub operation if result is truncated to int32.
Review URL: https://chromiumcodereview.appspot.com/9286002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10870 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-02-29 13:41:18 +00:00
rossberg@chromium.org
b89c0a962c AST extensions and parsing for import & export declarations.
R=jkummerow@chromium.org
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/9496003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10866 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-02-29 12:12:52 +00:00
svenpanne@chromium.org
f9cdb0e18c Explicitly use a Zone when allocating Range.
This CL is a step towards removing ZoneObject's new operator without a Zone
parameter, which uses Isolate::Current. For e.g. the bulletben benchmark, this
CL reduces the number of calls to this new operator by roughly 120k, but we are
still left with 780k calls from other sites...

Review URL: https://chromiumcodereview.appspot.com/9487010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10860 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-02-28 15:32:58 +00:00
rossberg@chromium.org
d809d17f5d Further refactoring of declarations in the AST:
Define modules as module declarations.
Separate function declarations from var declarations.

R=jkummerow@chromium.org
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/9460064

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10854 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-02-28 10:12:39 +00:00