Commit Graph

188 Commits

Author SHA1 Message Date
verwaest@chromium.org
5a543d683a Order arguments of ComputeMonomorphicFlags to match ComputeFlags.
Review URL: https://chromiumcodereview.appspot.com/12226090

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13769 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-02-27 15:33:37 +00:00
verwaest@chromium.org
3ab255f55d Currently this mostly just moves code around.
- Later the different parts will become individual code objects that tailcall into one another.
- The mapcheck/symbol check still needs to be separated from the overall prototype-chain check so that the ICs can reuse the handlers.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13768 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-02-27 15:28:53 +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
svenpanne@chromium.org
6e829ed485 Added Isolate parameter to CodeStub::GetCode().
According to gprof, this was the #1 cause for TLS access during an Octane run.

BUG=v8:2487

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13756 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-02-27 12:33:24 +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
svenpanne@chromium.org
71a26c928a Make the Isolate parameter mandatory for internal HandleScopes.
Improved Frames and their iterators on the way, too.

BUG=v8:2487

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13674 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-02-15 09:27:10 +00:00
dcarney@chromium.org
0da6e525b7 Split AccessorInfo into DeclaredAccessorInfo and ExecutableAccessorInfo
R=svenpanne@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13649 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-02-12 14:33:08 +00:00
verwaest@chromium.org
f08b6ecac7 Split CompileCallConstant into logical parts for Frontend and Backend.
Initial step towards separating IC (map check(s)), handler frontend
(prototype-check) and handler backend (actual handler code).

- Still need to split the map-check (IC) from rest of the prototype
  chain check.
- Still need to turn different parts in own code objects and cache them
  in more optimal places.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13604 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-02-06 11:48:29 +00:00
verwaest@chromium.org
0d89d9a019 Merge KeyedLoad and NamedLoad stub compiler code.
Review URL: https://chromiumcodereview.appspot.com/12094082

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13579 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-02-01 13:39:36 +00:00
verwaest@chromium.org
b1e5157e7b Support slow-mode prototypes for load and call ICs.
This changes LoadNonExistent to handle negative lookups as well.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13571 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-31 16:18:18 +00:00
verwaest@chromium.org
09d6eccaff Replace store array length builtin with codestub.
Also includes some other minor cleanup to make Keyed related IC code
more uniform.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13506 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-25 11:55:29 +00:00
verwaest@chromium.org
c1e44f133d Always fail when trying to store to an undeclared global variable, even if it was found.
Finding a property, but not using an IC, indicates that the variable was
found on the prototype (in DOMWindow). Those properties need to be
ignored while storing global properties via the IC.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13480 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-23 16:04:19 +00:00
verwaest@chromium.org
e086746ed7 Move polymorphic stub computation and compilation to stub cache
Review URL: https://chromiumcodereview.appspot.com/11953025

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13478 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-23 15:35:43 +00:00
verwaest@chromium.org
b79a927e74 Migrate FunctionPrototype (Keyed|Named)LoadIC to CodeStub
Review URL: https://chromiumcodereview.appspot.com/11941016

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13459 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-21 17:54:36 +00:00
verwaest@chromium.org
f80379f3fb Migrate ArrayLength (Keyed|Named)LoadIC to CodeStub
Review URL: https://chromiumcodereview.appspot.com/11938013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13458 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-21 17:17:02 +00:00
verwaest@chromium.org
c3d45451f0 Replace special IC builtins and stubs in the map's cache by codestubs.
Review URL: https://chromiumcodereview.appspot.com/11973008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13453 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-21 14:53:29 +00:00
verwaest@chromium.org
7cb764b780 Combine DEBUG_BREAK and DEBUG_PREPARE_STEP_IN into one IC stub kind DEBUG_STUB, encoding DEBUG_BREAK and DEBUG_PREPARE_STEP_IN as extra ic state.
Review URL: https://chromiumcodereview.appspot.com/11821049

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13352 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2013-01-10 14:15:12 +00:00
mstarzinger@chromium.org
5966276d56 Change deprecated semantics of function template signatures.
This changes how FunctionTemplate interprets a Signature that specifies
compatible receivers and arguments. Only the hidden prototype chain will
be considered when searching for compatible receivers. This prevents
JavaScript from modifying the inheritance relationship set up by the
embedder.

