Commit Graph

2304 Commits

Author SHA1 Message Date
antonm@chromium.org
93d6199de0 When processing global vars initialization account for the case of splitted
global object (using hidden prototypes):

1) setters might be not on the global object itself, but on its prototypes;
2) if property on one of prototypes is readonly, we could shadow it.
Review URL: http://codereview.chromium.org/434035

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3362 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-25 15:45:37 +00:00
erik.corry@gmail.com
c5052399e4 Fix 64 bit build. TBR=ager.
Review URL: http://codereview.chromium.org/442003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3361 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-25 13:27:15 +00:00
erik.corry@gmail.com
10e183d353 Make heap serialization nondestructive.
Review URL: http://codereview.chromium.org/441017

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3360 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-25 12:55:33 +00:00
erik.corry@gmail.com
059b9bbc5e Update with a hopefully complete list of macros
used by gcc to indicate ARM architectures.
Review URL: http://codereview.chromium.org/440017

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3359 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-25 11:23:48 +00:00
mikhail.naganov@gmail.com
3267107040 Change 'debugger-auto-break' flag status.
I think we can promote this flag to stable status and enable it by default.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3357 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-25 10:11:34 +00:00
erik.corry@gmail.com
b0b5dbadbd Fix bug 516 by recognizing yet another gcc macro that
indicates ARMv6.
Review URL: http://codereview.chromium.org/437056

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3356 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-25 09:55:49 +00:00
lrn@chromium.org
d4d2277e2e Fast-compiler: Add stack limit checks to back edges of while, do-while and for.
A few other tweaks.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3355 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-25 09:05:30 +00:00
sgjesse@chromium.org
8dbedbb30e Added an ASSERT to code from r3350
Review URL: http://codereview.chromium.org/441014

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3354 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-25 08:14:23 +00:00
sgjesse@chromium.org
4bc5aee624 Fix compilation error in r3350
TBR=ager@chromium.org
Review URL: http://codereview.chromium.org/435021

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3352 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-24 14:45:27 +00:00
sgjesse@chromium.org
eb4d261e24 Remove the different length string types
The different length string types was used to encode the string length and the hash in one field. This is now split into two fields one for length and one for hash. The hash field still encodes the array index of the string if it has one. If an array index is encoded in the hash field the string length is added to the top bits of the hash field to avoid a hash value of zero.

On 32-bit this causes an additional 4 bytes to be used for all string objects. On 64-bit this will be half on average dur to pointer alignment.
Review URL: http://codereview.chromium.org/436001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3350 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-24 14:10:06 +00:00
ager@chromium.org
56074f783a Prepare push to trunk. Now working on version 2.0.3.
Review URL: http://codereview.chromium.org/435018

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3349 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-24 13:30:15 +00:00
ager@chromium.org
6ce4b10608 Re-enable all declarations in fast top-level compiler.
Disable fast top-level compiler for now because of issues 525 and 526.

Add regression test for issue 525.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3348 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-24 12:23:29 +00:00
mikhail.naganov@gmail.com
9d440fdd36 Store API callback entry address prior to entering a callback.
Callback entry address is stored in VMState and is later retrieved by
profiler stack sampler. This makes possible relating API entry to JS
stack, and this is simpler than trying to unwind native stack.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3344 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-23 14:43:00 +00:00
mikhail.naganov@gmail.com
c2f12a7293 Reimplement logging of API callbacks entry points in an easier way.
Now they are logging during "LogCompiledFunctions" cycle. API functions
are detected by examining SFI's "function_data" field.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3343 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-23 09:19:24 +00:00
ager@chromium.org
1fe8655fbc Change the signature for StrNDup to match the implementation. This
mismatch causes problems if attempting to build d8 with readline
support.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3342 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-20 13:08:44 +00:00
mikhail.naganov@gmail.com
72d7453dc2 Fix issue 520: wrap Logger calls into LOG macro
BUG=520

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3341 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-20 12:38:59 +00:00
mikhail.naganov@gmail.com
a9d7c378d8 Add logging of callbacks in prof-lazy mode.
This is needed to show calls to DOM in CPU profiles. I can think
of a better approach like adding specific functions into V8 API
for explicitly providing callback names and modifying bindings codegen
appropriately. My plan is as follows:
 - submit this CL;
 - implement anything I need to process log data and display DOM
   calls in profiles;
 - think again about adding specific functions and modifying bindings
   codegen.

BUG=http://code.google.com/p/chromium/issues/detail?id=27613

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3340 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-20 12:15:46 +00:00
ager@chromium.org
11ba1bd163 Prepare push to trunk. Now working on version 2.0.2.
Review URL: http://codereview.chromium.org/421003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3338 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-20 12:03:44 +00:00
ager@chromium.org
157e4f993b Disable the fast top-level compiler for non-global declarations.
Reintroduce the bailout that was put in in revision 3224.

It causes interactive ui test failures in Chromium.

TBR=fschneider@chromium.org
Review URL: http://codereview.chromium.org/421002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3337 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-20 11:45:18 +00:00
erik.corry@gmail.com
43e8d5fa7f Some optimizations for packer.js.
Review URL: http://codereview.chromium.org/409007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3336 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-20 10:11:45 +00:00
fschneider@chromium.org
d9d18b30f5 Implement IS_OBJECT and IS_FUNCTION as inlined runtime functions.
Summary:
This change fixes a performance regression introduced by the special
handling of regular expressions in typeof expressions.
As a result we regain ~8% speedup on 3d-raytrace and ~13% on boyer
(vs bleeding edge)

