Commit Graph

569 Commits

Author SHA1 Message Date
verwaest@chromium.org
4cb46f4d57 Polymorphism support for numbers and strings
Necessary to support fast polymorphic toString.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13914 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-03-12 17:01:03 +00:00
jkummerow@chromium.org
00df65117d In the absence of type feedback, pessimistically force Tagged representation for UnaryAdd
BUG=v8:2527

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13890 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-03-11 08:42:07 +00:00
mvstanton@chromium.org
1691f43b8b To fully support hydrogen code stubs which accept a variable number of arguments,
the HReturn/LReturn instruction needs to be able to determine argument count
from a stack evaluation rather than as a constant from scope.

R=danno@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13888 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-03-08 21:07:55 +00:00
svenpanne@chromium.org
61a2c53d09 Track Hydrogen statistics on a per-Isolate basis
This is basically the same fix as the one for --trace-hydrogen, but now for
--hydrogen-stats. Removed a few train wrecks on the way.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13835 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-03-06 10:49:34 +00:00
svenpanne@chromium.org
0e3ed17ea4 Separate output files for --trace-hydrogen.
The output filenames have now the form "hydrogen-<ProcessId>-<IsolateId>.cfg".
Minor cleanup on the way.

Note that we have a similar bug regarding statistics, but this will be handled
in a separate CL.

BUG=v8:2563

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13834 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-03-06 07:25:46 +00:00
mvstanton@chromium.org
575c2c5a54 Bugfix: allow handle dereference only when we have a valid hydrogen graph or lithium chunk.
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13793 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-03-04 12:34:49 +00:00
mvstanton@chromium.org
c4caf766bf Allocation Info Tracking, continued.
Addresses missing cases for array literals.
Adds support for "new Array()" call sites. This isn't complete yet, I have to run with --noinline_new.

BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13790 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-03-01 16:06:34 +00:00
mvstanton@chromium.org
fce0a11f05 Handle dereferencing needs to be allowed for printing during optimization phase.
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13789 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-03-01 15:50:57 +00:00
rossberg@chromium.org
090d09d685 ES6 symbols: Implement Symbol intrinsic and basic functionality
- Add --harmony-symbols flag.
- Add Symbol constructor; allow symbols as (unreplaced) return value from constructors.
- Introduce %CreateSymbol and %_IsSymbol natives and respective instructions.
- Extend 'typeof' code generation to handle symbols.
- Extend CompareIC with a UNIQUE_NAMES state that (uniformly) handles internalized strings and symbols.
- Property lookup delegates to SymbolDelegate object for symbols, which only carries the toString method.
- Extend Object.prototype.toString to recognise symbols.

Per the current draft spec, symbols are actually pseudo objects that are frozen with a null prototype and only one property (toString). For simplicity, we do not treat them as proper objects for now, although typeof will return "object". Only property access works as if they were (frozen) objects (via the internal delegate object).