R=rossberg@chromium.org
BUG=v8:2268
TEST=cctest/test-api

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13131 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-12-04 13:45:48 +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
mmassi@chromium.org
ce682a2489 Allow property indexes to refer to slots inside the object header.
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12944 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-11-13 11:07:04 +00:00
mstarzinger@chromium.org
b55988625d Get rid of obsolete unchecked accessors.
R=yangguo@chromium.org
BUG=v8:1490

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12813 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-10-25 11:52:37 +00:00
yangguo@chromium.org
266cca47fc Add more checks for native callback results.
R=svenpanne@chromium.org
BUG=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12474 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-09-10 13:38:21 +00:00
svenpanne@chromium.org
de3c3c0198 Added IC support for native setters on the prototype chain.
Review URL: https://chromiumcodereview.appspot.com/10873057

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12402 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-08-29 06:12:46 +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
verwaest@chromium.org
3b5a6ef2e7 Removing LookupTransition from LookupRealNamedProperty and related utility functions.
Callsites now have to manually lookup transitions if required. This
avoids unnecessary overhead of looking up transitions when we don't need
them. This also allows us to use IsFound() in many places where
IsProperty() was required previously.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12098 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-16 14:47:28 +00:00
svenpanne@chromium.org
ebff0eb7b3 Handle accessors on the prototype chain in StoreICs.
Made stub compiler function signatures a bit more consistent on the way.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11984 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-07-04 11:40:51 +00:00
verwaest@chromium.org
41560e9f5f Separate stub types from property types.
Review URL: https://chromiumcodereview.appspot.com/10656018

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11920 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-06-25 11:35:23 +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
svenpanne@chromium.org
e6f2eab7f6 Implemented StoreIC for setters.
Review URL: https://chromiumcodereview.appspot.com/10534091

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11771 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-06-12 09:32:17 +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
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
svenpanne@chromium.org
40dbd13e2e Added LoadIC stub for getters.
Removed some dead constants on the way.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11735 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-06-08 08:48:05 +00:00
mstarzinger@chromium.org
81e8aa0016 Implement implicit instance checks for API accessors.
This allows to specify a constructor against which an implicit instance
check is performed for API accessors. If the receiver is incompatible,
an implicit TypeError is thrown and no callback is invoked.

R=svenpanne@chromium.org
BUG=v8:2075
TEST=cctest/test-api/InstanceCheckOn[*]

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11734 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-06-08 07:45:11 +00:00
mstarzinger@chromium.org
2f732c2728 Add isolate accessor to AccessorInfo and Arguments.
This passes the isolate through to API callback functions so that it is
available through AccessorInfo and Arguments. This allows bindings to
avoid unnecessary TLS lookups to retrieve the current isolate.

R=danno@chromium.org
TEST=cctest/test-api,cctest/test-accessors

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11306 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-04-13 09:38:00 +00:00
erik.corry@gmail.com
9f375ea880 Fix secondary stub cache and add a test for the stub cache lookups.
Review URL: https://chromiumcodereview.appspot.com/9496010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10864 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-02-29 10:45:59 +00:00
ulan@chromium.org
20f2c9b645 Do not call memset() to initialize StubCache.
Review URL: https://chromiumcodereview.appspot.com/9464054
Patch from Iliyan Malchev <malchev@google.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10861 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-02-28 18:26:04 +00:00
danno@chromium.org
f0c4b87f34 Implement KeyedStoreICs to grow arrays on out-of-bound stores.
Supports growing non-COW JSArray by a single element if the backing store has room, and initial allocation of a backing store for the store to index zero of an empty array  to kPreallocatedArrayElements elements (e.g. the [] array literal).

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10673 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-02-10 12:36:05 +00:00
svenpanne@chromium.org
fd2731a7e6 Replaced LookupResult::IsProperty by LookupResult::IsFound where possible.
Yak shaving for map sharing with accessor properties contd.: When CALLBACKS can
have map transitions, simply looking at the property type is not sufficient
anymore to decide if a property is there or not. One has to look at the actual
contents of the descriptor entry then, but this breaks down sometimes when the
lookup is being done with a NULL holder. Luckily enough, we can oftren replace
IsProperty by the simpler IsFound, because we inspect the type immediately
afterwards, anyway.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10474 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-23 12:01:47 +00:00
erik.corry@gmail.com
40a433c9e0 Split NumberDictionary into a randomly seeded and an unseeded
version. We don't want to randomize the stub cache.
Review URL: http://codereview.chromium.org/9174023

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10402 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-16 09:44:35 +00:00
ulan@chromium.org
746ef93362 Move handlified functions from handles.cc to objects.cc
BUG=
TEST=

