Commit Graph

605 Commits

Author SHA1 Message Date
yangguo@chromium.org
28bbe46a98 Disallow dereferencing deferred handles when generating optimized code.
R=mvstanton@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14388 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-23 09:23:07 +00:00
mstarzinger@chromium.org
6f595c231a Replace CheckBuilder with IfBuilder everywhere.
This deprecates and removes the CheckBuilder which is less powerful
than the generic IfBuilder which can deopt as well by now.

R=jkummerow@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14372 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-22 11:15:43 +00:00
titzer@chromium.org
3575f97036 Refactor HCheckMaps to have a private constructor, removing duplicated code and simplifying calls in clients.
Ignore bsuite directory.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14362 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-19 16:46:13 +00:00
mstarzinger@chromium.org
e288a65ec1 Switch elements access to use IfBuilder instead of CheckBuilder.
R=danno@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14360 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-19 16:21:09 +00:00
danno@chromium.org
0c5c6c50bb Remove unused member variables in IfBuilder
R=jkummerow@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14351 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-19 13:20:45 +00:00
mstarzinger@chromium.org
adf9afc09e Fix missing Smi check in grow mode keyed stores.
R=danno@chromium.org
TEST=mjsunit/regress/regress-grow-store-smi-check

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14332 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-18 14:18:27 +00:00
titzer@chromium.org
e210d8325f Inline isUint32() method from HConstant, which was only used in one place.
Add utility method for checking whether an HValue is a given int32_t constant.

BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14329 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-18 11:22:29 +00:00
danno@chromium.org
fded35e019 Fix bugs in IfBuilder and improve functionality
R=mstarzinger@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14327 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-18 10:51:24 +00:00
yangguo@chromium.org
b3707c17d6 Inline String.fromCharCode in hydrogen.
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14315 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-17 16:37:11 +00:00
titzer@chromium.org
705735ce79 Remove previous_ast_id and related code in hydrogen.
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14308 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-17 14:11:39 +00:00
svenpanne@chromium.org
0d8b7f7608 Improve handling of unary plus.
Simple strategy: Transform unary plus into multiplication by one directly in the
parser and remove it from the Hydrogen graph later. This gives correct type
feedback without any special stub for it.

BUG=v8:2527

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14306 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-17 12:47:15 +00:00
jkummerow@chromium.org
586c4e74b6 Replace OS::MemCopy with OS::MemMove (just as fast but more flexible).
Review URL: https://codereview.chromium.org/13932006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14280 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-16 12:30:51 +00:00
yangguo@chromium.org
e1742a6716 Remove relocation lock.
Freeze HValue hash codes that are based on object addresses.

R=svenpanne@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14273 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-16 11:00:02 +00:00
hpayer@chromium.org
2345bdbeb3 Implement direct allocation in old data space infrastructure.
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14262 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-15 11:52:34 +00:00
svenpanne@chromium.org
f70bcae9a9 Actually implement the sqrt intrinsic in Crankshaft
Review URL: https://codereview.chromium.org/13844009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14260 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-15 10:36:12 +00:00
dslomov@chromium.org
1441a13599 Homogenizes map checks for all polymorphic named field loads.
Tests show no perf regressions

BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14259 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-15 09:05:50 +00:00
hpayer@chromium.org
acc4568aff Enable pretenuring of fast literals in high promotion mode.
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14248 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-12 09:45:46 +00:00
hpayer@chromium.org
e7a5e69688 Remove unnecessary BailoutIds.
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14246 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-12 09:36:56 +00:00
hpayer@chromium.org
66f5c75dab Separate calculation of double element and object element sizes in IsFastLiteral.
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14241 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-12 08:42:17 +00:00
hpayer@chromium.org
5fd24b0afa Added non observable side effects scope and removed unnecessary calls to AddSimulate.
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14232 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-11 13:07:37 +00:00
hpayer@chromium.org
2db9e62fc8 Build fast literals in hydrogen.
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14211 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-10 13:52:08 +00:00
yangguo@chromium.org
9559181b0e Fix worst-case behavior of MergeRemovableSimulates().
Currently, when a long series of removable simulates are merged, we do
this by merging them one by one as we find them.  As we merge the value
value lists of the simulates, those lists snowball so that we get a
quadratic complexity wrt runtime and memory consumption.

Instead, we gather simulates that need to be merged, and merge them
backwards starting from the last simulate.

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

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14169 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-08 17:37:22 +00:00
mstarzinger@chromium.org
d71678676f Refactor parser mode configuration for correctness
This patch refactors the parser and preparser interface to be more
readable and type-safe.  It has no behavior changes.

