Commit Graph

753 Commits

Author SHA1 Message Date
vitalyr@chromium.org
3202df6c69 Copy-on-write arrays.
Object model changes
----------------------------------------
New fixed_cow_array_map is used for the elements array of a JSObject
to mark it as COW. The JSObject's map and other fields are not
affected. The JSObject's map still has the "fast elements" bit set. It
means we can do only the receiver map check in keyed loads and the
receiver and the elements map checks in keyed stores. So introducing
COW arrays doesn't hurt performance of these operations. But note that
the elements map check is necessary in all mutating operations because
the "has fast elements" bit now means "has fast elements for reading".
EnsureWritableFastElements can be used in runtime functions to perform
the necessary lazy copying.

Generated code changes
----------------------------------------
Generic keyed load is updated to only do the receiver map check (this
could have been done earlier). FastCloneShallowArrayStub now has two
modes: clone elements and use COW elements. AssertFastElements macro
is added to check the elements when necessary. The custom call IC
generators for Array.prototype.{push,pop} are updated to avoid going
to the slow case (and patching the IC) when calling the builtin should
work.

COW enablement
----------------------------------------
Currently we only put shallow and simple literal arrays in the COW
mode. This is done by the parser.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5275 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-16 16:06:46 +00:00
erik.corry@gmail.com
702780ee9a Make the Integer32 type info only cover the signed 32 bit integers.
Fix some bit op bugs introduced last week on IA32:
http://code.google.com/p/chromium/issues/detail?id=52096
Review URL: http://codereview.chromium.org/3151017

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5273 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-16 15:08:32 +00:00
erik.corry@gmail.com
a2d1dad441 Add rcr to disassembler.
Review URL: http://codereview.chromium.org/3108023

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5268 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-16 11:18:42 +00:00
sgjesse@chromium.org
e61bd7bd26 ARM: backend opt for ToBoolean: JIT code generation for ToBool
Upgraded the CodeGenerator::ToBoolean() function in the ARM backend to use complete JIT code generation and not make runtime calls to ToBool (when VFP is enabled). 

This change also includes the vcmp VFP instruction that supports a constant 0.0 as the second operand. 

Patch by Subrato K De <subratokde@codeaurora.org>



git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5267 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-16 07:52:49 +00:00
peter.rybin@gmail.com
6fa44eb979 LiveEdit: implement stack manipulations for x64
Review URL: http://codereview.chromium.org/3120011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5264 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-13 13:54:28 +00:00
ager@chromium.org
3e936b547a Remove experimental fast-codegen. We are no longer working on this
approach.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5259 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-13 09:07:09 +00:00
peter.rybin@gmail.com
9ef1670464 Reduce size of function restarter frame.
Review URL: http://codereview.chromium.org/3133007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5256 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-12 17:27:07 +00:00
vitalyr@chromium.org
421db370d9 Preserve constant function transition when adding the same function.
This should help in cases like:
function Constructor() {
  this.foo = constFunction;
  this.bar = "baz";
}

for (...) {
  o = new Constructor();
  // Constant call IC will work.
  o.foo();
  // Inlined property load will see the same map.
  use(o.bar);
}

This change also fixes a latent bug in custom call IC-s for strings
exposed by string-charcodeat.js.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5254 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-12 14:51:59 +00:00
sgjesse@chromium.org
8e0cd6db8a Handle overwriting valueOf on String objects correctly when adding
This adds a check to the fast case string add to ensure that the String object still have the default valueOf function. The default valueOf is sitting on a hidden prototype of String.prototype.

Before using the fast case valueOf the object is checked for a local valueOf property. For slow case objects this check always reports true (the dictionary is not probed, so valueOf might be there) and for fast case objects the descriptor array is checked for the valueOf symbol (just liniar scan). After that the prototype is checked for beeing the initial value of String.prototype. If this all pass (that is the default valueOf is still in place) this result is cached on the map making the check fast the next time.

This is only implemented in the optimizing compiler, as the two usages of %_IsStringWrapperSafeForDefaultValueOf is never hit by the full compiler.

I will port to x64 and ARM when this has been reviewed for ia32.

I will remove the performance counters prior to final commit.

BUG=http://code.google.com/p/v8/issues/detail?id=760
TEST=test/mjsunit/regress/regress-760-1.js
TEST=test/mjsunit/regress/regress-760-2.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5252 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-12 13:43:08 +00:00
vegorov@chromium.org
28f9412cbd Generalize virtually dispatched scavenger to virtually dispatched specialized visitors.
Review URL: http://codereview.chromium.org/3066044

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5246 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-11 14:30:14 +00:00
ricow@chromium.org
8402db12c9 Change lazy compilation stub to a builtin.
This change changes the lazy compilation stub to a builtin and
eliminates the argc (argument count for the function for which to
create a lazy stub) parameter.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5244 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-11 13:48:58 +00:00
sgjesse@chromium.org
fcfe6d74d9 Minor change to for-in
Return (smi) 0 instead of object null from the FILTER_KEY builtin.

