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

Issue 542087: Ensure correct boxing of values when calling functions on them... (Closed)

Created:
10 years, 11 months ago by Søren Thygesen Gjesse
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Ensure correct boxing of values when calling functions on them When a function is called with a value type as the receiver this is now boxed as an object. This is a low-impact solution where the receiver is only boxed when required. For IC calls to the V8 builtins values are not boxed and as most of the functions on String.prototype, Number.prototype and Boolean.prototype are sitting there most IC calls on values will not need any boxing of the receiver. For calls which are not IC calls but calls through the CallFunctionStub a flag is used to determine whether the receiver might be a value and only when that is the case will the receiver be boxed. No changtes to Function.call and Function.apply - they already boxed values. According to the ES5 spec the receiver should not be boxed for these functions, but current browsers have not adopted that change yet. BUG=223 TEST=test/mjsunit/value-wrapper.js TEST=test/mjsunit/regress/regress-crbug-3184.js Committed: http://code.google.com/p/v8/source/detail?r=3617

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 12

Patch Set 3 : '' #

Patch Set 4 : '' #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+547 lines, -268 lines) Patch
M src/arm/codegen-arm.h View 1 2 2 chunks +3 lines, -22 lines 0 comments Download
M src/arm/codegen-arm.cc View 1 2 7 chunks +34 lines, -6 lines 0 comments Download
M src/arm/fast-codegen-arm.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M src/arm/stub-cache-arm.cc View 1 2 1 chunk +52 lines, -37 lines 0 comments Download
M src/codegen.h View 1 2 3 1 chunk +58 lines, -0 lines 0 comments Download
M src/debug.cc View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M src/globals.h View 1 2 1 chunk +6 lines, -0 lines 0 comments Download
M src/ia32/codegen-ia32.h View 1 2 3 chunks +4 lines, -35 lines 0 comments Download
M src/ia32/codegen-ia32.cc View 1 2 8 chunks +34 lines, -6 lines 0 comments Download
M src/ia32/fast-codegen-ia32.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M src/ia32/stub-cache-ia32.cc View 1 2 1 chunk +52 lines, -37 lines 0 comments Download
M src/ic.h View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M src/ic.cc View 1 2 2 chunks +16 lines, -0 lines 0 comments Download
M src/x64/codegen-x64.h View 1 2 2 chunks +3 lines, -41 lines 0 comments Download
M src/x64/codegen-x64.cc View 1 2 8 chunks +33 lines, -6 lines 0 comments Download
M src/x64/fast-codegen-x64.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M src/x64/stub-cache-x64.cc View 1 2 1 chunk +49 lines, -34 lines 0 comments Download
D test/mjsunit/bugs/bug-223.js View 1 2 1 chunk +0 lines, -39 lines 0 comments Download
A test/mjsunit/regress/regress-crbug-3184.js View 1 chunk +56 lines, -0 lines 0 comments Download
A test/mjsunit/value-wrapper.js View 1 3 1 chunk +138 lines, -0 lines 1 comment Download

Messages

Total messages: 4 (0 generated)
Søren Thygesen Gjesse
10 years, 11 months ago (2010-01-15 11:40:33 UTC) #1
Mads Ager (chromium)
http://codereview.chromium.org/542087/diff/3011/4023 File src/arm/stub-cache-arm.cc (right): http://codereview.chromium.org/542087/diff/3011/4023#newcode640 src/arm/stub-cache-arm.cc:640: if (!function->IsBuiltin()) { Could you add a comment for ...
10 years, 11 months ago (2010-01-15 12:15:56 UTC) #2
Søren Thygesen Gjesse
http://codereview.chromium.org/542087/diff/3011/4023 File src/arm/stub-cache-arm.cc (right): http://codereview.chromium.org/542087/diff/3011/4023#newcode640 src/arm/stub-cache-arm.cc:640: if (!function->IsBuiltin()) { On 2010/01/15 12:15:56, Mads Ager wrote: ...
10 years, 11 months ago (2010-01-15 14:49:49 UTC) #3
Mads Ager (chromium)
10 years, 11 months ago (2010-01-19 07:28:58 UTC) #4
LGTM!

http://codereview.chromium.org/542087/diff/6028/5015
File test/mjsunit/value-wrapper.js (right):

http://codereview.chromium.org/542087/diff/6028/5015#newcode124
test/mjsunit/value-wrapper.js:124: // According to ES3 15.3.4.3 the this value
passed to Function.prototyle.apply
prototyle -> prototype

Powered by Google App Engine
This is Rietveld 408576698