Commit Graph

1717 Commits

Author SHA1 Message Date
danno@chromium.org
a2fb4a12bb Create specialized code stubs for PixelArray loads.
Review URL: http://codereview.chromium.org/6287030

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6614 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-03 12:50:50 +00:00
whesse@chromium.org
fe67b206ca Fix X64 compilation on Windows.
Review URL: http://codereview.chromium.org/6334086

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6613 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-03 11:13:04 +00:00
antonm@chromium.org
0da3dc3e43 Properly process getOwnPropertyDescriptor for elements on global proxy object.
We need to go down to actual global object to perform those operations.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6612 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-03 10:19:41 +00:00
antonm@chromium.org
fed5622671 Better security checks when accessing named properties via Object.getOwnPropertyDescriptor.
Current approach returns undefined descriptor if caller is not granted v8::HAS_ACCESS.
If the caller has v8::HAS_ACCESS, for no JS accessors regular v8::GET_ACCESS check is
performed and value property of the descriptor is set to undefined if caller doesn't
have proper access.  For JS accessors both v8::GET_ACCESS and v8::SET_ACCESS are checked
and affect if getter and setter would be stored in the descriptor.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6592 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-02 17:44:29 +00:00
kmillikin@chromium.org
ca936dae9e More of the fix for V8 issue 1079.
The arguments property of functions, if we find an optimized frame for
the function, is always a freshly allocated object.  We never try to
find an existing arguments object.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6581 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-02 15:08:29 +00:00
erik.corry@gmail.com
0097f005fd Fix code generation bug on ARM in classic codegen.
Review URL: http://codereview.chromium.org/6246045

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6579 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-02 14:14:55 +00:00
lrn@chromium.org
2d15eb9a90 Fix bug in object literals with large array indexes as strings.
Review URL: http://codereview.chromium.org/6410028

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6577 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-02 14:02:58 +00:00
kmillikin@chromium.org
f1149734fc Partial fix for V8 issue 1079.
Record a safepoint with a deoptimization id for throw in optimized code.  We
don't seem to much care what the AST ID is because we will not be using it
for lazy deoptimization (throw doesn't return to the point of throw).  For
hygiene we use the actual ID of the throw expression.  Throw is no longer a
control-flow instruction, but it's followed by an unconditional abnormal
exit.  This is required to insert a simulate between the throw and the exit.

Make our optimized treatment of Function.prototype.apply act like a call and
have side effects.  This ensures that it will get a lazy deoptimization
environment.  Use that deoptimization ID in the safepoint for the call.

Deleting a property was also missing a deoptimization ID, though there was a
deoptimization environment assigned to the instruction.  Record the
environment and use the deoptimization ID at the safepoint.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6576 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-02 13:55:29 +00:00
ager@chromium.org
73a4ecfae1 A MessageObject is a purely internal object to hold information about
an error message that needs to be generated and reported. This change
hides all of the error information from JavaScript code so user
callbacks cannot get hold of it.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6574 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-02 13:31:52 +00:00
whesse@chromium.org
a5f94a4862 Fix Math.pow(-0, 0.5) and Math.pow(-0, -0.5). These are not equal to sqrt(-0) and 1/sqrt(-0). Add tests for these cases. Fixes V8 issue 1088.
BUG=1088
TEST=test/mjsunit/math-pow.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6573 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-02 12:54:58 +00:00
vegorov@chromium.org
6751627615 Require typed input representation for HTypeof hydrogen instruction.
BUG=http://code.google.com/p/chromium/issues/detail?id=71647
TEST=test/mjsunit/regress/regress-71647.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6566 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-02 09:52:57 +00:00
ricow@chromium.org
0dd951ee84 Revert revision 6555 as it causes win32 debug to fail.
Review URL: http://codereview.chromium.org/6349044

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6564 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-02 08:14:06 +00:00
peterhal@chromium.org
5ca89179d7 Revert "Fix bugs 992 and 1083"
This reverts commit 6561 as the new assert caused failures in sputnik.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6562 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-01 20:08:01 +00:00
peterhal@chromium.org
9c89aa6dd9 Fix bugs 992 and 1083
Fixes JS portion of DefineOwnProperty when there is
an existing property and the new descriptor is generic.

Makes code follow spec steps more closely.

Fixes typo for check for unchanged enumerable in step 6.

Adds regression tests.
Fixes errors in object-define-property test

Don't normalize the JSGlobalProxy. Gets webkit http/tests/security/xss-DENIED-defineProperty.html working.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6561 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-01 17:08:14 +00:00
antonm@chromium.org
32a631d8bc Compare JSObjects by identity immediately.
When invoking EQUALS JS builtin, 1st argument is passed as a receiver and
if it's a global object, it gets overwritten with global proxy object and
thus one gets incorrect results.

BUG=v8::1082

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6555 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-01 13:29:37 +00:00
antonm@chromium.org
93f8e3d821 Temporary disable comparison of optimizability of code objects in some cases.
With crankshaft, a code object can change its optimizability: it can start as
optimizable code object, but later we can find out it was a bad idea to
optimize it.  Alas, currently we don't have a proper event to communicate
this back to logger.  Hence we temporary allow a code object to be viewed
as optimizable judging from logs while being unoptimizable judging from
heap traversal.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6553 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-01 12:39:02 +00:00
ager@chromium.org
471c0d2983 Avoid callbacks to user code during error formatting in a couple of
other situations.

Do not use overwritten Object.prototype.hasOwnProperty and
Array.prototype.pop. Do not use split and join in the error formatting
implementation. They are too big to control and their generality is
not needed.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6552 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-01 12:31:16 +00:00
mmaly@chromium.org
aa779b3842 Fix V8 bug 1084: allow "\0" in strict mode as valid escape sequence.
http://code.google.com/p/v8/issues/detail?id=1084

Code Review URL: http://codereview.chromium.org/6386014/

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6550 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-31 22:35:27 +00:00
antonm@chromium.org
a38a8ffab0 ArraySplice builtin should return empty array and not alter receiver if invoked with no arguments.
Review URL: http://codereview.chromium.org/6357025

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6540 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-31 14:54:53 +00:00
antonm@chromium.org
1023f569b9 Perform security checks before fetching the value in Object.getOwnPropertyDescriptor.
Review URL: http://codereview.chromium.org/6386022

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6539 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-31 13:49:15 +00:00
fschneider@chromium.org
4e7ddab6dc Fix a bug in the placement of minus-zero checks and in GVN.
1. The placement of checks for negative zero has to be computed after
all conversion instructions have been inserted. I separated the code
into its own phase.

2. GVN need to take instruction flags into account when comparing
instructions for redundancy.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6534 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-31 12:36:54 +00:00
ager@chromium.org
8198db7934 ARM: Add support for DoMathAbs with double inputs.
Adds vabs instruction to simulator, assembler, disassembler and tests.

BUG=none
TEST=Added to cctest.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6531 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-31 10:16:28 +00:00
kmillikin@chromium.org
78b9981b90 Revert "Add custom typed ICs for pixel array loads. "
This change caused failures in (out of bounds) keyed loads of strings.

TBR'd.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6528 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-28 15:07:04 +00:00
danno@chromium.org
afd0906204 Add custom typed ICs for pixel array loads.
Review URL: http://codereview.chromium.org/6323002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6526 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-28 14:06:20 +00:00
ager@chromium.org
f8b74a1541 Avoid using Function.prototype.call in a number of places in our
builtins files. We should always use %_CallFunction for a couple of
reasons: it cannot be overwritten and it does not wrap basic types in
wrapper objects.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6524 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-28 10:33:10 +00:00
sgjesse@chromium.org
579e711389 Fix test expectations from r6509
Review URL: http://codereview.chromium.org/6286011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6511 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-27 12:31:24 +00:00
sgjesse@chromium.org
3e811483f2 Change an invalid assert
BUG=v8:1079
Review URL: http://codereview.chromium.org/6332019

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6509 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-27 11:55:58 +00:00
ager@chromium.org
dc61921bbf Fix reintroduction of global variables that have been deleted.
Deletion of global properties puts 'the hole' in the global property
cell and updates the property details in the property dictionary with
the information that the property has been deleted. When setting
global properties that have been deleted in generated code we just
store the new value in the global property cell. This does not update
the property details in the property dictionary. Therefore, it looks
like the property is not there eventhough it was just reintroduced.

Perform 'the hole' checks in generated code for global property stores
and bail out of ICs and optimized code if storing to a property cell
that contains 'the hole'.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6508 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-27 08:35:39 +00:00
mmaly@chromium.org
d07f1d62ff Strict mode eval/arguments LHS.
Review URL: http://codereview.chromium.org/6335013/

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6503 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-26 19:21:46 +00:00
mmaly@chromium.org
55400c2454 Strict mode: function constructor tests.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6501 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-26 18:10:26 +00:00
ager@chromium.org
eb3970c822 Fix another message object leak.
Review URL: http://codereview.chromium.org/6269021

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6495 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-26 15:16:13 +00:00
sgjesse@chromium.org
17aa262ce5 ARM: Fix the test expectations
TBR=ager@chromium.org
Review URL: http://codereview.chromium.org/6253013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6490 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-26 13:26:36 +00:00
sgjesse@chromium.org
26a8dc3818 ARM: Make the ARM hardware builder green
Fix a bug in the --debug-code alignment check in the C entry stub.

Don't force the --debug-code flag in the ARM disassembler tests. The framework does support passing flags and the test runner will when running tests in debug mode.

Skip some deserialization tests which crashes from time to time.
Review URL: http://codereview.chromium.org/6393007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6484 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-26 09:52:25 +00:00
mmaly@chromium.org
2b47762e3a Strict mode object property validation.
Review URL: http://codereview.chromium.org/6335010/

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6475 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-25 18:42:35 +00:00
mmaly@chromium.org
f5a2860534 Strict mode parameter validation.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6474 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-25 17:21:45 +00:00
kmillikin@chromium.org
9cfbb240a0 Update regression test.
With SVN r6465 (reverting changes to scopes), a regression test for
deleting parameter variables has to change to reflect a semantic
change.  It is now again possible to delete parameters from a function
that uses 'with' or 'try...catch'.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6466 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-25 13:32:36 +00:00
kmillikin@chromium.org
013860d42e Revert "Reapply change to with/arguments interaction."
Revert this change again.  Somewhat mysteriously we sometimes get empty
contexts that we do not expect in the context chain.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6465 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-25 13:01:45 +00:00
vitalyr@chromium.org
331b482332 Fix bug 1070: set correct holder for primitive checks.
Code generated for checks starting with primitive receivers skips one step
in the usual prototype checking algorithm, so the holder must always be set.

Not setting the holder did not cause an immediate failure because our
primitives have additional hidden prototypes before the real prototypes.
These extra objects in the chain usually contain no properties and so
allowed the right holders to be selected.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6459 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-25 12:21:03 +00:00
lrn@chromium.org
43d7951677 X64 Crankshaft: Added a bunch of operations.
Review URL: http://codereview.chromium.org/6366010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6455 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-25 11:30:47 +00:00
ager@chromium.org
d69ef26f7d Another fix for leaking error objects. User code can overwrite
ReferenceError.prototype.__proto__ which will make "error instanceof
Error" fail. However, the ReferenceError.prototype object itself
cannot be modified. Therefore, the error checks must check for
concrete error instances instead of only checking for Error.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6450 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-25 08:48:59 +00:00
ricow@chromium.org
d5cab38a33 Add support for deoptimization on x64.
I did not take out the code relating to osr from the generate method
since this makes it easier to compare to ia32 (we will abort anyway when we hit the osr code so there should be no issues with having this in)
 

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6449 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-25 07:57:56 +00:00
mmaly@chromium.org
8d79f3a788 Strict mode octal literals.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6446 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-24 18:13:18 +00:00
kmillikin@chromium.org
e01336c3dc Change conformance test expectations.
We now conform to ES5 by not deleting variables that occur in a scope
shadowed by with or eval.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6445 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-24 15:18:49 +00:00
kmillikin@chromium.org
9c2d52eb0e Fix a bug in delete for lookup slots.
The function Runtime_LookupContext searches the context chain for a
LOOKUP slot and returns the object holding the slot.  It returned the
global context if the slot was not found or if it was found in a
function's context or arguments object.  This is not the correct
object to use for 'delete'.

Since this lookup function is only ever used when deleting LOOKUP
slots (those that have to go through a with or a scope with eval), it
is simply replaced with a Runtime_DeleteContextSlot function that does
the appropriate thing for all kinds of context lookups.

This fixes Chromium bug 70066.
http://code.google.com/p/chromium/issues/detail?id=70066

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6442 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-24 14:03:30 +00:00
ager@chromium.org
b5151d118d Avoid calling overwritten toString methods for internal error
formatting. I missed a couple of places. Extracting the error object
check to a separate function.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6435 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-24 07:59:40 +00:00
kbr@chromium.org
cbc1c0fca6 Truncate rather than round to nearest when performing float-to-integer
conversions for external array types, which implement the Typed Array
spec. (Revision of http://codereview.chromium.org/6315004 .)

Prefer SSE2 code path on x86 processors. Non-SSE2 processors now make
a slow runtime call for float-to-int conversions. Use SSE3 for 32-bit
signed and unsigned int array types where possible.

The movement of code from ic-arm.cc to stub-cache-arm.cc caused the
VFP3 code path to be tested for the first time. Fixed bugs in the
register usage and in the constant value stored into integer arrays
for NaN and +/-Infinity.

Added new truncation test to test-api.cc. Storage of NaN and +/-Inf
was already covered. Ran unit tests on x86, x64 and ARM simulator.
Tested ia32 and x64 code in Chromium on Mac and Linux respectively
with Typed Array unit tests and WebGL content.

BUG=http://code.google.com/p/chromium/issues/detail?id=50972
TEST=test-api/ExternalArrays

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6431 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-21 23:58:00 +00:00
ager@chromium.org
bb9c9fe92c Change recursive error printing to just replace recursively
encountered error objects with the empty string. This actually does
match the Safari behaviour.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6430 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-21 14:11:35 +00:00
ricow@chromium.org
7e423ec8b9 Mark mozilla/ecma_3/RegExp/regress-85721 as flaky.
This tests is flaky in debug mode (especially on mac)



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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6429 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-21 11:47:02 +00:00
ager@chromium.org
ca14680556 Return the empty string when formatting recursive error messages. This
matches the behavior of Safari and Firefox. Our old behavior was to
throw a stack overflow exception.

BUG=crbug.com/70334
TEST=mjsunit/cyclic-error-to-string.js

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6428 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-21 11:44:29 +00:00
kmillikin@chromium.org
8a9eeaf8da Reapply change to with/arguments interaction.
This is svn r6415 with a bugfix.

The bug was that we can have scopes with 0 heap slots (functions with
such scopes do not need a local context) and scopes with at least
Context::MIN_CONTEXT_SLOTS.  The code generator only allocated a local
context if there were strictly more than Context::MIN_CONTEXT_SLOTS.
Before the change to with/arguments, it was impossible to actually get
a function scope with exactly Context::MIN_CONTEXT_SLOTS because every
such scope included a heap-allocated arguments (and arguments shadow)
slot.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6426 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-21 11:28:35 +00:00