Changeset 49409 in webkit for trunk/JavaScriptCore/wtf/Platform.h


Ignore:
Timestamp:
Oct 9, 2009, 5:30:49 PM (16 years ago)
Author:
[email protected]
Message:

Eliminated some legacy bytecode weirdness.

Patch by Geoffrey Garen <[email protected]> on 2009-10-09
Reviewed by Oliver Hunt.

Use vPC[x] subscripting instead of ++vPC to access instruction operands.
This is simpler, and often more efficient.

To support this, and to remove use of hard-coded offsets in bytecode and
JIT code generation and dumping, calculate jump offsets from the beginning
of an instruction, rather than the middle or end.

Also, use OPCODE_LENGTH instead of hard-coded constants for the sizes of
opcodes.

SunSpider reports no change in JIT mode, and a 1.01x speedup in Interpreter
mode.

  • bytecode/CodeBlock.cpp:

(JSC::printConditionalJump):
(JSC::CodeBlock::dump):

  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::emitJump):
(JSC::BytecodeGenerator::emitJumpIfTrue):
(JSC::BytecodeGenerator::emitJumpIfFalse):
(JSC::BytecodeGenerator::emitJumpIfNotFunctionCall):
(JSC::BytecodeGenerator::emitJumpIfNotFunctionApply):
(JSC::BytecodeGenerator::emitComplexJumpScopes):
(JSC::BytecodeGenerator::emitJumpScopes):
(JSC::BytecodeGenerator::emitNextPropertyName):
(JSC::BytecodeGenerator::emitCatch):
(JSC::BytecodeGenerator::emitJumpSubroutine):
(JSC::prepareJumpTableForImmediateSwitch):
(JSC::prepareJumpTableForCharacterSwitch):
(JSC::prepareJumpTableForStringSwitch):
(JSC::BytecodeGenerator::endSwitch):

  • bytecompiler/Label.h:

(JSC::Label::setLocation):
(JSC::Label::bind):

  • interpreter/Interpreter.cpp:

(JSC::Interpreter::resolve):
(JSC::Interpreter::resolveSkip):
(JSC::Interpreter::resolveGlobal):
(JSC::Interpreter::resolveBase):
(JSC::Interpreter::resolveBaseAndProperty):
(JSC::Interpreter::createExceptionScope):
(JSC::Interpreter::privateExecute):

  • interpreter/Interpreter.h:
  • jit/JIT.cpp:

(JSC::JIT::privateCompile):

  • jit/JITArithmetic.cpp:

(JSC::JIT::emit_op_jnless):
(JSC::JIT::emitSlow_op_jnless):
(JSC::JIT::emit_op_jnlesseq):
(JSC::JIT::emitSlow_op_jnlesseq):
(JSC::JIT::emitBinaryDoubleOp):

  • jit/JITOpcodes.cpp:

(JSC::JIT::emit_op_jmp):
(JSC::JIT::emit_op_loop):
(JSC::JIT::emit_op_loop_if_less):
(JSC::JIT::emitSlow_op_loop_if_less):
(JSC::JIT::emit_op_loop_if_lesseq):
(JSC::JIT::emitSlow_op_loop_if_lesseq):
(JSC::JIT::emit_op_loop_if_true):
(JSC::JIT::emitSlow_op_loop_if_true):
(JSC::JIT::emit_op_jfalse):
(JSC::JIT::emitSlow_op_jfalse):
(JSC::JIT::emit_op_jtrue):
(JSC::JIT::emitSlow_op_jtrue):
(JSC::JIT::emit_op_jeq_null):
(JSC::JIT::emit_op_jneq_null):
(JSC::JIT::emit_op_jneq_ptr):
(JSC::JIT::emit_op_jsr):
(JSC::JIT::emit_op_next_pname):
(JSC::JIT::emit_op_jmp_scopes):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/Platform.h

    r48954 r49409  
    716716#endif
    717717
    718 #if !defined(ENABLE_JIT)
    719 
    720 /* The JIT is tested & working on x86_64 Mac */
    721 #if PLATFORM(X86_64) && PLATFORM(MAC)
    722     #define ENABLE_JIT 1
    723 /* The JIT is tested & working on x86 Mac */
    724 #elif PLATFORM(X86) && PLATFORM(MAC)
    725     #define ENABLE_JIT 1
    726     #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 1
    727 #elif PLATFORM(ARM_THUMB2) && PLATFORM(IPHONE)
    728     /* Under development, temporarily disabled until 16Mb link range limit in assembler is fixed. */
    729     #define ENABLE_JIT 0
    730     #define ENABLE_JIT_OPTIMIZE_NATIVE_CALL 0
    731 /* The JIT is tested & working on x86 Windows */
    732 #elif PLATFORM(X86) && PLATFORM(WIN)
    733     #define ENABLE_JIT 1
    734 #endif
    735 
    736 #if PLATFORM(QT)
    737 #if PLATFORM(X86) && PLATFORM(WIN_OS) && COMPILER(MINGW) && GCC_VERSION >= 40100
    738     #define ENABLE_JIT 1
    739     #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 1
    740 #elif PLATFORM(X86) && PLATFORM(WIN_OS) && COMPILER(MSVC)
    741     #define ENABLE_JIT 1
    742     #define WTF_USE_JIT_STUB_ARGUMENT_REGISTER 1
    743 #elif PLATFORM(X86) && PLATFORM(LINUX) && GCC_VERSION >= 40100
    744     #define ENABLE_JIT 1
    745     #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 1
    746 #elif PLATFORM(ARM_TRADITIONAL) && PLATFORM(LINUX)
    747     #define ENABLE_JIT 1
    748     #if PLATFORM(ARM_THUMB2)
    749         #define ENABLE_JIT_OPTIMIZE_NATIVE_CALL 0
    750     #endif
    751 #endif
    752 #endif /* PLATFORM(QT) */
    753 
    754 #endif /* !defined(ENABLE_JIT) */
    755 
    756718#if ENABLE(JIT)
    757719#ifndef ENABLE_JIT_OPTIMIZE_CALL
Note: See TracChangeset for help on using the changeset viewer.