Commit Graph

2115 Commits

Author SHA1 Message Date
fschneider@chromium.org
5820f951c1 Improve the allocation and initialization of locals on IA32 in the top-level compiler.
This optimization is already done on x64 and ARM. 

Until now we used a push immediate for each local variable on IA32:

  push $undefined
  push $undefined
  ...

to initialize each local variable. This change does:

  mov eax, $undefined
  push eax
  push eax
  ...



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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3304 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-13 13:59:07 +00:00
lrn@chromium.org
4af20283a2 Disable "arguments" implementation. It was too optimistic in its assumptions.
Review URL: http://codereview.chromium.org/393010


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3302 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-13 13:12:57 +00:00
erik.corry@gmail.com
df4f52347b Allow a platform to indicate that some CPU features are always
available.  We use this to ensure that snapshots on MacOSX can
use SSE2 instructions.  Also clean up and assertify the
handling of things we can't do when we are generating a
snapshot.  Fix a bug in the new serialization tests where
they activated Snapshot::enable() too late after code had been
generated that assumed no snapshots.
Review URL: http://codereview.chromium.org/391051

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3301 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-13 12:32:57 +00:00
fschneider@chromium.org
1560b89888 Top-level compiler: Re-allow non-lazily compiled function literals.
This change re-allows non-lazy compiled function literals for top-level compilation.

There was a problem on ARM exposed through this change which was fixed as part of r3289
in fast-codegen-arm.cc (Threading and Threading2 tests failed)

It occurred before r3289 when we allocate a local context at the beginning of a function. The
code for the stack check was split up in an unintended way (load of stack check limit into r2, 
and use of r2 in the actual stack check code).

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3300 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-13 10:02:32 +00:00
fschneider@chromium.org
cfed6e1e8e Fixes bug in the top-level compiler with the write barrier for assignments to context slots:
The test for a SMI before the write barrier tested the wrong register:
r0 = target context address
r1 = value to be written

This change fixes the SMI test and tests r1 instead of r0.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3299 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-13 09:51:49 +00:00
fschneider@chromium.org
b27f0c8d08 Cleanup and fix generated comments in the top-level compiler.
Review URL: http://codereview.chromium.org/384087

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3298 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-13 09:42:18 +00:00
yurys@chromium.org
ff3e84539c Remove trailing whitespace from objects.h
TBR=vitalyr
Review URL: http://codereview.chromium.org/387037

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3295 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-12 16:52:48 +00:00
yurys@chromium.org
cc0ce24331 Make accessors for hidden properties object not touch interceptors.
Interceptors cannot provide a meaningful result for hidden_symbol anyway and some of them crash on empty property name.


Related Chromium issue: http://code.google.com/p/chromium/issues/detail?id=27385

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3294 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-12 16:34:52 +00:00
erik.corry@gmail.com
407816af39 Fix some style issues in the ARM code.
Also move a function into the macro assembler.
Fix some *& placement errors that had accumulated.
Review URL: http://codereview.chromium.org/385069

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3293 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-12 13:55:21 +00:00
erik.corry@gmail.com
0d94d7c785 Add vfp support on ARM. Patch from John Jozwiak.
Review URL: http://codereview.chromium.org/348019

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3292 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-12 13:04:02 +00:00
lrn@chromium.org
1151b496bf Fast-codegen: Added support for arguments in functions.
Functions using "arguments" have their arguments object created on entry.
Also added support for variables rewritten into argument object property access.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3289 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-12 11:38:01 +00:00
kbr@chromium.org
ffda5f5ff5 Fixed bug in x64 port of KeyedStoreIC::GenerateExternalArray where it
was always falling through to the runtime. Re-examined both load and
store ICs and verified they are now in sync with the 32-bit port.

Ran tests and benchmarks.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3286 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-11 23:06:11 +00:00
christian.plesner.hansen@gmail.com
d5ca1178cb Fixed a few cases where allocators did not respect always_allocate,
potentially leading to bogus FatalProcessOutOfMemory situations.  Also
fixed a few cases where callers relied on getting a NewSpace object
back (to avoid write barrier overhead) which they can't when
always_allocate is in effect.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3285 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-11 15:25:51 +00:00
erik.corry@gmail.com
6d91ffdafe Fix thinko in fix for issue 484.
Review URL: http://codereview.chromium.org/391016

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3284 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-11 14:32:14 +00:00
erik.corry@gmail.com
2d30963d1d Log the stubs found in the snapshot so the profiler can give
a sensible output.
Review URL: http://codereview.chromium.org/385039

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3281 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-11 12:35:50 +00:00
christian.plesner.hansen@gmail.com
5d4d5944dd Remove special-case for arguments.toString to match ES5
Patch by Jan de Mooij <jandemooij@gmail.com>
Review: http://codereview.chromium.org/273073

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3279 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-11 11:28:37 +00:00
lrn@chromium.org
d53f05e3e2 Fix warnings on Win64.
Set warning level to /W3 and change implicit conversions from size_t
to int. Most "fixes" are simply manifesting the implicit casts or using
a special strlen replacement that returns int.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3273 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-11 09:50:06 +00:00
erik.corry@gmail.com
78a8f5973d Restore info needed to register profile ticks in functions from
the snapshot.  Still needed: info to register profile ticks in
stubs.
Review URL: http://codereview.chromium.org/385035

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3272 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-11 09:19:39 +00:00
ager@chromium.org
2252cc1bc9 Fix inline constructor code bailout.
Remove variable that is currently unused.