Add a test which tests keys being deleted during for-in.
Review URL: http://codereview.chromium.org/3170004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5243 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-11 13:46:10 +00:00
ricow@chromium.org
36e5743674 Put direct code pointers into JSFunction objects. This is a first step
in allowing more flexible compilation and to simplify builtins lookup. 

This changes a number of places where code objects are assigned to
SharedFunctionInfo objects to also assign this code object to the
JSFunction. In addition, the code flushing is changed slightly to
accomodate this (we need to flush the code from functions pointing to
SharedFunctionInfo objects that has already been flushed).


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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5233 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-11 08:12:53 +00:00
erik.corry@gmail.com
bdfdf8bee9 Fix fuzzer-found error where left and right were the same register in bitops.
Review URL: http://codereview.chromium.org/3115004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5231 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-10 12:30:14 +00:00
ager@chromium.org
9677b96b7b Fix bug in binary operations code. When loading a 32-bit integer as a
64-bit integer to the stack, the high and low parts of the 64-bit
value were pushed in the wrong order.

TBR=erik.corry@gmail.com
Review URL: http://codereview.chromium.org/3010060

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5216 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-09 14:54:23 +00:00
erik.corry@gmail.com
751ec5d099 IA32: Avoid going into stubs or runtime code for bitops even if the
inputs are heap numbers or the result is a heap number (only with
SSE2).  Make it possible for a deferred code object to work without
spilling all registers.
Review URL: http://codereview.chromium.org/3054047

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5215 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-09 13:12:02 +00:00
lrn@chromium.org
df8b3eb742 Fix cast that fails to build on Windows.
Review URL: http://codereview.chromium.org/3044055

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5213 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-09 12:44:48 +00:00
lrn@chromium.org
53e22e386c Create a new RegExp object for every evaluation of a RegExp literal.
Changes necessary to following ES5 semantics and matching Safari - in ES3
the same RegExp object was generated by each evaluation of the RegExp literal.
Fixes bug 704.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5198 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-06 13:04:27 +00:00
kaznacheev@chromium.org
70d3296087 Reapplying r5174 (Avoid GC when compiling CallIC stubs).
I could not find a way to introduce simple yet useful assertions,
so I removed the assertions that broke tests.

The new patch just fixes the actual problem (GC triggered while raw pointers
are held in LookupResult).

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5196 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-06 08:49:59 +00:00
vegorov@chromium.org
bed254fac9 Do not apply JS_RETURN and DEBUG_BREAK_SLOT relocations on x64.
Improve tests for debug API to check behavior of JS_RETURN and DEBUG_BREAK_SLOT relocations.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5180 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-05 13:38:27 +00:00
vegorov@chromium.org
2ba27d2201 Add RelocInfo::DEBUG_BREAK_SLOT to RelocInfo::kApplyMask on ia32/x64 to ensure that debug break slots get relocated correctly during compacting GC.
Review URL: http://codereview.chromium.org/3058048

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5178 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-05 11:39:01 +00:00
vegorov@chromium.org
1920692d71 Revert r5174.
Review URL: http://codereview.chromium.org/2868108

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5177 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-05 11:19:43 +00:00
whesse@chromium.org
d25d40aa5c Modify polymorphic keyed load IC stub to load cached properties from the property array of a fast-case JSObject.
Review URL: http://codereview.chromium.org/3053042

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5175 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-05 10:45:07 +00:00
kaznacheev@chromium.org
5f78dc14c8 Avoid GC when compiling CallIC stubs.
In rare cases GC could be called from ComputeCallMiss function thus
breaking CallIC::LoadFunction.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5174 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-05 08:37:12 +00:00
peter.rybin@gmail.com
a9958afeee Roll over again fixed 3029033 Fix 'step in' after live edit stack manipulation
Review URL: http://codereview.chromium.org/3066018

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5160 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-30 11:58:43 +00:00
peter.rybin@gmail.com
84cf5ca5cb Roll back all step-in-fix-related changes
Review URL: http://codereview.chromium.org/3012035

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5154 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-29 21:46:19 +00:00
peter.rybin@gmail.com
fdab0bafbb Rollback one from Testing change for failing unit test
Review URL: http://codereview.chromium.org/2870083

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5152 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-29 20:32:14 +00:00
peter.rybin@gmail.com
f6517b04d0 Testing change for failing unit test
Review URL: http://codereview.chromium.org/3031032

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5151 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-29 20:23:19 +00:00
peter.rybin@gmail.com
16709ee695 Fix 'step in' after live edit stack manipulation
Review URL: http://codereview.chromium.org/3029033

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5150 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-29 16:40:14 +00:00
podivilov@chromium.org
52762e4c59 Breakpoint position should be inside function body.
Review URL: http://codereview.chromium.org/2883042

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5145 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-28 13:02:03 +00:00
antonm@chromium.org
9d6fd08276 Port faster callbacks invocation to x64.
It's a port of http://code.google.com/p/v8/source/detail?r=3209 to x64 platform.
That allows invocation of callbacks without going into runtime.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5141 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-28 09:36:53 +00:00
ager@chromium.org
79e332010a Fix aliasing problem in inlined stores on x64 and ia32. The receiver
and the value can share a register. We need to remove this aliasing
before modifying the registers.