Review URL: http://codereview.chromium.org/9008012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10348 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2012-01-05 17:16:19 +00:00
fschneider@chromium.org
b6b4af9d89 Filter out maps from different global context when collecting type feedback.
This avoid leaking memory because optimized code may hold on to maps
from different tabs otherwise.

BUG=v8:1823, 102895
Review URL: http://codereview.chromium.org/8892002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10257 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-12-14 14:01:54 +00:00
fschneider@chromium.org
066822a2cf Port to x64 and ARM and some refactoring of ia32.
Review URL: http://codereview.chromium.org/8111006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10174 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-12-06 12:11:08 +00:00
ulan@chromium.org
fa8a71df9a Handlify CompileConstructStub. Based on 8391045.
R=kmillikin@chromium.org
BUG=
TEST=

Review URL: http://codereview.chromium.org/8399032

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9837 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-10-28 14:08:43 +00:00
kmillikin@chromium.org
0df252b38b Handlify the remaining CallStubCompiler functions.
Also, handlify functions for loading with interceptors and callbacks.
Remove some unneeded code.  Rename Foreign::address() because it
confusingly shadows HeapObject::address() which does something quite
different.

R=vegorov@chromium.org,ulan@chromium.org
BUG=
TEST=

Review URL: http://codereview.chromium.org/8391045

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9834 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-10-28 12:37:29 +00:00
keuchel@chromium.org
a9a97d010e Remove kInvalidStrictFlag and make gcc-4.5 happy again.
Review URL: http://codereview.chromium.org/8403036

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9832 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-10-28 09:10:29 +00:00
ulan@chromium.org
405d57fe00 Handlify CompileStoreCallback, CompileStoreInterceptor.
R=kmillikin@chromium.org
BUG=
TEST=

Review URL: http://codereview.chromium.org/8390045

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9803 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-10-26 12:35:12 +00:00
ulan@chromium.org
beb0bbe3a9 Handlify simple functions of [keyed] store stub compiler.
Handlified functions: CompileStoreField, CompileStoreGlobal, CompileStoreElement, CompileStorePolymorphic.

Based on 8375053.

R=kmillikin@chromium.org
BUG=
TEST=

Review URL: http://codereview.chromium.org/8393003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9791 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-10-26 10:45:24 +00:00
ulan@chromium.org
a2fff744e0 Handlify CompileLoadGlobal, CompileLoadElement, CompileLoadPolymorphic.
R=kmillikin@chromium.org
BUG=
TEST=

Review URL: http://codereview.chromium.org/8375053

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9788 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-10-26 09:58:32 +00:00
ulan@chromium.org
abeb5a4d93 Handlify simple functions of [keyed] load stub compiler.
Handlified functions: CompileLoadNonexistent, CompileLoadField,
CompileLoadConstant, CompileLoadArrayLength, CompileLoadStringLength,
CompileLoadFunctionPrototype.

R=kmillikin@chromium.org
BUG=
TEST=

Review URL: http://codereview.chromium.org/8383033

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9773 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-10-25 12:26:07 +00:00
kmillikin@chromium.org
e05c04e5fa Handlify CallStubCompiler::CompileCallField.
This function relies on a number of helpers for checking prototypes and
probing dictionaries.  It is not possible to wrap these helpers to retry
after allocation failure in a safe way---the assembler has no way to undo
what it has already assembled.

These functions have all been duplicated with handle and raw versions.  The
raw versions will eventually be removed completely.

R=ulan@chromium.org,vegorov@chromium.org
BUG=
TEST=

Review URL: http://codereview.chromium.org/8332003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9769 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-10-25 09:24:49 +00:00