Previously, parsers and preparsers were configured via bitfield called
parser_flags in the Parser constructor, and flags in
PreParser::PreParseProgram, ParserApi::Parse, and ParserApi::PreParse.
This was error-prone in practice: six call sites passed incorrectly
typed values to this interface (a boolean FLAG value, a boolean false
and a boolean true value).  None of these errors were caught by the
compiler because it's just an "int".

The parser flags interface was also awkward because it encoded a
language mode, but the language mode was only used to turn on harmony
scoping or not -- it wasn't used to actually set the parser's language
mode.

Fundamentally these errors came in because of the desire for a
procedural parser interface, in ParserApi.  Because we need to be able
to configure the parser in various ways, the flags argument got added;
but no one understood how to use the flags properly.  Also they were
only used by constructors: callers packed bits, and the constructors
unpacked them into booleans on the parser or preparser.

The solution is to allow parser construction, configuration, and
invocation to be separated.  This patch does that.

It passes the existing tests.

BUG=

Review URL: https://codereview.chromium.org/13450007
Patch from Andy Wingo <wingo@igalia.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14151 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-05 13:01:06 +00:00
hpayer@chromium.org
ff85f50e84 Refactoring BuildAllocateElements.
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14147 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-05 08:35:40 +00:00
mstarzinger@chromium.org
af25102f41 Compile FastCloneShallowArrayStub using Crankshaft.
R=danno@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14143 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-04 17:55:43 +00:00
danno@chromium.org
cb650a51de Remove extranous holder load in some prototype-chain checking cases
R=ulan@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14136 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-04 11:38:10 +00:00
dslomov@chromium.org
a172a5e839 Remove (H|L)JSArrayLength instructions
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14127 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-03 16:25:24 +00:00
mstarzinger@chromium.org
2816f19680 Add parser support for generators.
This patchset begins by adding support for "yield", which is unlike other tokens
in JS. In a generator, whether strict or classic, it is a syntactic keyword.
In classic mode it is an identifier. In strict mode it is reserved.

This patch adds YIELD as a token to the scanner, and adapts the preparser and
parser appropriately. It also parses "function*", indicating that a function is
actually a generator, for both eagerly and lazily parsed functions.

Currently "yield" just compiles as "return".

BUG=v8:2355
TEST=mjsunit/harmony/generators-parsing

Review URL: https://codereview.chromium.org/12646003
Patch from Andy Wingo <wingo@igalia.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14116 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-04-02 17:34:59 +00:00
dslomov@chromium.org
e357ddc249 Replace ICStub for array.length with hydrogen stub
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14090 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-03-28 12:43:19 +00:00
rossberg@chromium.org
83d4a41dec ES6 symbols: turn symbols into a proper primitive type
(qua last week's TC39)

Specifically:
- Install Symbol constructor function on the global object.
- Adjust code generation for typeof.
- Remove IsSymbol built-in, IS_SYMBOL macro now defined using typeof.
- Remove hack that allowed symbols as constructor results, and some other special cases.
- Remove symbol_delegate and GetDelegate function.
- Extend ToBoolean stub to handle symbols.
- Extend ToNumber to return NaN on symbols.
- Poison symbol's toString function, and thereby ToString on symbols.

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

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14051 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-03-22 16:33:50 +00:00
danno@chromium.org
b8fd25277a Fix bugs in previous_ast_id tracking
R=hpayer@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14045 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-03-22 12:34:38 +00:00
danno@chromium.org
ffd0c712e8 Implement many KeyedStoreStubs using Crankshaft
- Addition of a compiled hydrogen stub for KeyedStores.
- Inlining of "grow" stubs into OPTIMIZED_FUNCTIONs
- Addition of new "ignore OOB" ic stub that silently swallows out-of-bounds stores to external typed arrays.
- Addition of new "copy-on-write" ic stub that inlines allocation and copying operations for cow array
- New stub are generated with Crankshaft, so they are automatically inlined into OPTIMIZED_FUNCTIONs

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14001 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-03-20 10:37:13 +00:00
jkummerow@chromium.org
e2cd7aa423 Fix detection of |handle_smi| case in HOptimizedGraphBuilder::HandlePolymorphicCallNamed
BUG=chromium:196583

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13963 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-03-18 12:41:52 +00:00
mmassi@chromium.org
73e83b0b0f Handling expression decomposition and array bounds check hoisting: working code with lots of debugging PrintFs, postdominance check still missing.
Review URL: https://codereview.chromium.org/12377072

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13961 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-03-18 08:06:00 +00:00
hpayer@chromium.org
05a71fc9e4 Allow direct allocation in old pointer space.
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13940 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-03-14 08:32:52 +00:00
yangguo@chromium.org
a722726dc4 Parallel recompilation: fewer handle dereferences and tighter checks.
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13935 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-03-13 16:13:05 +00:00
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