Commit Graph

3069 Commits

Author SHA1 Message Date
antonm@chromium.org
087fedeae8 Normalize the object before updating getter/setter info.
BUG=612

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3880 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-17 06:53:19 +00:00
sgjesse@chromium.org
1c2b2ac9c6 Fix construction of simple objects with setters on prototype
Simple objects which are constructed without calling the actual constructor function did not take setters defined on prototype chain of the new object into account.

Constructing objects this way is now not done if there are setters involved on the prototype chain of the new object.

This only fixes the case where the setter is found when the first object from a constructor is created. If the prototype chain is changed new objects will on take any change to setters into account.

TEST=test/mjsunit/setter-on-constructor-prototype.js
Review URL: http://codereview.chromium.org/606062

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3879 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-17 06:28:33 +00:00
vitalyr@chromium.org
ad9ea637be Don't externalize fresh strings.
With the current API the embedder has to extrenalize a string each
time a string is encountered to avoid the cost of repeated character
copying/conversion. The issue here is that the externalization cost
itself is non-negligible (both in time and space) and should not be
paid for a rarely used string. This change is an attempt to predict a
string's usage frequency based on its freshness. A string is
considered fresh if it was recently allocated in the new space.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3878 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-16 18:56:07 +00:00
mikhail.naganov@gmail.com
e61996bf3f Fix the build after previous commit.
TBR=sgjesse@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3877 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-16 15:29:35 +00:00
mikhail.naganov@gmail.com
dcef87af66 Enable passing of script data via script creation methods.
Patch by Andrey Kosyakov <caseq@chromium.org>
Original issue http://codereview.chromium.org/606053

TBR=sgjesse@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3876 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-16 15:15:31 +00:00
ager@chromium.org
a9e174f8ea Make sure that the inline_new flag guards all the optimizations for
constructors that only contain simple this assignments.

Make sure that constructors with declarations are not treated as
constructors with only simple this property assignments.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3875 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-16 15:14:34 +00:00
antonm@chromium.org
8bc68937a7 Port keyed interceptor stubs to ARM and x64.
Review URL: http://codereview.chromium.org/600123

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3874 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-16 14:13:21 +00:00
fschneider@chromium.org
fc67ad346a Pass the complete number type information into the GenericBinaryOpStub.
Currently we only pass a boolean parameter indicating whether
the input operands to the GenericBinaryOpStub are guaranteed
to be numbers or not. 

Instead we pass the complete number type as a parameters. This 
allows to use more precise type information for code generation
in the stub.

Also make the computation of the result type more precise and correct on both ia32 and x64.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3873 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-16 13:03:16 +00:00
mikhail.naganov@gmail.com
8f3ae5b60a Fix regression in cctest/test-log/EquivalenceOfLoggingAndTraversal
TBR=sgjesse@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3872 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-16 13:01:05 +00:00
antonm@chromium.org
ea1b4f0eb1 Introduce builtin for Array.slice function.
Review URL: http://codereview.chromium.org/604059

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3871 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-16 12:14:23 +00:00
mikhail.naganov@gmail.com
899bef8226 Use binary search in GetScriptLineNumber.
Patch by Ilya Tikhonovsky <loislo@chromium.org>
Original issue http://codereview.chromium.org/593108

TBR=sgjesse@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3870 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-16 12:08:10 +00:00
ager@chromium.org
69b96e608a Land thumb2 assembler update.
Review URL: http://codereview.chromium.org/596065

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3869 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-16 11:40:56 +00:00
sgjesse@chromium.org
58207806fe Fix inline NumberToString
Glitch in pre-commit cleanup.

TBR=ager@chromium.orgZ
Review URL: http://codereview.chromium.org/600134

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3868 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-16 11:16:10 +00:00
ager@chromium.org
51b5df388c Port arguments object allocation in generated code to ARM and x64.
BUG=v8:611
Review URL: http://codereview.chromium.org/605024

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3867 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-16 10:50:56 +00:00
yurys@chromium.org
0630b1fd9f Object.getOwnPropertyNames should return string names for indexed properties
Land original change by pfeldman: http://codereview.chromium.org/596117
Review URL: http://codereview.chromium.org/596124

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3866 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-16 10:08:39 +00:00
sgjesse@chromium.org
6093d0dbf5 Inline NumberToString
NumberToString in runtime JavaScript is inlined through a call to a stub. Currently the stub only checks the number string cache and only if the number is a smi. Code is shared with the inlining of number string cache lookup when adding a smi to a string.
Review URL: http://codereview.chromium.org/604062

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3865 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-16 09:41:11 +00:00
ager@chromium.org
7f422b2a35 Remove caching of ToBoolean on the global context. This was used for
API operations but the API C++ code no longer performs a call to the
JavaScript code for ToBoolean.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3864 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-16 09:24:14 +00:00
kmillikin@chromium.org
edfc3c31b3 Remove printf committed by mistake
Review URL: http://codereview.chromium.org/600126

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3863 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-16 07:54:28 +00:00
fschneider@chromium.org
82341d28b3 Fix arm build.
Change the function declarations in the arm virtual frame header 
file to match the other platform.