Description:
The macros IS_OBJECT and IS_FUNCTION are frequently used in the 
JS runtime functions. 
By introducing new inlined runtime functions %_IsFunction and %_IsObject
we avoid invoking the more expensive %_ClassOf function plus comparing
its result to a string. 


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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3335 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-19 07:41:32 +00:00
ager@chromium.org
3cf9ce4736 Fix crash in string replace with regexp. If the suffix of the subject
string is larger than 2047 chars we will encode the slice as two Smis
instead of one.  The calculation of the max size of the string builder
did not take this into account.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3334 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-18 18:48:04 +00:00
ager@chromium.org
981480c3bd Prepare push of version 2.0.0 to trunk. Now working on version 2.0.1.
Review URL: http://codereview.chromium.org/405018

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3332 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-18 12:24:46 +00:00
erik.corry@gmail.com
446b1f4443 Correct dumb assert.
Review URL: http://codereview.chromium.org/402048

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3331 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-18 12:14:21 +00:00
ager@chromium.org
ce20b5b461 Fixed bug in pixel array inline cache on x64. The value was not
zero-extended as it should be.  Therefore, the index into the pixel
array could influence the value on reads.

BUG=http://code.google.com/p/chromium/issues/detail?id=26337
Review URL: http://codereview.chromium.org/399067

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3328 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-18 11:36:29 +00:00
erik.corry@gmail.com
701c00f8b4 Accelerate charCodeAt on ARM.
Review URL: http://codereview.chromium.org/402012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3327 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-18 10:20:24 +00:00
sgjesse@chromium.org
d55d3ce89a Add DebugMessageDispatchHandler
A callback on the debugger thread when a message is received. Allows the 
embedding application to wake up the main thread in order to handle the 
message. Useful when the embedding application is idle and sitting in a 
select() call.

Patch by Ryan Dahl <coldredlemur@gmail.com>

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3326 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-18 08:59:28 +00:00
kasperl@chromium.org
d5c355e367 Make sure to retry SetHiddenPropertiesObject if it
returns a failure.
Review URL: http://codereview.chromium.org/402034

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3323 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-18 00:09:28 +00:00
lrn@chromium.org
1bc9a21e9a Sorry, this should have gone to http://codereview.chromium.org/391014
I added some tests and swapped the lhs and rhs of the && operator in v8natives.js as requested.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3319 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-17 13:54:05 +00:00
antonm@chromium.org
9a545949a4 Restore invariant (next of first deallocated must point to the head) before calling into weak
callbacks.

Otherwise if callback allocates a new handle, it could orphan some global handles (with disastorous
consequences if those global handles are cached).

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3318 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-17 13:50:07 +00:00
erik.corry@gmail.com
41749529dd Speed up charCodeAt on very large cons strings, by insisting on
flattening the strings and not trying too hard to traverse a big
cons tree from generated code.
Review URL: http://codereview.chromium.org/402008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3317 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-17 10:28:04 +00:00
sgjesse@chromium.org
63925e5013 Add missing case for shr in IA-32 disassembler
Review URL: http://codereview.chromium.org/397024

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3316 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-17 10:24:27 +00:00
sgjesse@chromium.org
459e4c6b0c Changes to Intel shift functions
Change name of shifts picking the shift count from cl to sal_cl, shl_cl and shr_cl.

Add special encoding of shift by one for shr which was missing it.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3314 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-17 08:35:43 +00:00
fschneider@chromium.org
53bee811ad Re-enable using push instructions for syncing the virtual frame.
This change fixes the problem with the original version of this approach
(r3032) that may lead to a corrupted stack if we would invoke spilling during 
syncing a large SMI constant (unsafe SMIs) in the virtual frame.

The new code for storing unsafe SMI constants does not use an extra temporary 
register. This prevents the compiler from ever having to spill during a 
virutal frame sync operation.

For storing a large SMI constant we previously generated:

  mov ecx, (large_smi & 0x0000ffff)
  xor ecx, (large_smi & 0xffff0000)
  push ecx

we now generate:

  push (large_smi & 0x0000ffff)
  or   [esp], (large_smi & 0xffff0000)

Not using a temporary register avoids spilling within an nvocation 
of VirtualFrame::SyncRange.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3313 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-16 23:11:19 +00:00
yurys@chromium.org
9bafc32932 Step next should respect do/while condition block.
Condition block of do/while statements is a valid break location so it should have its own position. The block is represented by a regular Expression node so we cannot store the position in it, instead the position is stored in a separate field in DoWhileStatement AST node.

BUG=514
Review URL: http://codereview.chromium.org/385136

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3312 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-16 21:59:31 +00:00
yurys@chromium.org
b6ce7ce8a3 Fix some presubmit errors.
TBR=sgjesse@chromium.org
Review URL: http://codereview.chromium.org/400001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3311 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-16 16:58:09 +00:00
yurys@chromium.org
0a384a708d Skip debugger frames when looking for calling context.
BUG=509

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3310 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-16 14:41:55 +00:00
erik.corry@gmail.com
cc3896dfac Fix bug 503: undefined <= undefined should return false on ARM.
Review URL: http://codereview.chromium.org/399001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3309 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-16 14:12:27 +00:00
erik.corry@gmail.com
64941f1cf9 * Remove old snapshot implementation
Review URL: http://codereview.chromium.org/394007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3307 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-16 12:08:40 +00:00
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
kmillikin@chromium.org
efd20687c9 In the toplevel code generator, support local context allocation
provided that none of the parameters need to be copied into the
context.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3224 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-05 10:38:26 +00:00
lrn@chromium.org
e8db709be1 Removed (now) unused Token-lookup code.
Review URL: http://codereview.chromium.org/361026


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3223 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-05 10:24:20 +00:00
whesse@chromium.org
c1e7dd83a4 Implement typeof in fast compiler.
Review URL: http://codereview.chromium.org/354027

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3222 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-05 10:15:25 +00:00
lrn@chromium.org
273e860cc1 Changed keyword token recognition to be done inline in the identifier scanner.
Review URL: http://codereview.chromium.org/360048


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3221 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-05 10:11:38 +00:00
fschneider@chromium.org
877db0f539 Add support for debugger statement to top-level compiler.
Review URL: http://codereview.chromium.org/366004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3220 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-04 19:04:29 +00:00
kmillikin@chromium.org
0bf546f243 Fix a bug where if a non-lazily-compiled function is a candidate for
toplevel compilation and the toplevel compiler cannot handle the
function, we would erroneously signal a stack overflow instead of
falling back on the optimizing compiler.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3219 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-04 18:39:44 +00:00
kmillikin@chromium.org
0ce4eab1b2 Obey the flag --lazy in the toplevel code generator.
There were two separate implementations of the function
'BuildBoilerplate' that is used to compile function declarations and
function literals.  The implementations did not do exactly the same
thing.  In particular, one ignored the flag --lazy.

