Bug 122617 - transition void cti_op_* methods to JIT operations.
Summary: transition void cti_op_* methods to JIT operations.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Michael Saboff
URL:
Keywords:
Depends on:
Blocks: 122287
  Show dependency treegraph
 
Reported: 2013-10-10 13:09 PDT by Michael Saboff
Modified: 2013-10-15 11:32 PDT (History)
1 user (show)

See Also:


Attachments
Patch (77.54 KB, patch)
2013-10-14 18:00 PDT, Michael Saboff
no flags Details | Formatted Diff | Diff
With fixes Mark suggested (77.55 KB, patch)
2013-10-15 08:53 PDT, Michael Saboff
ggaren: review-
Details | Formatted Diff | Diff
Updated patch. Rebased and with fix. (77.60 KB, patch)
2013-10-15 11:05 PDT, Michael Saboff
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Saboff 2013-10-10 13:09:22 PDT
Transition these stubs to operations
    cti_handle_watchdog_timer
    cti_op_debug
    cti_op_pop_scope
    cti_op_profile_did_call
    cti_op_profile_will_call
    cti_op_put_by_index
    cti_op_put_getter_setter
    cti_op_tear_off_activation
    cti_op_tear_off_arguments
    cti_op_throw_static_error
    cti_optimize
Comment 1 Michael Saboff 2013-10-11 08:58:22 PDT
I'll also transition cgi_op_push_name_scope and cti_push_with_scope.
Comment 2 Michael Saboff 2013-10-14 18:00:23 PDT
Created attachment 214213 [details]
Patch
Comment 3 Mark Lam 2013-10-14 19:18:33 PDT
Comment on attachment 214213 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=214213&action=review

> Source/JavaScriptCore/jit/JITOpcodes.cpp:262
> -    stubCall.addArgument(unmodifiedArgumentsRegister(VirtualRegister(arguments)).offset(), regT2);
> -    stubCall.addArgument(activation, regT2);
> -    stubCall.call();
> +    emitGetVirtualRegister(arguments, regT0);

The code for unmodifiedArgumentsRegister says:
    inline VirtualRegister unmodifiedArgumentsRegister(VirtualRegister argumentsRegister) { return VirtualRegister(argumentsRegister.offset() + 1); }

Is it appropriate to replace "stubCall.addArgument(unmodifiedArgumentsRegister(VirtualRegister(arguments)).offset(), regT2);" with "emitGetVirtualRegister(arguments, regT0);"?

> Source/JavaScriptCore/jit/JITOperations.h:239
> -size_t JIT_OPERATION operationCompareLess(ExecState*, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2) WTF_INTERNAL;
> -size_t JIT_OPERATION operationCompareLessEq(ExecState*, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2) WTF_INTERNAL;
> -size_t JIT_OPERATION operationCompareGreater(ExecState*, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2) WTF_INTERNAL;
> -size_t JIT_OPERATION operationCompareGreaterEq(ExecState*, EncodedJSValue encodedOp1, EncodedJSValue encodedOp2) WTF_INTERNAL;
> +size_t JIT_OPERATION operationCompareLess(ExecState*, EncodedJSValue, EncodedJSValue encodedOp2) WTF_INTERNAL;
> +size_t JIT_OPERATION operationCompareLessEq(ExecState*, EncodedJSValue, EncodedJSValue encodedOp2) WTF_INTERNAL;
> +size_t JIT_OPERATION operationCompareGreater(ExecState*, EncodedJSValue, EncodedJSValue encodedOp2) WTF_INTERNAL;
> +size_t JIT_OPERATION operationCompareGreaterEq(ExecState*, EncodedJSValue, EncodedJSValue encodedOp2) WTF_INTERNAL;

Did you also intend to remove the encodedOp2 as well?
Comment 4 Michael Saboff 2013-10-15 08:53:11 PDT
Created attachment 214265 [details]
With fixes Mark suggested
Comment 5 Geoffrey Garen 2013-10-15 09:21:44 PDT
Comment on attachment 214265 [details]
With fixes Mark suggested

View in context: https://bugs.webkit.org/attachment.cgi?id=214265&action=review

> Source/JavaScriptCore/jit/CCallHelpers.h:1096
> +        poke(arg4, POKE_ARGUMENT_OFFSET);

Will this poke be valid when we're running on the C stack? Will each stack frame reserve space for these pokes?

> Source/JavaScriptCore/jit/JITOpcodes32_64.cpp:1185
> +    callOperation(operationProfileWillCall, regT1, regT0);

Wrong function = broken profiler. Did the profiler tests pass for this patch?
Comment 6 Michael Saboff 2013-10-15 11:05:50 PDT
Created attachment 214280 [details]
Updated patch.  Rebased and with fix.

(In reply to comment #5)
> (From update of attachment 214265 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=214265&action=review
> 
> > Source/JavaScriptCore/jit/CCallHelpers.h:1096
> > +        poke(arg4, POKE_ARGUMENT_OFFSET);
> 
> Will this poke be valid when we're running on the C stack? Will each stack frame reserve space for these pokes?

This poke is valid way to pass additional arguments.  When we move JSC over to the C stack, we'll need to make sure there is space for calling out to C including any calls made by the immediate callee.  My thinking is that we make sure there is stack space for C calls beyond which JSC can use for stack frames.
 
> > Source/JavaScriptCore/jit/JITOpcodes32_64.cpp:1185
> > +    callOperation(operationProfileWillCall, regT1, regT0);
> 
> Wrong function = broken profiler. Did the profiler tests pass for this patch?

I made the change and ran the layout tests including the profiler tests with a 32 bit build.
Comment 7 Geoffrey Garen 2013-10-15 11:25:31 PDT
Comment on attachment 214280 [details]
Updated patch.  Rebased and with fix.

r=me
Comment 8 Michael Saboff 2013-10-15 11:32:15 PDT
Committed r157457: <http://trac.webkit.org/changeset/157457>