(Baseline CL: https://codereview.chromium.org/12223071/)

R=mstarzinger@chromium.org
BUG=v8:2158

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13786 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-03-01 13:28:55 +00:00
rossberg@chromium.org
55f93b5532 Renamed "symbols" to "internalized strings" throughout the code base,
in preparation of the introduction of ES6 'symbols' (aka private/unique names).

The SymbolTable became the StringTable. I also made sure to adapt all comments. The only remaining use of the term "symbol" (other than unrelated uses in the parser and such) is now 'NewSymbol' in the API and the 'V8.KeyedLoadGenericSymbol' counter, changing which might break embedders.

The one functional change in this CL is that I removed the former 'empty_string' constant, since it is redundant given the 'empty_symbol' constant that we also had (and both were used inconsistently).

R=yangguo@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13781 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-02-28 17:03:34 +00:00
svenpanne@chromium.org
bfaf38d2fd Miscellaneous profile-driven Isolate plumbing.
While doing this, it became clear that quite a few functions should not be
static and should better live in various classes as instance methods, but I'll
leave this for a later CL.

BUG=v8:2487

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13765 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-02-27 14:45:59 +00:00
svenpanne@chromium.org
c26d100b10 Avoid TLS accesses in Object::Lookup and Object::GetPrototype.
Both methods were among the top causes for TLS accesses.

BUG=v8:2487

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13759 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-02-27 13:22:29 +00:00
mstarzinger@chromium.org
7d681e014d Compile FastCloneShallowObjectStub using Crankshaft.
This changes FastCloneShallowObjectStub to be compiled independent of
the target architecture. It also adds tracing to the deoptimizer for
compiled stubs and contains some minor bugfixes.

R=danno@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13732 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-02-26 13:08:08 +00:00
svenpanne@chromium.org
fb6776e84a Made Isolate a mandatory parameter for everything Handle-related.
Unified parameter order of CreateHandle with the rest of v8 on the way. A few
Isolate::Current()s had to be introduced, which is not nice, and not every place
will win a beauty contest, but we can clean this up later easily in smaller steps.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13717 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-02-25 14:46:09 +00:00
danno@chromium.org
cbe088fffc Fix bugs in generating and printing of Crankshaft stubs
Review URL: https://codereview.chromium.org/12317044

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13716 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-02-25 14:03:09 +00:00
yangguo@chromium.org
0d63cef35b Constant fold math and string operations.
R=jkummerow@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13705 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-02-21 11:40:37 +00:00
jkummerow@chromium.org
e93011892e Avoid creating unnecessary branches in Hydrogen
Review URL: https://codereview.chromium.org/12281019

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13704 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-02-21 11:29:51 +00:00
mmassi@chromium.org
0832d08dd9 Also check if the length ia a smi in a HBoundsCheck.
Review URL: https://codereview.chromium.org/12301026

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13701 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-02-21 09:09:01 +00:00
mmassi@chromium.org
bb886feb20 Remove purely informative definitions from the graph.
Review URL: https://codereview.chromium.org/12282033

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13696 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-02-19 16:32:02 +00:00
mstarzinger@chromium.org
300413b5a9 Fix f.apply() optimization when declared arguments are mutated.
R=verwaest@chromium.org
BUG=v8:2539
TEST=mjsunit/regress/regress-2539

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13673 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-02-14 15:12:49 +00:00
mstarzinger@chromium.org
05e95eee0e Allow full inlining of f.apply(this, arguments) calls.
This allows Crankshaft to completely inline a f.apply() dispatch if the
exact number of arguments is known and the function is constant. The
deoptimizer doesn't generate the f.apply() frame during deoptimization,
so the materialized frames look like f.apply() did a tailcall.

R=jkummerow@chromium.org
TEST=mjsunit/compiler/inline-function-apply

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13665 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-02-14 09:55:50 +00:00
jkummerow@chromium.org
19dab057b4 Fix NegateCompareOp and InvertCompareOp
BUG=v8:2537

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13658 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-02-13 14:36:19 +00:00
mmassi@chromium.org
a5c6716cf5 Infrastructure classes for evaluating numeric relations between values.
Review URL: https://codereview.chromium.org/12226112

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13656 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-02-13 14:16:15 +00:00
svenpanne@chromium.org
e108d2a87c Don't try to unlink instructions twice during GVN
BUG=chrome:175141

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13648 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-02-12 14:00:39 +00:00
mmassi@chromium.org
2fb5064487 Separated smi check from HBoundsCheck.
Review URL: https://codereview.chromium.org/12208013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13645 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-02-12 11:44:08 +00:00
danno@chromium.org
0c3575c874 Generate the TransitionElementsStub using Crankshaft
This includes:
* Adding support for saving callee-clobbered double registers in Crankshaft code.
* Adding a new "HTrapAllocationMemento" hydrogen instruction to handle AllocationSiteInfo data in crankshafted stubs.
* Adding a new "HAllocate" hydrogen instruction that can allocate raw memory from the GC in crankshafted code.
* Support for manipulation of the hole in HChange instructions for Crankshafted stubs.
* Utility routines to manually build loops and if statements containing hydrogen code.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13585 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-02-04 12:01:59 +00:00
mmassi@chromium.org
3b8a61dcf3 Base iDef update code.
Review URL: https://codereview.chromium.org/12079042

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13575 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-02-01 10:16:16 +00:00
mmassi@chromium.org
89c4153581 Foundation for the use of informative definitions in Crankshaft.
Review URL: https://codereview.chromium.org/12090021

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13543 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-29 15:46:34 +00:00
mstarzinger@chromium.org
fe8e97798e Allow inlining of multiple closures from shared function.
This allows Crankshaft to allow inlining of multiple different closures
that were all derived from the same shared function info. This pattern
appears when libraries provide generic closures that are used over and
over again at different call-sites.

R=jkummerow@chromium.org
TEST=mjsunit/compiler/inline-closures

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13522 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-25 16:55:00 +00:00
svenpanne@chromium.org
47d2fa5c51 Slightly improved Hydrogen stats output for long-running compilations.
Replaced a scary pointer comparison by strcmp on the way.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13510 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-25 13:55:02 +00:00
svenpanne@chromium.org
b5cb682be6 Avoid excessive memory usage during redundant phi elimination.
Basically, the work list for the fixed point iteration has been removed.

BUG=v8:2510

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13505 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-25 11:51:48 +00:00
mstarzinger@chromium.org
44ffa0dcd3 Allow monomorphic loads when static type is known.
This allows Crankshaft to generate monomorphic loads when the receiver
type is statically known even though the load site has polymorphic type
feedback. This applies to inlined constructor calls and literals.

R=jkummerow@chromium.org
TEST=mjsunit/compiler/property-static

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13500 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-24 17:54:30 +00:00
yangguo@chromium.org
c14b9b3703 Fix --hydrogen-stats.
V8 crashes with this flag when trying to compile hydrogen stubs.

R=jkummerow@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13487 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-24 08:39:35 +00:00
yangguo@chromium.org
3c22524119 Avoid handle dereference during graph optimization.
With parallel recompilation enabled, objects made accessible by handles may
have changed between graph construction and graph optimization. Therefore
we must not assume that information on those objects remain the same between
those two phases. To police this, we forbid handle dereferencing during
graph optimization.
Exceptions to this rule are:
 - Dereferencing the handle to obtain the raw location of the object. This
   is safe since parallel recompilation acquires RelocationLock
 - Some places that dereference the handle for a type check. These are checked
   to be safe on a case-by-case basis.

R=jkummerow@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13475 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-23 13:52:00 +00:00
ulan@chromium.org
79a0e3b017 Fix pattern detection for replacing shifts by rotation.
BUG=2499
R=svenpanne@chromium.org

Review URL: https://chromiumcodereview.appspot.com/12047015
Patch from Hirofumi Mako <mkhrfm@gmail.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13464 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-22 13:55:22 +00:00
mstarzinger@chromium.org
f8d5260af7 Allow loading constant function from proto chain.
This enables Crankshaft to use HConstant for loading constant functions
on the prototype chain when building a monomorphic load. This pattern
appears in several JavaScript frameworks.

R=svenpanne@chromium.org
TEST=mjsunit/compiler/proto-chain-constant

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13463 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-22 12:03:35 +00:00
yangguo@chromium.org
7f331f6280 Make HCheckPrototypeMaps compatible with parallel recompilation.
HCheckPrototypeMaps currently records the prototype and the holder of the
prototype chain (both ends of the chain) and assumes that the chain elements
and their maps did not change in during the entirety of Crankshaft. The actual
traversal of the prototype chain happens in Lithium at code generation.
With parallel compilation, this assumption is not longer correct.

R=mstarzinger@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13454 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-21 15:49:00 +00:00
jkummerow@chromium.org
b7079a5dfb Disable elimination of unreachable code after HSoftDeopts
Review URL: https://codereview.chromium.org/12036011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13448 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-21 14:11:25 +00:00
jkummerow@chromium.org
8a6221b1ed Don't insert HDummyUses for control instructions
Review URL: https://codereview.chromium.org/11941013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13421 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-18 09:19:11 +00:00
mmassi@chromium.org
ca78326b66 Revert r13409 ("Make the array bounds check elimination phase optional (and set the foundation for introducing SSI in a simple way).") because of a crash in octane/mandreel.
Review URL: https://chromiumcodereview.appspot.com/11962041

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13416 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-17 16:09:08 +00:00
jkummerow@chromium.org
a496e0d06a Don't emit code for instructions that are hiding behind an HSoftDeoptimize
Review URL: https://codereview.chromium.org/11377135

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13412 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-17 14:07:47 +00:00
mmassi@chromium.org
583f67b54b Make the array bounds check elimination phase optional (and set the foundation for introducing SSI in a simple way).
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13409 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-17 12:39:16 +00:00
mvstanton@chromium.org
7884216804 Additional work to get array literal allocation tracking working, even with --always-opt
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13406 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-17 08:41:27 +00:00
mstarzinger@chromium.org
0484ddcf50 Fix arguments materialization for inlined apply().
This fixes materialization of the arguments object in case the constant
function check if TryCallApply() inside an inlined frame fails.

R=svenpanne@chromium.org
BUG=v8:2489
TEST=mjsunit/regress/regress-2489

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13386 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-16 09:25:45 +00:00
yangguo@chromium.org
45f20e366a Introduce ENABLE_LATIN_1 compile flag
Mostly a bunch of renaming when flag is disabled.

R=yangguo@chromium.org
BUG=

Review URL: https://chromiumcodereview.appspot.com/11759008
Patch from Dan Carney <dcarney@google.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13340 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-09 10:30:54 +00:00
svenpanne@chromium.org
eb9a22cc8b Environment bookkeping has linear time complexity now, not a quadratic one.
This reduces the time take for mjsunit/limit-locals from 56.8s to 15.1s in debug
mode and from 12.0s to 1.6s in release mode.

Note that GrowableBitVector and BitVector should really be merged, and probably
have their allocation strategy parmeterized. The current state of affairs
involving tons of checks and delegation is extremely ugly, and it is far from
clear if all that special casing is a clear win. STL FTW! :-P

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13327 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-07 15:28:20 +00:00
verwaest@chromium.org
11c2557452 Check interceptor before optimizing load/store
Review URL: https://chromiumcodereview.appspot.com/11753027

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13324 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-07 12:14:36 +00:00
danno@chromium.org
45a012ec2c Elide unnecessary context reload in generated stubs.
Review URL: https://codereview.chromium.org/11550005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13290 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-12-28 16:25:38 +00:00
rossberg@chromium.org
97eba9d3cd Object.observe: fix observation for optimised in/decrement and compound assignment.
R=svenpanne@chromium.org
BUG=v8:2409

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13255 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-12-20 15:03:30 +00:00
danno@chromium.org
1f4b4625ff Re-land Crankshaft-generated KeyedLoad stubs.
R=jkummerow@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13236 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-12-18 16:25:45 +00:00