Combine the two implementations.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3218 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-04 17:59:24 +00:00
sgjesse@chromium.org
392ee5d1a8 Fix ARM debug build
TBR=fschneider@chromium.org

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3216 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-04 15:24:11 +00:00
sgjesse@chromium.org
77a71c90c7 Fix issue 491: constantpool dump violates ARM debugger assertion for return point
The generation of the return sequence is now protected from having the constant pool emitted inside of it in both compilers.

BUG=http://code.google.com/p/v8/issues/detail?id=491
TEST=test/mjsunit/regress/regress-491.js
Review URL: http://codereview.chromium.org/362003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3215 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-04 14:45:50 +00:00
fschneider@chromium.org
3db5a2e981 Fix compilation error in debug build for IA-32 and ARM.
TBR=sgjesse@chromium.org
Review URL: http://codereview.chromium.org/361005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3214 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-04 14:33:37 +00:00
fschneider@chromium.org
ff0d885b95 Emitting the common return sequence in the top-level compiler in one function for each platform.
I factored out the code for emitting the return sequence since we had this code duplicated in the top-level compiler.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3213 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-04 14:11:39 +00:00
kmillikin@chromium.org
34dee0319c Remove the typeof state threaded through the code generator. It was
used to signal that an expression was the immediate subexpression of
typeof, or (?) in the arm of a conditional expression itself in the
typeof state.

It was inconsistently consulted.  It was not used for property loads,
but only for slot loads.  This means that we matched the Webkit JSC
(not Spidermonkey) behavior for:

typeof(true ? x : y)  // throws ReferenceError

and we matched the SpiderMonkey behavior (not JSC) for:

with ({}) { typeof(true ? x : y) }  // ==> "undefined"

Now we are expected to match the JSC behavior in all cases.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3212 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-04 13:56:41 +00:00
sgjesse@chromium.org
54ec6c031a Fix xssue 492: ARM debug crash: mozilla/ecma/FunctionObjects/15.3.1.1-3
When the number of parameters times 4 (kPointerSize) to a function cannot be encoded in 12 bits the return sequence gets one more instruction. Changed the assertion to check for this case.

BUG=http://code.google.com/p/v8/issues/detail?id=492
TEST=test/mjsunit/regress/regress-492.js
Review URL: http://codereview.chromium.org/354028

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3211 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-04 10:04:22 +00:00
christian.plesner.hansen@gmail.com
a1b2f47600 Reverting 3174. Aka reapplying 3150, 3151 and 3159. Aka api accessor
ics.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3209 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-04 08:51:48 +00:00
erik.corry@gmail.com
b9d37517d2 * Do a GC in mksnapshot to get rid of some extraneous junk.
* Make snapshot more compact by coding the tag and the space
in one byte.  Contract some common sequences to one byte.
* Use back references only within one page.  Index from the
start of the space otherwise.
* Serialize Smis as raw data rather than int-encoding them.
This takes a little more space but is faster.
Review URL: http://codereview.chromium.org/341079

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3208 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-03 21:00:43 +00:00
fschneider@chromium.org
6d425b70f6 Insert call to CodeForFunctionPosition in the ARM code generator.
(== SetFunctionPosition in the top-level compiler)

IA32 and X64 already do this at the beginning of CodeGenerator::gencode

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3207 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-03 16:08:35 +00:00
kmillikin@chromium.org
3eb69a34fa Begin using the top-level code generator for code that is inside
directly-applied function literals that are themselves compiled with
the top-level code generator.

The choice is guarded by a test that the function is anonymous (thus
not expected to be recursive) and not in a loop.

A compilation hint is set in the shared function info and used to make
the choice.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3206 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-03 14:48:59 +00:00
kmillikin@chromium.org
85fc0d688a Fix a latent bug in the top-level compilation of function calls.
Calls to a non-global variable would go through the "call to a global"
path, rather than the "call to an arbitrary (other) expression" path.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3204 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-03 12:47:19 +00:00
christian.plesner.hansen@gmail.com
850487401d Added TryCatch::ReThrow method.
Review URL: http://codereview.chromium.org/342078


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3201 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-03 08:53:34 +00:00
whesse@chromium.org
84542872f6 Commiting changelist issue 348039 outside the codereview tool. Add comparisons to fast compiler
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3200 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-02 15:01:06 +00:00
kmillikin@chromium.org
1affb78938 Add support for for loops to the toplevel code generator.
Review URL: http://codereview.chromium.org/340059

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3199 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-02 14:12:48 +00:00
kmillikin@chromium.org
aa3b00a25a Add support for initialization block assignments in the toplevel code
generator, mimicing the behavior of the optimizing compiler.