BUG=http://code.google.com/p/v8/issues/detail?id=502
Review URL: http://codereview.chromium.org/392001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3267 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-11 09:00:09 +00:00
yurys@chromium.org
cd9660f77c All hidden properties of an object are stored in a value of a regular property with empty name. This property may confuse user if returned among regular properties. It should not be exposed directly by ObjectMirror. Should we want an access to these properties from debugger we need to implement an explicit method for that.
Current patch filters the hidden_symbol from property names returned to ObjectMirror.

See http://crbug.com/26491

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3265 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-10 16:13:21 +00:00
ager@chromium.org
963d72ff57 Revert r3032 that uses push instead of 'sub esp, size'. This change
leads to stack corruption in 32-bit version of V8.

See http://code.google.com/p/chromium/issues/detail?id=27227 for a
reproducible case.

Since this is only an issue on 32-bit V8 I think this has got
something to do with the UnsafeSmi handling that we do on ia32.  I'm
reverting for now so we can push a fix, but we should track down the
issue and create a regression test for this.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3263 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-10 14:58:16 +00:00
sgjesse@chromium.org
851b9b2f73 Remove sliced string string type
As a first step to reduce the complexity of the string hierachy the sliced string type is removed. Whenever a sub-string is created it is allocated as a fresh flat string.
Review URL: http://codereview.chromium.org/385004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3259 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-10 13:23:05 +00:00
lrn@chromium.org
c1efaa01fe Reapply 3246 and 3247 after fixing valgrind warning.
Review URL: http://codereview.chromium.org/386001


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3257 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-10 10:23:23 +00:00
fschneider@chromium.org
091c7a2306 Fixed bug in while-loops that caused an assertion to fail.
We forgot resetting true-/false-label to NULL after evaluating the 
condition expression in dowhile- and while-loops. 
This change fixes this.

This causes an assertion to fail in VisitIfStatement whenever there is an 
if-statement after a while-loop before. e.g. like in:

  var i=0, j=0;
  while(j<5) { j++; }
  if (i ==0 ) { j++; }




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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3255 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-10 09:57:13 +00:00
erik.corry@gmail.com
95d550578c Revert 3245 and 3246 because they cause valgrind failures.
TBR=lrn
Review URL: http://codereview.chromium.org/372059

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3254 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-09 17:05:51 +00:00
fschneider@chromium.org
5ba34775c7 Temporarily de-activate while-loops in the top-level compiler because
it makes some debug tests fail.

TBR=christian.plesner.hansen@gmail.com
Review URL: http://codereview.chromium.org/371069

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3253 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-09 15:31:15 +00:00
erik.corry@gmail.com
526f83d6b9 Fix small memory leak in new serialization code.
Review URL: http://codereview.chromium.org/371068

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3252 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-09 13:30:50 +00:00
fschneider@chromium.org
cff817d70b Revert change r3240-3241 because it causes ARM tests to fail.
(non-lazily compiled function literals)

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3251 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-09 13:30:35 +00:00
lrn@chromium.org
5b1faade55 Fast-compiler: Added trivial implementations of while and do/while.
Review URL: http://codereview.chromium.org/372055


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3250 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-09 13:22:38 +00:00
erik.corry@gmail.com
9065114928 http://codereview.chromium.org/371067 thanks to Jan de Mooij
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3249 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-09 13:21:14 +00:00
ager@chromium.org
a29255e334 Inline common case of one capture when using replace with a regexp and
a function.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3248 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-09 13:17:50 +00:00
lrn@chromium.org
8ad022d544 Fix lint issue.
Review URL: http://codereview.chromium.org/379005


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3247 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-09 12:18:25 +00:00
lrn@chromium.org
cf0d74554c Remove unnecessary buffer doubling and content copying.
Review URL: http://codereview.chromium.org/377006


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3246 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-09 11:52:18 +00:00
fschneider@chromium.org
be8e9c0b1c Fix SVN merge problem in the top-level compiler.
(Remove bailout on non-global declarations again)

