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

Issue 104663004: Preview of a first step towards unification of hydrogen calls (Closed)

Created:
7 years ago by Jarin
Modified:
6 years, 11 months ago
Reviewers:
danno, Toon Verwaest
CC:
v8-dev
Visibility:
Public.

Description

This is a preview of a first step towards unification of the hydrogen call machinery. The change replaces CallNamed, CallKeyed, CallConstantFunction and CallKnownGlobal hydrogen instructions with two new instructions with a more lower level semantics: 1. CallJSFunction for direct calls of JSFunction objects (no argument adaptation) 2. CallWithDescriptor for calls of a given Code object according to the supplied calling convention. Details: CallJSFunction should be straightforward, the main difference from the existing InvokeFunction instruction is the absence of argument adaptor handling. (As a next step, we will replace InvokeFunction with an equivalent hydrogen code.) For CallWithDescriptor, the calling conventions are represented by a tweaked version of CallStubInterfaceDescriptor. In addition to the parameter-register mapping, we also define parameter-representation mapping there. The CallWithDescriptor instruction has variable number of parameters now - this required some simple tweaks in Lithium, which assumed fixed number of arguments in some places. The calling conventions used in the calls are initialized in the CallDescriptors class (code-stubs.h, <arch>/code-stubs-<arch>.cc), and they live in a new table in the Isolate class. I should say I am not quite sure about Representation::Integer32() representation for some of the params of ArgumentAdaptorCall - it is not clear to me wether the params could not end up on the stack and thus confuse the GC. The change also includes an earlier small change to argument adaptor (https://codereview.chromium.org/98463007) that avoids passing a naked pointer to the code entry as a parameter. I am sorry for packaging that with an already biggish change. Performance implications: Locally, I see a small regression (.2% or so). It is hard to say where exactly it comes from, but I do see inefficient call sequences to the adaptor trampoline. For example: ;;; <@78,#24> constant-t bf85aa515a mov edi,0x5a51aa85 ;; debug: position 29 ;;; <@72,#53> load-named-field 8b7717 mov esi,[edi+0x17] ;; debug: position 195 ;;; <@80,#51> constant-s b902000000 mov ecx,0x2 ;; debug: position 195 ;;; <@81,#51> gap 894df0 mov [ebp+0xf0],ecx ;;; <@82,#103> constant-i bb01000000 mov ebx,0x1 ;;; <@84,#102> constant-i b902000000 mov ecx,0x2 ;;; <@85,#102> gap 89d8 mov eax,ebx 89cb mov ebx,ecx 8b4df0 mov ecx,[ebp+0xf0] ;;; <@86,#58> call-with-descriptor e8ef57fcff call ArgumentsAdaptorTrampoline (0x2d80e6e0) ;; code: BUILTIN Note the silly handling of ecx; the hydrogen for this code is: 0 4 s27 Constant 1 range:1_1 <|@ 0 3 t30 Constant 0x5bc1aa85 <JS Function xyz (SharedFunctionInfo 0x5bc1a919)> type:object <|@ 0 1 t36 LoadNamedField t30.[in-object]@24 <|@ 0 1 t38 Constant 0x2300e6a1 <Code> <|@ 0 1 i102 Constant 2 range:2_2 <|@ 0 1 i103 Constant 1 range:1_1 <|@ 0 2 t41 CallWithDescriptor t38 t30 t36 s27 i103 i102 #2 changes[*] <|@ BUG= R=verwaest@chromium.org, danno@chromium.org Committed: https://code.google.com/p/v8/source/detail?r=18626

Patch Set 1 #

Total comments: 25

Patch Set 2 : Rebase #

Patch Set 3 : Addressing review comments #

Patch Set 4 : ARM storage mode fix #

Total comments: 3

Patch Set 5 : Addressed code review comments #

Total comments: 18

Patch Set 6 : Addressed review comments #

Patch Set 7 : Merge fix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1002 lines, -755 lines) Patch
M src/arm/builtins-arm.cc View 1 2 3 4 5 5 chunks +6 lines, -8 lines 0 comments Download
M src/arm/code-stubs-arm.h View 1 2 3 1 chunk +12 lines, -0 lines 0 comments Download
M src/arm/code-stubs-arm.cc View 1 2 3 4 5 4 chunks +63 lines, -4 lines 0 comments Download
M src/arm/lithium-arm.h View 1 2 3 4 5 6 chunks +63 lines, -67 lines 0 comments Download
M src/arm/lithium-arm.cc View 1 2 3 4 5 6 chunks +44 lines, -52 lines 0 comments Download
M src/arm/lithium-codegen-arm.cc View 1 2 3 4 5 3 chunks +34 lines, -32 lines 0 comments Download
M src/arm/macro-assembler-arm.h View 1 2 3 4 5 1 chunk +0 lines, -6 lines 0 comments Download
M src/arm/macro-assembler-arm.cc View 1 2 3 4 5 2 chunks +0 lines, -28 lines 0 comments Download
M src/code-stubs.h View 1 2 3 4 5 3 chunks +42 lines, -1 line 0 comments Download
M src/hydrogen.h View 1 2 3 4 5 6 2 chunks +16 lines, -0 lines 0 comments Download
M src/hydrogen.cc View 1 2 3 4 5 12 chunks +109 lines, -22 lines 0 comments Download
M src/hydrogen-instructions.h View 1 2 3 4 5 3 chunks +134 lines, -114 lines 0 comments Download
M src/hydrogen-instructions.cc View 1 2 3 4 5 2 chunks +37 lines, -17 lines 0 comments Download
M src/ia32/builtins-ia32.cc View 1 2 3 4 5 2 chunks +3 lines, -4 lines 0 comments Download
M src/ia32/code-stubs-ia32.cc View 1 2 3 4 5 1 chunk +50 lines, -0 lines 0 comments Download
M src/ia32/lithium-codegen-ia32.cc View 1 2 3 4 5 3 chunks +47 lines, -39 lines 0 comments Download
M src/ia32/lithium-ia32.h View 1 2 3 4 5 6 chunks +62 lines, -68 lines 0 comments Download
M src/ia32/lithium-ia32.cc View 1 2 3 4 5 6 chunks +44 lines, -53 lines 0 comments Download
M src/ia32/macro-assembler-ia32.h View 1 2 3 4 5 1 chunk +0 lines, -7 lines 0 comments Download
M src/ia32/macro-assembler-ia32.cc View 1 2 3 4 5 1 chunk +0 lines, -28 lines 0 comments Download
M src/isolate.h View 1 2 3 3 chunks +11 lines, -0 lines 0 comments Download
M src/isolate.cc View 1 2 3 4 5 5 chunks +15 lines, -0 lines 0 comments Download
M src/x64/builtins-x64.cc View 1 2 3 4 5 3 chunks +3 lines, -4 lines 0 comments Download
M src/x64/code-stubs-x64.cc View 1 2 3 4 5 1 chunk +50 lines, -0 lines 0 comments Download
M src/x64/lithium-codegen-x64.cc View 1 2 3 4 5 3 chunks +51 lines, -39 lines 0 comments Download
M src/x64/lithium-x64.h View 1 2 3 4 5 6 chunks +62 lines, -67 lines 0 comments Download
M src/x64/lithium-x64.cc View 1 2 3 4 5 6 chunks +44 lines, -53 lines 0 comments Download
M src/x64/macro-assembler-x64.h View 1 2 3 4 5 1 chunk +0 lines, -7 lines 0 comments Download
M src/x64/macro-assembler-x64.cc View 1 2 3 4 5 1 chunk +0 lines, -35 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
Jarin
7 years ago (2013-12-09 15:59:14 UTC) #1
Toon Verwaest
Looking good, mostly syntax nits. https://codereview.chromium.org/104663004/diff/1/src/code-stubs.cc File src/code-stubs.cc (left): https://codereview.chromium.org/104663004/diff/1/src/code-stubs.cc#oldcode770 src/code-stubs.cc:770: Spurious line removal. https://codereview.chromium.org/104663004/diff/1/src/compiler.cc ...
7 years ago (2013-12-18 16:11:40 UTC) #2
Jarin
Addressed Toon's comments; however, the change list is not ready for check-in yet: I have ...
6 years, 11 months ago (2013-12-30 15:15:46 UTC) #3
Toon Verwaest
Some more nits. https://codereview.chromium.org/104663004/diff/70001/src/arm/code-stubs-arm.cc File src/arm/code-stubs-arm.cc (right): https://codereview.chromium.org/104663004/diff/70001/src/arm/code-stubs-arm.cc#newcode354 src/arm/code-stubs-arm.cc:354: static PlatformCallInterfaceDescriptor defaultDescriptor = Only use ...
6 years, 11 months ago (2014-01-03 07:14:06 UTC) #4
Jarin
Thanks for the comments, all of them should be addressed now.
6 years, 11 months ago (2014-01-03 10:14:07 UTC) #5
Toon Verwaest
Lgtm. Mostly more nits, and one comment about code in hydrogen.cc that can be shared. ...
6 years, 11 months ago (2014-01-14 15:33:49 UTC) #6
Jarin
Thanks, done all the things except the reuse of NewCallKeyed/Named, where it does not seem ...
6 years, 11 months ago (2014-01-14 19:08:08 UTC) #7
Toon Verwaest
OK, no problem. Lgtm
6 years, 11 months ago (2014-01-14 21:35:44 UTC) #8
Jarin
6 years, 11 months ago (2014-01-15 17:00:57 UTC) #9
Message was sent while issue was closed.
Committed patchset #7 manually as r18626 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698