Initialization blocks can only contain (thus begin and end) with a
property assignment in toplevel code.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3198 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-02 13:30:24 +00:00
sgjesse@chromium.org
b4c11d0816 Don't use string slices when processing RexExp replace (re-apply r3153)
Re-apply r3153 with a fix for issue 490. Except for the change in line 1756 and the added test this change is identical to http://codereview.chromium.org/342015.

BUG=490
TEST=test/mjsunit/regress/regress-490.js
Review URL: http://codereview.chromium.org/341064

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3197 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-02 12:21:43 +00:00
fschneider@chromium.org
e38cd233c3 Support for function calls on an arbitrary expression that returns
a function in the top-level compiler.

e.g.

function f() { return (function() { return true; }) }
f()()


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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3196 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-02 12:04:35 +00:00
kmillikin@chromium.org
b710d66f39 Refactor the somewhat complicated code generation for assignments into
a platform-independent structure and a few platform-specific helpers
to do the heavy lifting.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3195 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-02 11:01:47 +00:00
fschneider@chromium.org
a07146c0cb Support for post-fix count operations (x++, x--) where x is a global
variable for the top-level compiler.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3194 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-02 10:22:22 +00:00
whesse@chromium.org
e09c4f20c5 Add unary not operator to fast compiler.
Review URL: http://codereview.chromium.org/343057

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3193 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-02 10:17:12 +00:00
whesse@chromium.org
e4f5b74dd1 Add conditional expressions (ternary choice operator) to fast compiler.
Review URL: http://codereview.chromium.org/340058

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3192 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-02 08:44:19 +00:00
peter.rybin@gmail.com
9200f3ba9e Report function source position via JSON protocol
Review URL: http://codereview.chromium.org/341024


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3189 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-30 16:38:37 +00:00
kmillikin@chromium.org
20f780fdbc Implement new support for if statements in top-level code.
Review URL: http://codereview.chromium.org/346022

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3188 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-30 15:34:09 +00:00
kmillikin@chromium.org
ab3e85eeb4 Initial implementation of top-level compilation of expressions in test
context.  Test contexts are used for the left subexpressions of
short-circuited boolean operators.  The right subexpressions inherit
their expression context from the binary op expression.

Compilation of short-circuited operations in effect and test context
is straightforward:

effect(e0 || e1) =
 test(e0, L0, L1)
 L1: effect(e1)
 L0:

test(e0 || e1, L0, L1) =
 test(e0, L0, L2)
 L2: test(e1, L0, L1)

Because the value of the first subexpression may be needed as the
value of the whole expression in a value context, we introduce a
hybrid value/test contest (the value is needed if true, but not if
false).

value(e0 || e1) =
 value/test(e0, L0, L1)
 L1: value(e1)
 L0:

The compilation of value/test and test/value (introduced by boolean
AND) is:

value/test(e0 || e1, L0, L1) =
 value/test(e0, L0, L2)
 L2: value/test(e1, L0, L1)

test/value(e0 || e1, L0, L1) =
 test(e0, L0, L2)
 L2: test/value(e1, L0, L1)

Boolean AND is the dual.  The AST nodes themselves (not their parents)
are responsible for producing the proper result (effect, value, or
control flow) depending on their context.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3187 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-30 14:06:48 +00:00
whesse@chromium.org
b7c0b738c7 Add void operator to fast compiler.
Review URL: http://codereview.chromium.org/342055

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3186 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-30 11:32:42 +00:00
erik.corry@gmail.com
f57f128aba Fix new snapshot compilation on ARM.
Review URL: http://codereview.chromium.org/349001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3185 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-30 11:28:49 +00:00
erik.corry@gmail.com
dbd7f20d2d Introduce a switch for the new snapshot code and switch
it on by default.  Includes bug fixes for new snapshots.
Review URL: http://codereview.chromium.org/342054

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3184 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-30 10:23:12 +00:00
fschneider@chromium.org
07cd399b5c Support for calls on named and keyed properties in the fast compiler of the form:
o.x() and o[expr]()

other changes:
- Fix missing relocation info for StoreIC on global object.
- Generate only one common return sequence instead of always appending 
  "return <undefined>" at the end of each function: The first JS 
  return-statement will generate the common return sequence. All
  other return-statements will generate a unconditional branch to the common
  return sequence.


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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3183 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-30 10:22:31 +00:00
kmillikin@chromium.org
2181c96d61 Fix thinko in assertion.
TBR=whesse@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3182 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-30 09:57:08 +00:00
kmillikin@chromium.org
d92fa03eca Move the Location class into the AST Expression class as a member.
Since it is (currently) only an enum, change it to an enum (for now).

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3181 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-30 08:36:46 +00:00
fschneider@chromium.org
143b4b87b4 Support for property assignment in the fast compiler.
The code for .result = (b.y = 99) where b is a global variable is:

  push [esi+0x17]
  mov ecx,0xf5c229ad          ;; object: 0xf5c229ad <String[1]: b>
  call LoadIC_Initialize
  nop
  mov [esp],eax
  mov eax,0xc6
  mov ecx,0xf5c25c41          ;; object: 0xf5c25c41 <String[1]: y>
  call StoreIC_Initialize
  nop
  mov [esp],eax
  pop [ebp+0xf4]

There is still some room for improvement in the generated code.

Other changes:
 - Replaced switch-statement in FastCodeGenerator::VisitProperty with DropAndMove(...)
 - Do not emit nop after IC calls on ARM.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3180 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-30 07:56:38 +00:00
sgjesse@chromium.org
4c9c50bfd3 Prepare to push to trunk. We are now working on 1.3.19
Review URL: http://codereview.chromium.org/348010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3176 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-29 14:33:51 +00:00
kmillikin@chromium.org
b1defd51cb Rename the Location type tags to be consistent with our current naming
scheme for enumerations (eg, EFFECT => kEffect).