I haven't managed to generate a stand-alon test case for this
yet. I'll do that as a separate change. This was found while loading
Wave.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5127 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-23 11:55:03 +00:00
whesse@chromium.org
e8c0a459a9 Fix bug in r5123, Comparison(), by unusing results before unconditional jump to smi comparison JumpTarget.
Review URL: http://codereview.chromium.org/3026019

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5126 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-23 11:20:59 +00:00
whesse@chromium.org
8bb47c1939 Use static type information when creating the inlined code for comparison operators.
Review URL: http://codereview.chromium.org/3017025

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5123 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-23 09:05:46 +00:00
whesse@chromium.org
9deeec0b08 Change asserts to STATIC_ASSERT if they can be checked at compilation time. Just in the codegen-xxx.cc files on all platforms.
Review URL: http://codereview.chromium.org/3017018

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5121 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-23 08:25:48 +00:00
ager@chromium.org
dc45fcb232 Port inline in-object property stores from ia32 to x64.
Review URL: http://codereview.chromium.org/3008017

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5115 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-22 06:31:49 +00:00
ager@chromium.org
c9c7f8834e Inline in-object property stores on ia32 when in loop and not in top-level code.
Review URL: http://codereview.chromium.org/3046006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5105 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-21 06:59:34 +00:00
whesse@chromium.org
54f68eacbf Stop pushing arguments onto the stack in CompareStub until just before calling runtime.
This is a fixed version of change 5097, which had the problem that LoadFloatOperands tried to load the arguments from the stack.
Review URL: http://codereview.chromium.org/3040010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5103 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-20 12:41:43 +00:00
whesse@chromium.org
24ca3eddd7 Revert 5097 on ia32 platform until problem is diagnosed.
Review URL: http://codereview.chromium.org/3018009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5098 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-19 14:26:51 +00:00
whesse@chromium.org
96a7cc4a38 Delay the pushing of arguments until just before calling runtime in CompareStub.
This will allow jumps to runtime that skip useless tests.
Review URL: http://codereview.chromium.org/3016004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5097 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-19 13:35:41 +00:00
ricow@chromium.org
4957326521 Refactor type checks in v8natives.js and runtime.js.
This includes adding a new inline IsSpecObject method to the code
generator.  The old approach was somehow ineffecient since we would
call both IsObject, IsUndetectable and IsFunction to determine if
something was an object according to the spec. This change introduces
a new macro that determines if something is an object according to the
spec (and this does not include null). 

This change also corrects a few places where undetectable objects was
not allowed even when they should be (priorly they would use only
IS_SPEC_OBJECT_OR_NULL, which would return false on an undetectable
object, the new IS_SPEC_OBJECT returns true on an undetectable object.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5087 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-16 11:21:08 +00:00
whesse@chromium.org
5794e68f76 Remove unnecessary formatting differences between ia32 and x64 code generators. Mainly just typographical changes.
Review URL: http://codereview.chromium.org/3023001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5080 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-15 14:31:49 +00:00
whesse@chromium.org
dd06f4f102 Avoid a smi check when comparing an unknown to a constant smi for equality on ia32 and x64 platforms.
Review URL: http://codereview.chromium.org/2897013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5077 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-15 10:34:08 +00:00
serya@chromium.org
1b9391be7a Fix GenerateNegativeLookup to work with non-symbols as a dictionary key.
Review URL: http://codereview.chromium.org/2928009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5071 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-15 06:17:45 +00:00
ager@chromium.org
6744793c90 Landing for Rodolph Perfetta.
Allow compareStub on ARM to take register in reverse order optionally.

BUG=none
TEST=none

Review URL: http://codereview.chromium.org/2850046/show

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5059 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-13 20:54:06 +00:00
kaznacheev@chromium.org
0243bc875c Move serialized scope info from Code object to SharedFunctionInfo.
The scope info is now stored in a FixedArray referenced from SharedFunctionInfo.


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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5056 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-13 13:06:33 +00:00
serya@chromium.org
b569e6f562 Simplifying GenerateDictionaryNegativeLookup by making the 'extra' parameter mandatory.
Review URL: http://codereview.chromium.org/2982001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5049 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-13 10:02:11 +00:00
serya@chromium.org
43e28a6fea Port prototype-call-stubs for normal objects (http://codereview.chromium.org/2801018).
Review URL: http://codereview.chromium.org/2860049

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5044 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-12 13:23:42 +00:00
erik.corry@gmail.com
5bc0522ad4 Second half of number alloc change accidentally omitted from
last change.
Review URL: http://codereview.chromium.org/2919001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5039 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-08 13:50:13 +00:00
erik.corry@gmail.com
c205ffe05c Add number allocation call to runtime.cc instead of misusing
UnaryMinus.
Review URL: http://codereview.chromium.org/2899004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5038 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-08 13:16:51 +00:00