TBR=whesse@chromium.org
Review URL: http://codereview.chromium.org/372054

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3245 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-09 10:30:33 +00:00
erik.corry@gmail.com
b068a9f755 * Fix regexp benchmark regression where we were doing work to
make standard regexps like \s and . case independent.
* Make use of the fact that the subject string is ASCII only
when making character classes case independent.
* Avoid spending time making large ideogram or punctuation
ranges case independent when there is no case mapping anyway.
Review URL: http://codereview.chromium.org/378024

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3243 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-09 10:01:23 +00:00
whesse@chromium.org
493c9f072c Enable writes and reads of context slots in fast compiler.
Review URL: http://codereview.chromium.org/360054

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3242 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-09 09:56:57 +00:00
fschneider@chromium.org
0afb1e1697 Add function literals that always require non-lazy compilation to the top-level compiler.
Review URL: http://codereview.chromium.org/371064

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3241 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-09 09:43:24 +00:00
erik.corry@gmail.com
eec580cf5d Fix missing () on function call causing warning on some versions
of gcc.
Review URL: http://codereview.chromium.org/371020

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3239 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-06 14:06:35 +00:00
erik.corry@gmail.com
6a3921fc0e Keep natives source code in external strings instead of putting
it in regular flat strings that are part of the snapshot.
After this change we don't need libraries-empty.cc any more.  In
this change libraries-empty.cc is just a the same as libraries.cc
and the scons build builds it but does not use it.  We can move
in stages to a situation where it is not generated at all for all
the build systems that we have.
Review URL: http://codereview.chromium.org/360050

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3238 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-06 13:48:33 +00:00
christian.plesner.hansen@gmail.com
321bed24f6 Fixed problem where popping a handle scope after calling an accessor
would clobber the register holding the result.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3237 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-06 11:35:47 +00:00
erik.corry@gmail.com
57c919e414 Fix bug 486, Cyrillic character ranges in case independent regexps.
http://code.google.com/p/v8/issues/detail?id=486
Review URL: http://codereview.chromium.org/361033

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3236 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-06 11:15:20 +00:00
fschneider@chromium.org
9a7c403bbb Add support for all declarations in the top-level compiler:
Until now we only handled global declarations. This change
adds declarations of local variables, consts and functions.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3234 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-05 17:33:50 +00:00
kmillikin@chromium.org
8595cbb0d3 Remove an unused enumeration value.
Review URL: http://codereview.chromium.org/366030

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3233 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-05 17:25:50 +00:00
kmillikin@chromium.org
16303936de Fix a bad commit due to an svn merge error.
Review URL: http://codereview.chromium.org/368007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3232 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-05 16:21:27 +00:00
kmillikin@chromium.org
debb5f8b48 Change the special handling of typeof comparisons to strings for
regular expressions to be consistent with typeof in other contexts.
Typeof regular expressions should now be 'function' in all contexts.

In the JS natives, IS_FUNCTION, IS_OBJECT, and IS_REGEXP return the
same answers as before.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3231 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-05 16:08:48 +00:00
christian.plesner.hansen@gmail.com
930ab041a8 Made iteration of global handles more efficient on scavenges.
Review URL: http://codereview.chromium.org/355041


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3230 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-05 15:12:36 +00:00
sgjesse@chromium.org
41d6cae46d Fix issue 493: Infinite loop when debug break is set when entering function.apply.
In the generated code for function.apply there was a loop checking the stack limit for interruption. This loop would call into the runtime system to handle interuption and keep running until there was no interruption. However if the interuption was debug break the runtime system would never clear the interruption as debug break is prevented in builtins are prevented and the assumption here was that returning with the debug break flag set would move execution forward.

Renamed initial_jslimit and initial_climit to real_jslimit and real_climit. Renamed a few external references related to the stack limit as well.

Exposed the real stack limit to generated code to make the stack check when entering function.apply use the real stack limit and not the stack limit which is changed to signal interruption.

Added the real stack limit to the roots array.

BUG=http://code.google.com/p/v8/issues/detail?id=493
TEST=cctest/test-debug/DebugBreakFunctionApply
Review URL: http://codereview.chromium.org/345048

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3229 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-05 13:59:40 +00:00
ager@chromium.org
b5a19c1036 Rework the way we handle the fact that the ARM simulator uses a
separate JS stack.

In exception handling, we need to be able to compare addresses into
the JavaScript portion of the stack with the address of a C++ handler
on the stack.  Since the stacks are separate on the simulator, we need
a JavaScript stack address corresponding to a C++ try catch handler in
order to perform valid address comparisons.

On the simulator, we now link the C++ try catch handlers indirectly
through the JS stack and use the JS stack indirection address for
comparisons.

      JS                    C++
                           
                           handler
 [C++ address]   <------    next_
                \
                 \
                  \---->   handler
 [C++ address]   <------    next_


On actual hardware the C++ try catch handlers continue to be directly
linked.

BUG=http://code.google.com/p/v8/issues/detail?id=271
Review URL: http://codereview.chromium.org/360004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3228 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-05 13:27:21 +00:00
whesse@chromium.org
ec7034e65b Make "typeof this" return object in fast compiler.
Review URL: http://codereview.chromium.org/366028

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3227 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-05 12:45:53 +00:00
ager@chromium.org
f39fbb206e Fix case where we treat an unaliased call to eval as an aliased call
to eval.

BUG=http://code.google.com/p/v8/issues/detail?id=496
Review URL: http://codereview.chromium.org/366027

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3225 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-05 11:19:37 +00:00