Remove the ability to move from one Location to another, which should
never be necessary.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3175 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-29 13:58:04 +00:00
sgjesse@chromium.org
be769f6a24 Reverting 3159, 3151 and 3150
TBR=christian.plesner.hansen@gmail.com
Review URL: http://codereview.chromium.org/343035

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3174 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-29 13:17:11 +00:00
kmillikin@chromium.org
c612751095 Fix x64 build.
TBR=whesse@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3173 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-29 12:19:20 +00:00
whesse@chromium.org
05d6294e98 Add binary operations to fast compiler.
Review URL: http://codereview.chromium.org/342019

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3172 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-29 11:55:03 +00:00
kmillikin@chromium.org
9ad7a66f98 Rename the kinds of locations to be consistent with the (codegen)
context of the expressions they label.  Introduce an "unintialized"
location to catch failure to assign any location at all.

Changed the object literal initialization on ARM to use a Store IC in
the same cases where it did on the other platforms.  This was required
because the location of the literal property name is given an
"unitialized" location.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3171 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-29 10:35:29 +00:00
sgjesse@chromium.org
9b6a1cca5d Reverting 3153
TBR=erik.corry@gmail.com
Review URL: http://codereview.chromium.org/341031

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3170 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-29 07:31:23 +00:00
ager@chromium.org
88275efb91 Prepare push to trunk. Now working on version 1.3.18.
Review URL: http://codereview.chromium.org/338063

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3166 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-28 14:30:55 +00:00
lrn@chromium.org
0aecc29024 Issue 485: Fix leak of builtins object through call and apply functions.
Review URL: http://codereview.chromium.org/345007


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3164 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-28 13:51:30 +00:00
kmillikin@chromium.org
6a83cb0ced In the toplevel compiler, shift the responsibility of assigning a
location to an Expression AST node from the node's parent to the node
itself.

This allows an inherited code generation context from a parent node to
be passed arbitrarily far down the tree (eg, the subexpression of a
unary not is in the same context as the unary expression itself, the
then and else subexpressions of the ternary operator are in the same
context as the whole expression, and so forth).

We do not yet take advantage of this in the backend (eg, the right
subexpression of short-circuited OR is still compiled by using the
parent's destination location, rather than the subexpression's
itself).

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3163 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-28 13:25:40 +00:00
sgjesse@chromium.org
6768703d24 Derive string size constants
* The maximum length of short and medium sized strings is now derived from other constants.
* Remove the redundant String part of their names.
Review URL: http://codereview.chromium.org/347002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3162 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-28 13:10:36 +00:00
erik.corry@gmail.com
97de363ef5 * Fix new snapshot code on ARM.
Review URL: http://codereview.chromium.org/344011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3161 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-28 12:37:54 +00:00
christian.plesner.hansen@gmail.com
583c47ae76 Changed accessor ICs to using direct calls.
Review URL: http://codereview.chromium.org/343015


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3159 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-28 12:14:20 +00:00
ager@chromium.org
aea684ede4 Add fast check for NaN in NumberCompare slow case.
Review URL: http://codereview.chromium.org/344010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3158 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-28 10:19:56 +00:00
fschneider@chromium.org
a84ba0e15c Fix missing recording of source position for property access in fast compiler.
Review URL: http://codereview.chromium.org/341002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3157 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-28 10:14:32 +00:00
whesse@chromium.org
0bd21aa0f9 Factor out a commonly used code sequence to DropAndMove(Location, Register)
Review URL: http://codereview.chromium.org/337060

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3156 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-28 09:56:14 +00:00
mikhail.naganov@gmail.com
492dc0643f Fix crbug/24815. Changes affect profiler "lazy" mode used for V8 in Chromium.
- don't engage the processing thread of CPU profiling until the first time profiling is resumed, this saves us a thread allocation for the majority of users;
- don't log shared libraries addresses: this is useless for JS-only profiling, and also consumes time on startup.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3154 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-28 09:13:11 +00:00
sgjesse@chromium.org
abbc6b9147 Don't use string slices when processing RexExp replace.
String slices from RegExp replace results is now encoded in either one or two smis. Substrings are not used any more.

If the existing one smi encoding cannot hold the start/length information two smis are used the first having the negative length and the second having the start.

This is in preparation for removing string slices.
Review URL: http://codereview.chromium.org/342015

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3153 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-28 09:11:45 +00:00
fschneider@chromium.org
64e1d3205f Support for property access (named, keyed) in the fast compiler.
The generated code is similar to the existing code, but we never
inline any IC code in the fast compiler.


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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3152 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-27 16:11:12 +00:00
christian.plesner.hansen@gmail.com
d05c23dbd0 Fixed build error on x64.
Review URL: http://codereview.chromium.org/339027


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3151 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-27 15:57:21 +00:00
christian.plesner.hansen@gmail.com
895f1d22e5 Implemented specialized stubs for API getters. This includes a number
of individual changes:

  - Added infrastructure for custom stub caching.
  - Push the code object onto the stack in exit calls instead of a
    debug/non-debug marker.
  - Remove the DEBUG_EXIT frame type.
  - Add a new exit stub generator for API getters.


