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

Issue 7623011: Implement function proxies (except for their use as constructors). (Closed)

Created:
9 years, 4 months ago by rossberg
Modified:
9 years, 3 months ago
CC:
v8-dev
Visibility:
Public.

Description

Implement function proxies (except for their use as constructors). Introduce new %Apply native. Extend Execution::Call to optionally handle receiver rewriting (needed for %Apply). Fix Function.prototype.bind for functions that have .apply modified. R=kmillikin@chromium.org BUG=v8:1543 TEST= Committed: http://code.google.com/p/v8/source/detail?r=9258

Patch Set 1 #

Patch Set 2 : Distinguish between IS_FUNCTION and IS_SPEC_FUNCTION. #

Patch Set 3 : Eps: refined a comment. #

Total comments: 12

Patch Set 4 : Addressed Kevin's comments. #

Total comments: 4

Patch Set 5 : Addressed second round of comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+931 lines, -223 lines) Patch
M src/arm/builtins-arm.cc View 8 chunks +65 lines, -21 lines 0 comments Download
M src/arm/code-stubs-arm.cc View 3 chunks +17 lines, -2 lines 0 comments Download
M src/arm/full-codegen-arm.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M src/arm/macro-assembler-arm.h View 1 chunk +1 line, -3 lines 0 comments Download
M src/array.js View 1 9 chunks +9 lines, -9 lines 0 comments Download
M src/builtins.h View 1 chunk +2 lines, -0 lines 0 comments Download
M src/execution.h View 1 2 3 4 1 chunk +6 lines, -1 line 0 comments Download
M src/execution.cc View 1 2 3 4 6 chunks +54 lines, -10 lines 0 comments Download
M src/factory.h View 1 chunk +3 lines, -2 lines 0 comments Download
M src/factory.cc View 1 chunk +11 lines, -2 lines 0 comments Download
M src/heap.h View 1 chunk +13 lines, -5 lines 0 comments Download
M src/heap.cc View 3 chunks +59 lines, -9 lines 0 comments Download
M src/hydrogen.cc View 1 chunk +3 lines, -1 line 0 comments Download
M src/ia32/builtins-ia32.cc View 1 2 3 8 chunks +67 lines, -22 lines 0 comments Download
M src/ia32/code-stubs-ia32.cc View 3 chunks +20 lines, -3 lines 0 comments Download
M src/json.js View 1 3 chunks +4 lines, -4 lines 0 comments Download
M src/macros.py View 1 2 1 chunk +10 lines, -2 lines 0 comments Download
M src/messages.js View 1 chunk +1 line, -0 lines 0 comments Download
M src/objects.h View 1 2 3 6 chunks +39 lines, -8 lines 0 comments Download
M src/objects.cc View 5 chunks +17 lines, -3 lines 0 comments Download
M src/objects-debug.cc View 2 chunks +12 lines, -0 lines 0 comments Download
M src/objects-inl.h View 1 chunk +10 lines, -1 line 0 comments Download
M src/objects-printer.cc View 2 chunks +16 lines, -0 lines 0 comments Download
M src/objects-visiting.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M src/proxy.js View 1 2 3 3 chunks +21 lines, -30 lines 0 comments Download
M src/runtime.h View 1 2 3 2 chunks +5 lines, -0 lines 0 comments Download
M src/runtime.cc View 1 2 3 5 chunks +78 lines, -0 lines 0 comments Download
M src/runtime.js View 1 2 3 6 chunks +33 lines, -13 lines 0 comments Download
M src/string.js View 1 2 chunks +2 lines, -2 lines 0 comments Download
M src/v8natives.js View 1 2 3 12 chunks +32 lines, -14 lines 0 comments Download
M src/x64/builtins-x64.cc View 1 2 3 7 chunks +59 lines, -18 lines 0 comments Download
M src/x64/code-stubs-x64.cc View 3 chunks +20 lines, -3 lines 0 comments Download
M test/mjsunit/fuzz-natives.js View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M test/mjsunit/harmony/proxies.js View 1 2 3 21 chunks +233 lines, -34 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
rossberg
9 years, 4 months ago (2011-08-11 12:41:51 UTC) #1
rossberg
I uploaded a patch that introduces a new IS_SPEC_FUNCTION predicate instead of hacking IS_FUNCTION (which ...
9 years, 3 months ago (2011-08-31 15:27:12 UTC) #2
Kevin Millikin (Chromium)
Whew. OK, the only issue is Function.prototype.apply in the JS builtins. I think you'll need ...
9 years, 3 months ago (2011-09-08 17:30:40 UTC) #3
rossberg
OK, I introduced an %Apply native function to handle it. For that, I also had ...
9 years, 3 months ago (2011-09-09 17:05:30 UTC) #4
Kevin Millikin (Chromium)
LGTM. http://codereview.chromium.org/7623011/diff/12001/src/execution.cc File src/execution.cc (right): http://codereview.chromium.org/7623011/diff/12001/src/execution.cc#newcode165 src/execution.cc:165: // Is there a way to get the ...
9 years, 3 months ago (2011-09-12 14:42:47 UTC) #5
rossberg
9 years, 3 months ago (2011-09-12 15:17:25 UTC) #6
http://codereview.chromium.org/7623011/diff/12001/src/execution.cc
File src/execution.cc (right):

http://codereview.chromium.org/7623011/diff/12001/src/execution.cc#newcode165
src/execution.cc:165: // Is there a way to get the proper global object if func
is a builtin?
On 2011/09/12 14:42:47, Kevin Millikin wrote:
> I guess I'm not sure what is proper.  isolate()->global_context()->builtins()
is
> the builtins object, isolate()->global_object()->global_receiver() is the
global
> receiver of the current context.

Ah, thanks, the latter is what I was looking for, but somehow missed. Because
func->context()->global()->g_r() gives me the JSBuiltin object if func happens
to be a builtin, which would not be good (and breaks one of the tests).

Now, the only thing that still puzzles me is how that very logic is used in the
generated FunctionApply builtin without causing the same issue...

http://codereview.chromium.org/7623011/diff/12001/src/execution.h
File src/execution.h (right):

http://codereview.chromium.org/7623011/diff/12001/src/execution.h#newcode58
src/execution.h:58: // and object.
On 2011/09/12 14:42:47, Kevin Millikin wrote:
> "and object" ==> "an object"

Done.

Powered by Google App Engine
This is Rietveld 408576698