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

Issue 137663005: MIPS: This is a preview of a first step towards unification of the hydrogen call machinery. (Closed)

Created:
6 years, 11 months ago by palfia
Modified:
6 years, 11 months ago
CC:
v8-dev
Visibility:
Public.

Description

MIPS: This is a preview of a first step towards unification of the hydrogen call machinery. Port r18626 (d3368a4c) Original commit message: 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=plind44@gmail.com Committed: https://code.google.com/p/v8/source/detail?r=18630

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+198 lines, -197 lines) Patch
M src/mips/builtins-mips.cc View 5 chunks +6 lines, -8 lines 0 comments Download
M src/mips/code-stubs-mips.cc View 4 chunks +54 lines, -4 lines 0 comments Download
M src/mips/lithium-codegen-mips.cc View 3 chunks +31 lines, -33 lines 0 comments Download
M src/mips/lithium-mips.h View 6 chunks +63 lines, -67 lines 0 comments Download
M src/mips/lithium-mips.cc View 6 chunks +44 lines, -52 lines 0 comments Download
M src/mips/macro-assembler-mips.h View 1 chunk +0 lines, -6 lines 0 comments Download
M src/mips/macro-assembler-mips.cc View 1 chunk +0 lines, -27 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
palfia
PTAL.
6 years, 11 months ago (2014-01-15 22:45:44 UTC) #1
Paul Lind
LGTM, with a nit: MacroAssembler::InvokePrologue() should have the comment about register a3 register state removed, ...
6 years, 11 months ago (2014-01-15 23:31:48 UTC) #2
palfia
Committed patchset #1 manually as r18630 (presubmit successful).
6 years, 11 months ago (2014-01-15 23:38:02 UTC) #3
palfia
6 years, 11 months ago (2014-01-15 23:51:23 UTC) #4
Message was sent while issue was closed.
On 2014/01/15 23:31:48, Paul Lind wrote:
> LGTM, with a nit: MacroAssembler::InvokePrologue() should have the comment
about
> register a3 register state removed, as it is in arm port. For mips this is at
> line 3594. just fix it in submit, no need for 2nd patch set.

Thanks! I overlooked it somehow..

Powered by Google App Engine
This is Rietveld 408576698