Committed: http://code.google.com/p/v8/source/detail?r=3130
Review URL: http://codereview.chromium.org/330017

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3150 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-27 15:38:49 +00:00
whesse@chromium.org
29914b6be7 Remove --check-stack flag from V8.
Review URL: http://codereview.chromium.org/338017

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3149 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-27 14:56:50 +00:00
whesse@chromium.org
299a491d7a Add VisitCallNew to fast compiler.
Review URL: http://codereview.chromium.org/334041

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3148 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-27 14:52:55 +00:00
kmillikin@chromium.org
a73bbe605e Make it more pleasant to work with expression locations in the
top-level code generator backend.  Introduce function to move one
location to another (source cannot be nowhere); to move registers,
slots, and literals into a location; and to move a location to a
register or slot.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3146 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-27 13:38:57 +00:00
erik.corry@gmail.com
3615957055 Start using snapshot VM configuration in internal benchmark
graphing tool.  Fix nonportable fopen call in new snapshot code.
Review URL: http://codereview.chromium.org/340002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3144 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-27 13:19:14 +00:00
erik.corry@gmail.com
fb2317b63b New snapshot framework. Doesn't work on ARM yet (code targets
are different).  Is able to deserialize the whole heap and run
some stuff.  Not available as the primary snapshot system yet.
Review URL: http://codereview.chromium.org/335009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3142 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-27 11:54:01 +00:00
whesse@chromium.org
0695df6eaa Add fucomip instruction to disassembler. Fix some other floating point instructions.
Review URL: http://codereview.chromium.org/316010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3141 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-27 10:47:01 +00:00
sgjesse@chromium.org
a332c465db Fix x64 breakage in r3136.
Make sure that the return value is moved to rax. The line added back was accidently removed in r3136.

TBR=lrn@chromium.org
Review URL: http://codereview.chromium.org/339021

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3140 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-27 10:40:43 +00:00
kmillikin@chromium.org
42b28e8120 Fix x64 DEBUG build.
TBR=lrn@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3139 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-27 10:27:08 +00:00
lrn@chromium.org
59e7be2c03 Windows: Change test to not assume ebp is frame-pointer.
Review URL: http://codereview.chromium.org/329007


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3138 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-27 08:50:24 +00:00
kmillikin@chromium.org
76e1e22f15 Eliminate the constant location used for literals in the AST.
Literals now have a location of temporary by default and are
responsible for moving themselves into their location like all other
expressions.

The constant location turned out not to allow us to avoid checking
subexpressions in AST interior nodes, and it turned out to require
checking after some normal calls to Visit (like for the arguments to a
call).  With this change do not have to check after a call to Visit
that we got our result in the expected location.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3137 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-27 08:48:01 +00:00
sgjesse@chromium.org
c84af6828b Port optimization of calls to GenericBinaryStub to x64.
See description of the change in the ia32 changelist at http://codereview.chromium.org/246075.

Minor changes to the ia32 version using variables for the registers to pass parameters in (edx and eax) to make the parameter set up code easier to read.
Review URL: http://codereview.chromium.org/335005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3136 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-27 08:20:21 +00:00
lrn@chromium.org
b92a05942e Change NaN-test to only check for QNaNs, and API to only introduce QNaNs.
Review URL: http://codereview.chromium.org/339002


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3135 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-27 08:13:59 +00:00
ager@chromium.org
e9909cbf25 Apply patch by Timur Iskhodzhanov to add valgrind notifications on
code modification to the x64 build.  The same notifications are
already in place in the ia32 build.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3134 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-26 17:53:34 +00:00
christian.plesner.hansen@gmail.com
2880be71ea Reverted 3130-3131 since they don't work on mac.
Review URL: http://codereview.chromium.org/335027

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3133 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-26 15:16:42 +00:00
fschneider@chromium.org
dcee14979f Generate more compact XOR on 64-bit architecture when using xor to zero out registers.
When using xor to zero a 64-bit register, generate 32-bit instruction instead.
(according to Intel 64-bit mode coding guidelines) 

previous code for zeroing RAX:
  xor rax, rax  

==>

new code for zeroing RAX: 
  xor eax, eax

The 32-bit operand form has the same semantics: It also zeroes the upper 
32-bit of rax and its encoding uses 1 byte less.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3132 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-26 14:38:22 +00:00
christian.plesner.hansen@gmail.com
53b93464d1 Implemented specialized stubs for API getters. This includes a number
of individual changes:

  - Added infrastructure for custom stub caching.
  - Push the code object onto the stack in exit calls instead of a
    debug/non-debug marker.
  - Remove the DEBUG_EXIT frame type.
  - Add a new exit stub generator for API getters.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3130 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-26 13:54:47 +00:00
fschneider@chromium.org
9445079c51 Support for object literals in fast compiler.
I also added more unit tests for literals.

Right now, the fast compiler produces code very similar to
the existing code generator. We may consider different ways to 
further compact the generated code for top-level code.

ARM always goes through a runtime function to initialize computed
properties in an object literal whereas IA32 and x64 use StoreIC.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3129 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-26 13:21:48 +00:00
antonm@chromium.org
a531c281fd Allocate global handles in chunks.
Review URL: http://codereview.chromium.org/327008



git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3128 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-26 12:54:41 +00:00
sgjesse@chromium.org
ac280c223b Handle the list of code-stub types using macro expansion.
As the list of code-stubs is used in two places it is now handled through a macro to keep this in sync. As some code-stubs is only used on ARM the list have been split into two parts to indicate this and get rid of dummy implementation on ia32 and x64 platforms.

