Commit Graph

167 Commits

Author SHA1 Message Date
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
kmillikin@chromium.org
ef31d0480a Handlify the remaining stub compiler functions for call ICs.
Handlify StubCompiler functions for CallIC and KeyedCallIC cases
Megamorphic, Arguments, DebugBreak, and DebugPrepareStepIn.

R=ulan@chromium.org
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9750 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-10-24 10:55:00 +00:00
kmillikin@chromium.org
ec007b46d1 Handlify call cases for pre-monomorphic, normal, and miss.
These cases turn out to be easy.  There is a lingering raw pointer
implementation of TryCompileCallMiss because it's need by some of the
unconverted call stubs.

R=ulan@chromium.org
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9749 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-10-24 09:33:11 +00:00
ulan@chromium.org
ae6e6a689c Handlify KeyedIC::ComputeStub.
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9741 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-10-21 11:42:54 +00:00
kmillikin@chromium.org
937006f761 Handlify StubCompiler::CompileCallInitialize.
CallIC::GenerateInitialize and KeyedCallIC::GenerateInitialize are
verified safe for GC.

R=ulan@chromium.org
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9733 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-10-21 10:19:16 +00:00
kmillikin@chromium.org
1959409f6d Fix presubmit failure.
TBR=ulan@chromium.org
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9730 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-10-20 17:28:14 +00:00
kmillikin@chromium.org
e3792a6830 Handlify the stub cache lookup and patching for CallIC and KeyedCallIC.
R=ulan@chromium.org,vegorov@chromium.org
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9729 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-10-20 17:08:53 +00:00
ulan@chromium.org
a5da9320d2 Reset failure flag before retrying stub compilation.
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9728 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-10-20 16:39:26 +00:00
ulan@chromium.org
997ad6387a Handlify upper layers of KeyedStoreIC.
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9727 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-10-20 13:54:16 +00:00
ulan@chromium.org
f985b15aae Handlify upper layers of KeyedLoadIC.
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9714 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-10-20 09:35:47 +00:00
ulan@chromium.org
80e3843dc3 Handlify upper layers of StoreIC based on 8337008.
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9692 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-10-19 09:17:01 +00:00
ulan@chromium.org
feeb0b0211 Handlify upper layers of LoadIC.
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9680 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-10-18 12:19:18 +00:00
jkummerow@chromium.org
184fdcf28b Track elements_kind transitions in KeyedStoreICs.
Review URL: http://codereview.chromium.org/8166017

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9577 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-10-11 09:33:00 +00:00
erik.corry@gmail.com
af20990e0e Don't need to protect pregenerated stubs from flushing from the
cache.  They are in a different cache that is not flushed.  Keep
the marking of pregenerated stubs for assertion purposes.
Review URL: http://codereview.chromium.org/8065028

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9479 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-09-29 11:52:05 +00:00
erik.corry@gmail.com
bbcafaa2d5 Make sure we don't flush the pregenerated stubs, since they need
to be always present, so that we can call them from other stubs
without trying to generate stubs while we are generating stubs.
Review URL: http://codereview.chromium.org/8052029

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9459 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-09-28 10:32:12 +00:00
kmillikin@chromium.org
40cd59f238 Remove in-loop tracking for call ICs.
We passed this flag around in a lot of places and had differenc call
ICs based on it, but never did any real specialization based on its
value.

R=fschneider@chromium.org
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9260 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-09-13 12:53:28 +00:00
kmillikin@chromium.org
636991a0b3 Use the BitField class for Code::Flags.
Use the BitField helper class for the code flags, so that we do not have to
define both a shift and a mask explicitly.  This makes changing the flags
layout simpler.

Also, make the 'mask' and 'max' members of BitField into constants, because
they are constant and so that they can be used as constant expressions.
E.g., so they can be used in declaring other const members or in static
asserts.

R=fschneider@chromium.org
BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9232 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-09-12 10:50:50 +00:00
vitalyr@chromium.org
633e615b89 Improve memory usage of receiver type feedback.
Some AST nodes (Property, Call, etc.) store either a list of receiver
types or a monomorphic receiver type. This patch merges the two fields
using a small pointer list. GetMonomorphicReceiverType() is now a
purely convenience function returning the first and only recorded
type.

This saves about 500K (of about 39M) on average when compiling V8
benchmark as measured by a simple patch adding a zone allocation
counter (https://gist.github.com/1149397).

R=kmillikin@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8993 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-08-22 14:23:37 +00:00
danno@chromium.org
07def3cb1e Unify handling of element IC stubs.
In the process, add shared stubs for DictionaryValue lookups that are handled in the same way as fast elements and external array elements.

Includes code for MIPS, which compiles and run polymorph-arrays.js successfully.

R=jkummerow@chromium.org
BUG=none
TEST=test/mjsunit/polymorph-arrays.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8579 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-07-08 10:46:10 +00:00
jkummerow@chromium.org
39b06d8850 Add support for dictionary elements to polymorphic crankshaft code.
Review URL: http://codereview.chromium.org/7285001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8479 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-30 08:40:31 +00:00
karlklose@chromium.org
f4e4bc43a8 Merge arguments branch to bleeding edge (second try).
Review URL: http://codereview.chromium.org/7187007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8315 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-16 14:12:58 +00:00
karlklose@chromium.org
cc19d1e278 Revert "Merge arguments branch to bleeding merge."
This reverts commit ceb31498b9d69edca3260820fb4047045891ce6d.

TBR=kmillikin@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8308 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-16 06:37:49 +00:00