Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Issue 6698015: Implement strict mode arguments caller/callee. (Closed)

Created:
9 years, 9 months ago by Martin Maly
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Implement strict mode arguments caller/callee. BUG= TEST=test/mjsunit/strict-mode.js

Patch Set 1 #

Total comments: 14

Patch Set 2 : CR Feedback. #

Total comments: 13

Patch Set 3 : Kevin's feedback. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+292 lines, -89 lines) Patch
M src/arm/code-stubs-arm.cc View 1 2 3 chunks +15 lines, -10 lines 0 comments Download
M src/arm/codegen-arm.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/arm/codegen-arm.cc View 1 2 1 chunk +3 lines, -1 line 0 comments Download
M src/arm/full-codegen-arm.cc View 1 2 1 chunk +3 lines, -1 line 0 comments Download
M src/bootstrapper.cc View 1 2 2 chunks +70 lines, -8 lines 0 comments Download
M src/builtins.h View 1 chunk +2 lines, -0 lines 0 comments Download
M src/builtins.cc View 1 2 2 chunks +15 lines, -1 line 0 comments Download
M src/code-stubs.h View 1 2 2 chunks +14 lines, -1 line 0 comments Download
M src/codegen.cc View 1 2 1 chunk +7 lines, -2 lines 0 comments Download
M src/codegen-inl.h View 1 chunk +5 lines, -1 line 0 comments Download
M src/contexts.h View 1 2 2 chunks +3 lines, -0 lines 0 comments Download
M src/heap.h View 1 2 1 chunk +8 lines, -3 lines 0 comments Download
M src/heap.cc View 1 2 3 chunks +26 lines, -10 lines 0 comments Download
M src/ia32/code-stubs-ia32.cc View 1 2 3 chunks +17 lines, -10 lines 0 comments Download
M src/ia32/codegen-ia32.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/ia32/codegen-ia32.cc View 1 2 1 chunk +3 lines, -1 line 0 comments Download
M src/ia32/full-codegen-ia32.cc View 1 2 1 chunk +3 lines, -1 line 0 comments Download
M src/messages.js View 1 chunk +2 lines, -0 lines 0 comments Download
M src/runtime.cc View 1 chunk +9 lines, -1 line 0 comments Download
M src/x64/code-stubs-x64.cc View 1 2 3 chunks +16 lines, -10 lines 0 comments Download
M src/x64/codegen-x64.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/x64/codegen-x64.cc View 1 2 1 chunk +3 lines, -1 line 0 comments Download
M src/x64/full-codegen-x64.cc View 1 2 1 chunk +3 lines, -1 line 0 comments Download
M test/es5conform/es5conform.status View 1 chunk +2 lines, -6 lines 0 comments Download
M test/mjsunit/strict-mode.js View 3 chunks +60 lines, -20 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Martin Maly
Implementing strict mode poison pills for arguments object. Kevin, I hope this doesn't interfere much ...
9 years, 9 months ago (2011-03-15 02:50:36 UTC) #1
Lasse Reichstein
LGTM if Kevin agrees. http://codereview.chromium.org/6698015/diff/1/src/arm/code-stubs-arm.cc File src/arm/code-stubs-arm.cc (right): http://codereview.chromium.org/6698015/diff/1/src/arm/code-stubs-arm.cc#newcode4807 src/arm/code-stubs-arm.cc:4807: int arguments_object_size) { Could you ...
9 years, 9 months ago (2011-03-15 09:58:40 UTC) #2
Martin Maly
Updated. Kevin, please let me know if this is OK. Cheers Martin http://codereview.chromium.org/6698015/diff/1/src/arm/code-stubs-arm.cc File src/arm/code-stubs-arm.cc ...
9 years, 9 months ago (2011-03-16 01:21:24 UTC) #3
Kevin Millikin (Chromium)
Not a full review, but what I looked at all LGTM. No conflict with my ...
9 years, 9 months ago (2011-03-16 09:48:41 UTC) #4
Martin Maly
9 years, 9 months ago (2011-03-16 22:22:25 UTC) #5
Thanks, Kevin. Good suggestions.
Since both Lasse and you LGTM'd this I will plan to land this as soon as the
change this depends on (http://codereview.chromium.org/6694044/) lands.

Cheers!
Martin

http://codereview.chromium.org/6698015/diff/6001/src/arm/code-stubs-arm.cc
File src/arm/code-stubs-arm.cc (right):

http://codereview.chromium.org/6698015/diff/6001/src/arm/code-stubs-arm.cc#ne...
src/arm/code-stubs-arm.cc:4860: STATIC_ASSERT(Heap::arguments_callee_index ==
1);
On 2011/03/16 09:48:41, Kevin Millikin wrote:
> That name is old school.
> 
> You might as well change it to kArgumentsCalleeIndex as part of this change.

Done.

http://codereview.chromium.org/6698015/diff/6001/src/arm/code-stubs-arm.cc#ne...
src/arm/code-stubs-arm.cc:4862: MemOperand callee_operand = FieldMemOperand(
On 2011/03/16 09:48:41, Kevin Millikin wrote:
> You're right, this is ugly.  I would write instead:
> 
> const int kCalleeOffset =
>     JSObject::kHeaderSize + Heap::kArgumentsCalleeIndex * kPointerSize;
> __ str(r3, FieldMemOperand(r0, kCalleeOffset));

Done. Good suggestion!

http://codereview.chromium.org/6698015/diff/6001/src/arm/codegen-arm.cc
File src/arm/codegen-arm.cc (right):

http://codereview.chromium.org/6698015/diff/6001/src/arm/codegen-arm.cc#newco...
src/arm/codegen-arm.cc:605: ? ArgumentsAccessStub::NEW_OBJECT_STRICT
On 2011/03/16 09:48:41, Kevin Millikin wrote:
> OBJECT is just noise.  How about NEW_STRICT and NEW_NON_STRICT?

Done.

http://codereview.chromium.org/6698015/diff/6001/src/code-stubs.h
File src/code-stubs.h (right):

http://codereview.chromium.org/6698015/diff/6001/src/code-stubs.h#newcode684
src/code-stubs.h:684: }
On 2011/03/16 09:48:41, Kevin Millikin wrote:
> On 2011/03/16 01:21:24, Martin Maly wrote:
> > This is tragic. Using ?: results in linker not being able to find the
> > kArguments* constants. Unless I am missing something it smells like gcc
bug...
> > so I had to resort to if .. else to work around it. It didn't make
difference
> > whether the code was in inline method or not.
> 
> It looks like it's declared in heap.h, but there is no definition in heap.cc. 
> We get away with that all the time, but the compiler doesn't have to allow it.

> Fix is to add:
> 
> const int Heap::kArgumentsObjectSizeStruct;
> const int Heap::kArgumentsObjectSize;
> 
> in heap.cc.
> 
> (Relevant part of the standard:
> 
> 9.4.2.4 4 If a static data member is of const integral or const enumeration
> type, its declaration in the class definition can specify a
constant-initializer
> which shall be an integral constant expression (_expr.const_).  In that case,
> the member can appear in integral constant expressions within its scope.  The
> member shall still be defined in a namespace scope if it is used in the
program
> and the namespace scope definition shall not contain an initializer.)

Done. Thanks for the detailed info!

http://codereview.chromium.org/6698015/diff/6001/src/contexts.h
File src/contexts.h (right):

http://codereview.chromium.org/6698015/diff/6001/src/contexts.h#newcode90
src/contexts.h:90: V(ARGUMENTS_BOILERPLATE_STRICT_INDEX, JSObject, \
On 2011/03/16 09:48:41, Kevin Millikin wrote:
> Probably reads better as STRICT_ARGUMENTS_BOILERPLATE_INDEX, JSObject,
> strict_arguments_boilerplate

Done. Using STRICT_MODE_ARGUMENTS_BOILERPLATE_INDEX which is consistent with
what Mads recommended for the other names.

http://codereview.chromium.org/6698015/diff/6001/src/heap.h
File src/heap.h (right):

http://codereview.chromium.org/6698015/diff/6001/src/heap.h#newcode593
src/heap.h:593: static const int arguments_length_index = 0;
On 2011/03/16 09:48:41, Kevin Millikin wrote:
> kArgumentsLengthIndex

Done.

Powered by Google App Engine
This is Rietveld 408576698