BUG=484
Review URL: http://codereview.chromium.org/335025

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3127 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-26 12:26:42 +00:00
mikhail.naganov@gmail.com
6d6c4fa696 Fix retainer profile test regression
TBR=sgjesse@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3126 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-26 11:59:55 +00:00
antonm@chromium.org
0d1c5c2c1f Make V8::LowMemoryNotification GC for all platforms.
Review URL: http://codereview.chromium.org/330004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3125 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-26 11:35:07 +00:00
mikhail.naganov@gmail.com
5379d81745 Heap profiler improvements.
- account code objects in retainers profile;
- differentiate between function boilerplates and closures;
- simplify code;

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3124 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-26 10:51:30 +00:00
sgjesse@chromium.org
8a1fdd3598 Remove a check which was not needed
Review URL: http://codereview.chromium.org/326011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3123 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-23 12:54:48 +00:00
sgjesse@chromium.org
b0dfb371d6 Use RtlCaptureContext instead of inline assembly to capture execution context on Windows
Inline assembly is not available in Visual C++ 64-bit version so use RtlCaptureContext to capture execution context. RtlCaptureContext is not available on Windows 2000 so this change removes Windows 2000 support. If this turns up causing trouble we can revert to only use RtlCaptureContext in 64-bit and inline assembly in 32-bit.
Review URL: http://codereview.chromium.org/335008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3122 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-23 12:47:44 +00:00
sgjesse@chromium.org
7a509f2101 Fix issue with running some constructors having only this.x = ... assignments.
If we had compiled the comment instead of the code it would have worked.

BUG=483
TEST=mjsunit/regress/regress-483.js
Review URL: http://codereview.chromium.org/332007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3120 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-23 12:18:47 +00:00
lrn@chromium.org
9e50295ad2 X64/Win64: Fix bug in returning ObjectPair.
Used the registers to test for failure before loading the result from the stack.

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


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3119 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-23 10:53:20 +00:00
kmillikin@chromium.org
e82a07c0bd Simple toplevel code generator support for short-circuited boolean OR
in a non-test (ie, value or effect) context.  (It is implicitly not in
a test context because the code generator does not support expressions
in a test context yet.)

Compilation is essentially the same as in the optimized code
generator.  The expression (e0 || e1) is compiled as if it were
(let (temp = e0) temp ? temp : e1).

On ia32 and x64 a single shared ToBoolean stub is used to convert a
value to a flag.  The inlined checks assumed by the stub are reordered
to compare to undefined (the common case in toplevel code?) first.  On
ARM a call to the runtime is used.  In the interest of code size no
checks are yet inlined on ARM.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3118 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-23 10:42:14 +00:00
kbr@chromium.org
ef95097334 Stop throwing exceptions for out-of-range accesses to CanvasArrays.
This is per resolution in the WebGL working group to make these types
match the WebIDL IndexSetter and IndexGetter semantics, which are
still being defined but will very likely not throw.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3117 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-23 09:19:17 +00:00
lrn@chromium.org
6f1d641fb6 X64/Win64: Alternative implementation of fmod in general.
Review URL: http://codereview.chromium.org/303034


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3116 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-23 09:18:19 +00:00
kbr@chromium.org
38e2b5c97b Fix lint errors.
Review URL: http://codereview.chromium.org/307037

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3114 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-22 15:21:00 +00:00
kbr@chromium.org
d5f00cf6cc Add optimized ICs for new CanvasArray types introduced in WebGL
specification under development. This is a follow-on CL to
http://codereview.chromium.org/293023 .

Based on review feedback, defined the behavior of storing NaN and
+/-Infinity into external arrays of integer types as storing 0. Added
test cases. Added fucomi instruction to assembler. Fixed bug in
KeyedLoadIC::GenerateExternalArray when allocation of HeapNumber
failed. Fixed bug in encoding of 16-bit immediate arithmetic
instructions in 64-bit port.

Removed raising of exceptions for negative array indices passed to
external arrays and associated tests. Based on current discussion in
WebGL working group, will probably end up removing the exception
throwing altogether.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3113 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-22 14:49:00 +00:00
whesse@chromium.org
719b032a9a Add --trace flag to fast compiler.
Review URL: http://codereview.chromium.org/306026

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3111 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-22 11:21:29 +00:00
kmillikin@chromium.org
fbc0eaa13d Added support for array literals to the toplevel compiler. They are
currently compiled the same as with the optimizing compiler: they are
cloned from a boilerplate object and the boilerplate objects are
lazily constructed.

Also changed argument pushing on ARM to use stm (store multiple),
which required changing the order of arguments to the runtime
functions DeclareGlobals and NewClosure.  They were only used from
generated code.

Finally, changed the toplevel code generator so that stack pops to
discard a temporary became addition to the stack pointer on ia32 and
x64.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3110 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-22 10:07:45 +00:00
fschneider@chromium.org
ee9d2d6cee Fast compiler support for regexp literals.
For .result = /abc.*/g we generate the following IA-32 code:

   ...
   mov ebx,[edi+0x17]
   mov eax,[ebx+0xb]
   cmp eax, 0xf5d0e135         ;; object: 0xf5d0e135 <undefined>
   jnz done
   push ebx
   push 0x2
   push 0xf5d13805             ;; object: 0xf5d13805 <String[5]: abc.*>
   push 0xf5d13815             ;; object: 0xf5d13815 <String[1]: g>
   call RuntimeStub_MaterializeRegExpLiteral
 done:
   push eax
   pop [ebp+0xf4]
   ...

This is very similar to the code previously generated except we do not 
generate deferred code for the case where we call the runtime.

On ARM we use the stm instruction to make pushing the arguments more compact.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3109 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-22 09:29:03 +00:00
peter.rybin@gmail.com
d8f7b36624 Add "Version" command
Review URL: http://codereview.chromium.org/274080


git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3108 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-21 17:07:43 +00:00
kmillikin@chromium.org
0fa8be43f8 Fix lint error.
TBR=ager@chromium.org
Review URL: http://codereview.chromium.org/293048

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3107 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-21 15:37:14 +00:00
ager@chromium.org
9ee631338e Allow resource constraints to specify the max committed new space size
when using snapshots.