TBR=kmillikin@chromium.org
Review URL: http://codereview.chromium.org/608007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3862 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-15 14:47:03 +00:00
fschneider@chromium.org
dbe99e405a Introduce number type information in the virtual frame.
Each frame element gets a new attribute with number type information. A frame element can be: 

- smi 
- heap number 
- number (i.e. either of the above) 
- or something else. 

The type information is propagated along with all virtual frame operations. 
Results popped from the frame carry the number information with them.

Two optimizations in the code generator make use of the new 
information: 
- GenericBinaryOpSyub omits map checks if input operands are numbers. 
- Boolean conversion for numbers: Emit inline code for converting a number (smi or heap number) to boolean. Do not emit call to ToBoolean stub in this case.


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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3861 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-15 14:24:38 +00:00
mikhail.naganov@gmail.com
d3ce4347d9 Add GetScriptOrigin and GetScriptLineNumber functions for Timeline panel.
Patch by Ilya Tikhonovsky <loislo@chromium.org>.
Original issue: http://codereview.chromium.org/565007

TBR=sgjesse@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3860 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-15 14:19:15 +00:00
antonm@chromium.org
e02a5aa602 Introduce builtin for Array.unshift function.
Review URL: http://codereview.chromium.org/600124

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3859 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-15 13:25:06 +00:00
kmillikin@chromium.org
a2bb215611 Change the interface of CallStubCompiler::CompileCallInterceptor.
Move responsibility for a typecast into the caller so that it can be
locally verified to succeed.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3858 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-15 13:20:49 +00:00
antonm@chromium.org
3d4d5e9e34 Refactoring various pieces of post interceptor caching.
Review URL: http://codereview.chromium.org/596096

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3857 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-15 12:32:27 +00:00
whesse@chromium.org
58b04396bf Change CallIC interface on ARM. Remove name from the stack, and pass it in register r2.
Review URL: http://codereview.chromium.org/598065

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3856 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-15 12:26:07 +00:00
antonm@chromium.org
976ab7d7b5 Elaborating test for Array.shift a bit.
Review URL: http://codereview.chromium.org/596116

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3855 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-15 12:01:46 +00:00
whesse@chromium.org
4507ca1523 Simplify compilation of CallIC interceptor stub.
Review URL: http://codereview.chromium.org/604054

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3854 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-15 11:52:18 +00:00
antonm@chromium.org
01b1176e08 Introduce builtin for Array.shift function.
Review URL: http://codereview.chromium.org/606017

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3853 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-15 09:17:38 +00:00
yurys@chromium.org
f5eb70e411 Land 598061(Process //@ scriptURL=url comment for scripts that don't have name set)
Review URL: http://codereview.chromium.org/596088

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3850 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-12 17:17:13 +00:00
kmillikin@chromium.org
61ce433d82 Change interface to CodeGenerator::LoadFromSlot.
Change the interface to LoadFromSlot, LoadFromSlotCheckForArguments,
and LoadFromGlobalSlotCheckExtensions in the ia32 classic code
generator.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3849 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-12 16:39:07 +00:00
whesse@chromium.org
077d785842 Fix CallIC stub for CallInterceptor on ARM
Review URL: http://codereview.chromium.org/593080

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3848 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-12 16:01:38 +00:00
antonm@chromium.org
62a9497787 Compile very thin code to access objects on which indexed interceptor is set.
Review URL: http://codereview.chromium.org/603028

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3847 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-12 14:21:18 +00:00
sgjesse@chromium.org
f937e7daa5 Fix array allocation in generated code on x64
The porting of array allocation in generated code from ia32 to x64 wrongly assumed that a smi contained the actual number times 2. Removed the constant times_half_pointer_size, as it will probably not be needed.
Review URL: http://codereview.chromium.org/596084

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3845 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-12 13:49:57 +00:00
lrn@chromium.org
2e6ab729ef Added optimization for div/mod by constant power of 2.
Review URL: http://codereview.chromium.org/597059

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3844 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-12 13:37:10 +00:00
sgjesse@chromium.org
e60efbff28 Optimize string plus smi
When adding a string with a smi value the number string cache is checked in generated code. If the there is a string value in the number string cache the resulting string is produced in generated code.
Review URL: http://codereview.chromium.org/596082

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3843 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-12 11:55:04 +00:00
sgjesse@chromium.org
46020b3169 Probe the symbol table for two character strings in native code
All two character string results from adding two strings and from sub string used to be handled in the runtime system as a lookup in the symbol table was done before allocating a new string. The native code for string add and sub string now probes the symbol cache for two character strings to avoid the runtime call. If the result string is not found in the symbol table within a fixed number of probes a new string is just allocated. Newly allocated two character strings are not added to the symbol table immediately.
Review URL: http://codereview.chromium.org/598062

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3842 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-12 11:43:00 +00:00
whesse@chromium.org
c7fe99d3ff Change LoadIC interface on ia32 to take arguments in registers.
Review URL: http://codereview.chromium.org/573009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3841 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-12 10:32:24 +00:00
kmillikin@chromium.org
85c24cee57 Change the interface of CodeGenerator::InstantiateBoilerplate.
Begin changing the interface of the virtual-frame-based code generator
to avoid pushing short-lived temporaries on the frame.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3840 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-12 10:28:40 +00:00
fschneider@chromium.org
4a2c81d3b0 Add last use data flow information to the fast code generator.
This change add simple local live variable information to 
the fast code generator.  It supports only AST nodes that 
are accepted by the syntax checker.

Each variable use points to a variable definition structure
which contains the last use of the definition.

To determine whether a variable is live after a certain point
we can check whether its last use occurs later in the evaluation
order defined by the AST labeling number.

The new information is currently only printed out together with
the IR and not yet used for code generation.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3839 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-12 10:16:30 +00:00
whesse@chromium.org
4831b79421 Port change in CallIC interface to x64 platform. Name of called function is now passed in rcx.
Review URL: http://codereview.chromium.org/596036

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3838 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-12 08:53:13 +00:00
kmillikin@chromium.org
29776256ab Add a regression test for chromium issue 35344.
Review URL: http://codereview.chromium.org/600069

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3837 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-12 08:10:25 +00:00
ager@chromium.org
4c929953b4 Port FastCloneShallowArrayStub to ARM and x64.
Review URL: http://codereview.chromium.org/597022

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3835 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-11 12:28:49 +00:00
ager@chromium.org
51a7ecc1f7 Fix problem with GenericBinaryOperationStub::GenerateCall for a Smi
left operand.  For non-commutative operations the right operand could
be overwritten with the Smi left operand.

We need better testing of all of these cases.  We will add more test
cases as a separate commit.
Review URL: http://codereview.chromium.org/598059

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3834 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-11 12:26:08 +00:00
kmillikin@chromium.org
9b47ae91d1 Simple type tracking in the fast code generator.
Initial implementation of ad hoc must-be-smi tracking in the fast code
generator.  Type information is used to avoid the write barrier for
smi property stores and to avoid the smi check for the inputs/output
of bitwise OR.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3833 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-11 08:41:19 +00:00
ager@chromium.org
638cb4f91d Always load the JavaScript builtins code entry from the JavaScript
function instead of baking in the address of the first one that we see
in code.

This removes the need for fixups processing and makes the stubs safe
when there is no natives cache and therefore multiple versions of the
builtin functions.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3832 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-11 08:05:33 +00:00
mikhail.naganov@gmail.com
4f7b9e4da3 Report code stubs to OProfile.
Patch from Dineel D Sule <dsule@codeaurora.org>.
Original issue: http://codereview.chromium.org/600019

TBR=sgjesse@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3831 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-10 17:50:16 +00:00
whesse@chromium.org
9344612bef Change StoreIC interface on ARM platform
Review URL: http://codereview.chromium.org/554152

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3830 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-10 15:06:08 +00:00
antonm@chromium.org
5ecfd4bfe9 Refactor prototype setting code and expose SetPrototype to public V8 API.
Review URL: http://codereview.chromium.org/598020

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3829 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-10 14:44:15 +00:00
kmillikin@chromium.org
b04a26dc31 Harden global variable accesses in the fast code generator.
Explicitly check that global variables do not have accessors or
interceptors in the fast code generator syntax checker.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3828 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-10 13:46:15 +00:00
antonm@chromium.org
a9664cbd0d Making lint happy.
Review URL: http://codereview.chromium.org/593014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3827 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-02-10 11:48:53 +00:00