Ignore:
Timestamp:
Apr 11, 2012, 5:55:44 PM (13 years ago)
Author:
[email protected]
Message:

op_is_foo should be optimized
https://bugs.webkit.org/show_bug.cgi?id=83666

Reviewed by Gavin Barraclough.

This implements inlining of op_is_undefined, op_is_string, op_is_number,
and op_is_boolean in LLInt and the baseline JIT. op_is_object and
op_is_function are not inlined because they are quite a bit more complex.

This also implements all of the op_is_foo opcodes in the DFG, but it does
not do any type profiling based optimizations, yet.

  • assembler/MacroAssemblerARMv7.h:

(JSC::MacroAssemblerARMv7::compare8):
(MacroAssemblerARMv7):

  • assembler/MacroAssemblerX86Common.h:

(JSC::MacroAssemblerX86Common::compare8):
(MacroAssemblerX86Common):

  • assembler/MacroAssemblerX86_64.h:

(MacroAssemblerX86_64):
(JSC::MacroAssemblerX86_64::testPtr):

  • dfg/DFGAbstractState.cpp:

(JSC::DFG::AbstractState::execute):

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::parseBlock):

  • dfg/DFGCCallHelpers.h:

(JSC::DFG::CCallHelpers::setupArguments):
(CCallHelpers):

  • dfg/DFGCSEPhase.cpp:

(JSC::DFG::CSEPhase::performNodeCSE):

  • dfg/DFGCapabilities.h:

(JSC::DFG::canCompileOpcode):

  • dfg/DFGNodeType.h:

(DFG):

  • dfg/DFGOperations.cpp:
  • dfg/DFGOperations.h:
  • dfg/DFGPredictionPropagationPhase.cpp:

(JSC::DFG::PredictionPropagationPhase::propagate):

  • dfg/DFGSpeculativeJIT.h:

(JSC::DFG::SpeculativeJIT::callOperation):
(JSC::DFG::SpeculativeJIT::appendCallSetResult):

  • dfg/DFGSpeculativeJIT32_64.cpp:

(JSC::DFG::SpeculativeJIT::compile):

  • dfg/DFGSpeculativeJIT64.cpp:

(JSC::DFG::SpeculativeJIT::compile):

  • jit/JIT.cpp:

(JSC::JIT::privateCompileMainPass):

  • jit/JIT.h:

(JIT):

  • jit/JITOpcodes.cpp:

(JSC::JIT::emit_op_is_undefined):
(JSC):
(JSC::JIT::emit_op_is_boolean):
(JSC::JIT::emit_op_is_number):
(JSC::JIT::emit_op_is_string):

  • jit/JITOpcodes32_64.cpp:

(JSC::JIT::emit_op_is_undefined):
(JSC):
(JSC::JIT::emit_op_is_boolean):
(JSC::JIT::emit_op_is_number):
(JSC::JIT::emit_op_is_string):

  • jit/JITStubs.cpp:

(JSC):

  • llint/LLIntSlowPaths.cpp:

(LLInt):

  • llint/LLIntSlowPaths.h:

(LLInt):

  • llint/LowLevelInterpreter.asm:
  • llint/LowLevelInterpreter32_64.asm:
  • llint/LowLevelInterpreter64.asm:
  • offlineasm/armv7.rb:
  • offlineasm/instructions.rb:
  • offlineasm/x86.rb:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp

    r111739 r113930  
    701701    LLINT_BEGIN();
    702702    LLINT_RETURN(jsTypeStringForValue(exec, LLINT_OP_C(2).jsValue()));
    703 }
    704 
    705 LLINT_SLOW_PATH_DECL(slow_path_is_undefined)
    706 {
    707     LLINT_BEGIN();
    708     JSValue v = LLINT_OP_C(2).jsValue();
    709     LLINT_RETURN(jsBoolean(v.isCell() ? v.asCell()->structure()->typeInfo().masqueradesAsUndefined() : v.isUndefined()));
    710 }
    711 
    712 LLINT_SLOW_PATH_DECL(slow_path_is_boolean)
    713 {
    714     LLINT_BEGIN();
    715     LLINT_RETURN(jsBoolean(LLINT_OP_C(2).jsValue().isBoolean()));
    716 }
    717 
    718 LLINT_SLOW_PATH_DECL(slow_path_is_number)
    719 {
    720     LLINT_BEGIN();
    721     LLINT_RETURN(jsBoolean(LLINT_OP_C(2).jsValue().isNumber()));
    722 }
    723 
    724 LLINT_SLOW_PATH_DECL(slow_path_is_string)
    725 {
    726     LLINT_BEGIN();
    727     LLINT_RETURN(jsBoolean(isJSString(LLINT_OP_C(2).jsValue())));
    728703}
    729704
Note: See TracChangeset for help on using the changeset viewer.