The alignment of new space has to match the alignment in the snapshot,
but the max committed amount of memory does not.

For now, we assume that the default semispace size is always used in a
snapshot.
Review URL: http://codereview.chromium.org/300036

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3106 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-21 15:03:34 +00:00
mikhail.naganov@gmail.com
765e134b92 Heap profiler: guard calls to Producer profile.
Patch by Steve Block.

TBR=ager@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3105 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-21 13:04:53 +00:00
mikhail.naganov@gmail.com
9da793a257 Heap profiler: use Heap::CommittedMemory to report the "total" memory size.
This is the second change to eliminate reporting >100% VM memory usage.

BUG=http://crbug/23623

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3104 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-21 12:39:45 +00:00
antonm@chromium.org
4c7620dc79 Use WriteToFlat instead of to C strings methods as WriteToFlat performs notably
better for various kinds of strings.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3103 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-21 12:14:50 +00:00
fschneider@chromium.org
8b33cb7133 Support empty statements in the fast compiler.
Review URL: http://codereview.chromium.org/313003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3102 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-21 11:56:05 +00:00
kmillikin@chromium.org
61363d83ba Add support for global variable references in toplevel code. We use
the normal named load IC mechanism for now.  Generated code is similar
to the case for global variable assignments.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3101 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-21 09:38:21 +00:00
whesse@chromium.org
2a63594602 Commit fucomip change 197037 http://codereview.chromium.org/197037/show
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3100 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-21 09:24:25 +00:00
fschneider@chromium.org
88371e63f6 Adding declaration of global variables and functions in new compiler.
Adding calls to global functions to the new compiler.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3099 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-21 09:17:39 +00:00
mikhail.naganov@gmail.com
cd2065be00 applied patch
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3098 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-20 23:25:05 +00:00
kbr@chromium.org
361e4bf8a9 Fix buildbot breakage. Neglected to run tests with --verify-heap and
missed case statements for heap verification and printing needed by
http://codereview.chromium.org/293023 .

tbr=plesner

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3097 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-20 17:44:21 +00:00
kbr@chromium.org
46e6297e3e Added infrastructure for optimizing new CanvasArray types in WebGL
specification under development. The optimizations are patterned after
those previously done for CanvasPixelArray. This CL adds all of the
necessary framework but continues to use the generic KeyedLoadIC and
KeyedStoreIC code, to create a baseline for benchmarking purposes. The
next CL will add the optimized ICs to ic-ia32.cc and ic-x64.cc.

These new CanvasArray types have different semantics than
CanvasPixelArray; out-of-range values are clamped via C cast
semantics, which is cheaper than the clamping behavior specified by
CanvasPixelArray. Out-of-range indices raise exceptions instead of
being silently ignored.

As part of this work, pulled FloatingPointHelper::AllocateHeapNumber
up to MacroAssembler on ia32 and x64 platforms. Slightly refactored
KeyedLoadIC and KeyedStoreIC. Fixed encoding for fistp_d on x64 and
added a few more instructions that are needed for the new ICs. The
test cases in test-api.cc have been verified by hand to exercise all
of the generated code paths in the forthcoming specialized ICs.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3096 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-20 15:26:17 +00:00
kmillikin@chromium.org
4dfd44479d Added support for assignments to global variables in the toplevel code
generator.  We use the normal store IC mechanism with the global
object as the receiver.  The following code is generated for 'x=true'
at toplevel.

======== IA32:

27  mov eax,0xf5d06161          ;; object: 0xf5d06161 <true>
32  mov ecx,0xf5d09c35          ;; object: 0xf5d09c35 <String[1]: x>
37  push [esi+0x17]
40  call StoreIC_Initialize  (0xf5ce75c0)    ;; code: STORE_IC, UNINITIALIZED
45  mov [esp],eax

======== X64:

25  movq rax,0x7f867a7b6199    ;; object: 0x7f867a7b6199 <true>
35  movq rcx,0x7f867a7bae71    ;; object: 0x7f867a7bae71 <String[1]: x>
45  push [rsi+0x2f]
49  call StoreIC_Initialize  (0x7f8655929ac0)    ;; code: STORE_IC, UNINITIALIZED
54  movq [rsp],rax

======== ARM:

32  e59f0054       ldr r0, [pc, #+84]          ;; object: 0xf5b78161 <true>
36  e59f2054       ldr r2, [pc, #+84]          ;; object: 0xf5b7bc35 <String[1]: x>
40  e598c017       ldr ip, [r8, #+23]
44  e52dc004       str ip, [sp, #-4]!
48  e1a0e00f       mov lr, pc
52  e59ff048       ldr pc, [pc, #+72]          ;; debug: statement 0
                                               ;; code: STORE_IC, UNINITIALIZED
56  e58d0000       str r0, [sp, #+0]

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3095 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-20 13:37:26 +00:00
sgjesse@chromium.org
a637f45385 Fix issue 475
The check for arguments in registers in one of the three versions of GenericBinaryOpStub::GenerateCall was plain wrong.

BUG=475
TEST=mjsunit/regress/regress-475.js
Review URL: http://codereview.chromium.org/307002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3092 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-20 12:13:31 +00:00
kmillikin@chromium.org
03c4ad1e9a A simple change to enable empty top-level function bodies in the
fast-mode compiler.  Support was already present, but disabled.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3091 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-20 09:12:53 +00:00
antonm@chromium.org
99445fc211 Verify correctness of external string only if slow asserts are enabled.
Review URL: http://codereview.chromium.org/294019

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3090 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-20 09:10:26 +00:00
ager@chromium.org
390fd2a3b8 Add an API to V8 to get simple heap statistics.
Review URL: http://codereview.chromium.org/261037

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3089 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-10-20 07:51:49 +00:00