Changeset 167094 in webkit
- Timestamp:
- Apr 10, 2014, 3:33:59 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 40 edited
-
JavaScriptCore/CMakeLists.txt (modified) (2 diffs)
-
JavaScriptCore/ChangeLog (modified) (1 diff)
-
JavaScriptCore/JavaScriptCore.vcxproj/LLInt/LLIntAssembly/build-LLIntAssembly.sh (modified) (1 diff)
-
JavaScriptCore/JavaScriptCore.vcxproj/LLInt/LLIntDesiredOffsets/build-LLIntDesiredOffsets.sh (modified) (1 diff)
-
JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (modified) (8 diffs)
-
JavaScriptCore/assembler/MacroAssemblerCodeRef.h (modified) (2 diffs)
-
JavaScriptCore/bytecode/BytecodeList.json (modified) (3 diffs)
-
JavaScriptCore/bytecode/CodeBlock.cpp (modified) (2 diffs)
-
JavaScriptCore/bytecode/GetByIdStatus.cpp (modified) (1 diff)
-
JavaScriptCore/bytecode/Opcode.h (modified) (1 diff)
-
JavaScriptCore/bytecode/PutByIdStatus.cpp (modified) (2 diffs)
-
JavaScriptCore/generate-bytecode-files (modified) (1 diff)
-
JavaScriptCore/jit/JIT.cpp (modified) (1 diff)
-
JavaScriptCore/jit/JITStubs.h (modified) (1 diff)
-
JavaScriptCore/llint/LLIntCLoop.cpp (modified) (1 diff)
-
JavaScriptCore/llint/LLIntData.cpp (modified) (1 diff)
-
JavaScriptCore/llint/LLIntData.h (modified) (3 diffs)
-
JavaScriptCore/llint/LLIntOpcode.h (modified) (1 diff)
-
JavaScriptCore/llint/LLIntSlowPaths.cpp (modified) (5 diffs)
-
JavaScriptCore/llint/LLIntThunks.cpp (modified) (1 diff)
-
JavaScriptCore/llint/LLIntThunks.h (modified) (1 diff)
-
JavaScriptCore/llint/LowLevelInterpreter.asm (modified) (5 diffs)
-
JavaScriptCore/llint/LowLevelInterpreter.cpp (modified) (2 diffs)
-
JavaScriptCore/llint/LowLevelInterpreter.h (modified) (1 diff)
-
JavaScriptCore/offlineasm/arm.rb (modified) (2 diffs)
-
JavaScriptCore/offlineasm/arm64.rb (modified) (1 diff)
-
JavaScriptCore/offlineasm/asm.rb (modified) (3 diffs)
-
JavaScriptCore/offlineasm/ast.rb (modified) (19 diffs)
-
JavaScriptCore/offlineasm/backends.rb (modified) (3 diffs)
-
JavaScriptCore/offlineasm/cloop.rb (modified) (1 diff)
-
JavaScriptCore/offlineasm/generate_offset_extractor.rb (modified) (1 diff)
-
JavaScriptCore/offlineasm/instructions.rb (modified) (1 diff)
-
JavaScriptCore/offlineasm/parser.rb (modified) (8 diffs)
-
JavaScriptCore/offlineasm/registers.rb (modified) (1 diff)
-
JavaScriptCore/offlineasm/self_hash.rb (modified) (1 diff)
-
JavaScriptCore/offlineasm/settings.rb (modified) (2 diffs)
-
JavaScriptCore/offlineasm/transform.rb (modified) (1 diff)
-
JavaScriptCore/offlineasm/x86.rb (modified) (4 diffs)
-
WebKit/ChangeLog (modified) (1 diff)
-
WebKit/WebKit.vcxproj/WebKit.sln (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/CMakeLists.txt
r167020 r167094 605 605 OUTPUT ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h 606 606 MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/offlineasm/generate_offset_extractor.rb 607 DEPENDS ${LLINT_ASM} ${OFFLINE_ASM} 608 COMMAND ${RUBY_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/offlineasm/generate_offset_extractor.rb ${JAVASCRIPTCORE_DIR}/llint/LowLevelInterpreter.asm ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h607 DEPENDS ${LLINT_ASM} ${OFFLINE_ASM} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InitBytecodes.asm 608 COMMAND ${RUBY_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/offlineasm/generate_offset_extractor.rb -I${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/ ${JAVASCRIPTCORE_DIR}/llint/LowLevelInterpreter.asm ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntDesiredOffsets.h 609 609 VERBATIM) 610 610 … … 634 634 MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/offlineasm/asm.rb 635 635 DEPENDS LLIntOffsetsExtractor ${LLINT_ASM} ${OFFLINE_ASM} ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InitBytecodes.asm 636 COMMAND ${RUBY_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/offlineasm/asm.rb ${JAVASCRIPTCORE_DIR}/llint/LowLevelInterpreter.asm $<TARGET_FILE:LLIntOffsetsExtractor> ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntAssembly.h636 COMMAND ${RUBY_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/offlineasm/asm.rb -I${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/ ${JAVASCRIPTCORE_DIR}/llint/LowLevelInterpreter.asm $<TARGET_FILE:LLIntOffsetsExtractor> ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntAssembly.h 637 637 COMMAND ${CMAKE_COMMAND} -E touch_nocreate ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/LLIntAssembly.h 638 638 VERBATIM) -
trunk/Source/JavaScriptCore/ChangeLog
r167087 r167094 1 2014-04-10 Michael Saboff <msaboff@apple.com> 2 3 LLInt interpreter code should be generated as part of one function 4 https://bugs.webkit.org/show_bug.cgi?id=131205 5 6 Reviewed by Mark Lam. 7 8 Changed the generation of llint opcodes so that they are all part of the same 9 global function, llint_entry. That function is used to fill in an entry point 10 table that includes each of the opcodes and helpers. 11 12 * CMakeLists.txt: 13 * JavaScriptCore.vcxproj/LLInt/LLIntAssembly/build-LLIntAssembly.sh: 14 * JavaScriptCore.vcxproj/LLInt/LLIntDesiredOffsets/build-LLIntDesiredOffsets.sh: 15 * JavaScriptCore.xcodeproj/project.pbxproj: 16 Added appropriate use of new -I option to offline assembler and offset 17 generator scripts. 18 19 * llint/LowLevelInterpreter.asm: 20 * llint/LowLevelInterpreter.cpp: 21 * llint/LowLevelInterpreter.h: 22 * offlineasm/arm.rb: 23 * offlineasm/arm64.rb: 24 * offlineasm/asm.rb: 25 * offlineasm/ast.rb: 26 * offlineasm/backends.rb: 27 * offlineasm/cloop.rb: 28 * offlineasm/generate_offset_extractor.rb: 29 * offlineasm/instructions.rb: 30 * offlineasm/parser.rb: 31 * offlineasm/registers.rb: 32 * offlineasm/self_hash.rb: 33 * offlineasm/settings.rb: 34 * offlineasm/transform.rb: 35 * offlineasm/x86.rb: 36 Added a new "global" keyword to the offline assembler that denotes a label that 37 should be exported. Added opcode and operand support to get the absolute 38 address of a local label using position independent calculations. Updated the 39 offline assembler to handle included files, both when generating the checksum 40 as well as including files from other than the local directory via a newly 41 added -I option. The offline assembler now automatically determines external 42 functions by keeping track of referenced functions that are defined within the 43 assembly source. This is used both for choosing the correct macro for external 44 references as well as generating the needed EXTERN directives for masm. 45 Updated the generation of the masm only .sym file to be written once at the end 46 of the offline assembler. 47 48 * assembler/MacroAssemblerCodeRef.h: 49 (JSC::MacroAssemblerCodePtr::createLLIntCodePtr): 50 (JSC::MacroAssemblerCodeRef::createLLIntCodeRef): 51 * bytecode/CodeBlock.cpp: 52 (JSC::CodeBlock::dumpBytecode): 53 (JSC::CodeBlock::CodeBlock): 54 * bytecode/GetByIdStatus.cpp: 55 (JSC::GetByIdStatus::computeFromLLInt): 56 * bytecode/Opcode.h: 57 (JSC::padOpcodeName): 58 * bytecode/PutByIdStatus.cpp: 59 (JSC::PutByIdStatus::computeFromLLInt): 60 * jit/JIT.cpp: 61 (JSC::JIT::privateCompileMainPass): 62 * jit/JITStubs.h: 63 * llint/LLIntCLoop.cpp: 64 (JSC::LLInt::initialize): 65 * llint/LLIntData.h: 66 (JSC::LLInt::getCodeFunctionPtr): 67 (JSC::LLInt::getOpcode): Deleted. 68 (JSC::LLInt::getCodePtr): Deleted. 69 * llint/LLIntOpcode.h: 70 * llint/LLIntSlowPaths.cpp: 71 (JSC::LLInt::LLINT_SLOW_PATH_DECL): 72 * llint/LLIntThunks.cpp: 73 (JSC::LLInt::functionForCallEntryThunkGenerator): 74 (JSC::LLInt::functionForConstructEntryThunkGenerator): 75 (JSC::LLInt::functionForCallArityCheckThunkGenerator): 76 (JSC::LLInt::functionForConstructArityCheckThunkGenerator): 77 (JSC::LLInt::evalEntryThunkGenerator): 78 (JSC::LLInt::programEntryThunkGenerator): 79 * llint/LLIntThunks.h: 80 Changed references to llint helpers to go through the entry point table populated 81 by llint_entry. Added helpers to OpcodeID enum for all builds. 82 83 * bytecode/BytecodeList.json: 84 * generate-bytecode-files: 85 * llint/LLIntCLoop.cpp: 86 (JSC::LLInt::CLoop::initialize): 87 Reordered sections to match the order that the functions are added to the entry point 88 table. Added new "asmPrefix" property for symbols that have one name but are generated 89 with a prefix, e.g. op_enter -> llint_op_enter. Eliminated the "emitDefineID" property 90 as we are using enums for all bytecode references. Changed the C Loop only 91 llint_c_loop_init to llint_entry. 92 1 93 2014-04-10 Matthew Mirman <mmirman@apple.com> 2 94 -
trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/LLInt/LLIntAssembly/build-LLIntAssembly.sh
r165296 r167094 35 35 fi 36 36 37 /usr/bin/env ruby "${SRCROOT}/offlineasm/asm.rb" " ${SRCROOT}/llint/LowLevelInterpreter.asm" "${BUILT_PRODUCTS_DIR}/LLIntOffsetsExtractor/LLIntOffsetsExtractor${3}.exe" "${OUTPUTFILENAME}" || exit 137 /usr/bin/env ruby "${SRCROOT}/offlineasm/asm.rb" "-I." "${SRCROOT}/llint/LowLevelInterpreter.asm" "${BUILT_PRODUCTS_DIR}/LLIntOffsetsExtractor/LLIntOffsetsExtractor${3}.exe" "${OUTPUTFILENAME}" || exit 1 -
trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/LLInt/LLIntDesiredOffsets/build-LLIntDesiredOffsets.sh
r154513 r167094 23 23 mkdir -p "${BUILT_PRODUCTS_DIR}" 24 24 25 /usr/bin/env ruby "${SRCROOT}/offlineasm/generate_offset_extractor.rb" " ${SRCROOT}/llint/LowLevelInterpreter.asm" "${BUILT_PRODUCTS_DIR}/LLIntDesiredOffsets.h"25 /usr/bin/env ruby "${SRCROOT}/offlineasm/generate_offset_extractor.rb" "-I${BUILT_PRODUCTS_DIR}" "${SRCROOT}/llint/LowLevelInterpreter.asm" "${BUILT_PRODUCTS_DIR}/LLIntDesiredOffsets.h" -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r167087 r167094 14 14 0F4680AA14BA7FD900BFE272 /* Generate Derived Sources */, 15 15 ); 16 dependencies = ( 17 65442D5018EBB744007AF92F /* PBXTargetDependency */, 18 ); 16 19 name = "LLInt Offsets"; 17 20 productName = "Derived Sources"; … … 37 40 ); 38 41 dependencies = ( 42 65244BD318ECB5000010B708 /* PBXTargetDependency */, 39 43 65788A9E18B409EB00C189FF /* PBXTargetDependency */, 40 44 ); … … 50 54 ); 51 55 dependencies = ( 52 65788AA918B40A3300C189FF /* PBXTargetDependency */,53 56 ); 54 57 name = "Derived Sources"; … … 1832 1835 remoteInfo = "Test Tools"; 1833 1836 }; 1837 65244BD218ECB5000010B708 /* PBXContainerItemProxy */ = { 1838 isa = PBXContainerItemProxy; 1839 containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; 1840 proxyType = 1; 1841 remoteGlobalIDString = 65FB3F6609D11E9100F49DEB; 1842 remoteInfo = "Derived Sources"; 1843 }; 1844 65442D4F18EBB744007AF92F /* PBXContainerItemProxy */ = { 1845 isa = PBXContainerItemProxy; 1846 containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; 1847 proxyType = 1; 1848 remoteGlobalIDString = 65FB3F6609D11E9100F49DEB; 1849 remoteInfo = "Derived Sources"; 1850 }; 1834 1851 65788A9F18B409EB00C189FF /* PBXContainerItemProxy */ = { 1835 1852 isa = PBXContainerItemProxy; … … 1838 1855 remoteGlobalIDString = 0FF922C314F46B130041A24E; 1839 1856 remoteInfo = JSCLLIntOffsetsExtractor; 1840 };1841 65788AA818B40A3300C189FF /* PBXContainerItemProxy */ = {1842 isa = PBXContainerItemProxy;1843 containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;1844 proxyType = 1;1845 remoteGlobalIDString = 0F4680A914BA7FD900BFE272;1846 remoteInfo = "LLInt Offsets";1847 1857 }; 1848 1858 65788AAA18B40A3B00C189FF /* PBXContainerItemProxy */ = { … … 6528 6538 runOnlyForDeploymentPostprocessing = 0; 6529 6539 shellPath = /bin/sh; 6530 shellScript = "set -e\n\nmkdir -p \"${BUILT_PRODUCTS_DIR}/LLIntOffsets/\"\n\n/usr/bin/env ruby \"${SRCROOT}/offlineasm/generate_offset_extractor.rb\" \" ${SRCROOT}/llint/LowLevelInterpreter.asm\" \"${BUILT_PRODUCTS_DIR}/LLIntOffsets/LLIntDesiredOffsets.h\"\n";6540 shellScript = "set -e\n\nmkdir -p \"${BUILT_PRODUCTS_DIR}/LLIntOffsets/\"\n\n/usr/bin/env ruby \"${SRCROOT}/offlineasm/generate_offset_extractor.rb\" \"-I${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore\" \"${SRCROOT}/llint/LowLevelInterpreter.asm\" \"${BUILT_PRODUCTS_DIR}/LLIntOffsets/LLIntDesiredOffsets.h\"\n"; 6531 6541 }; 6532 6542 0FCEFAD91806191800472CE4 /* Copy LLVM Library Into Framework */ = { … … 6716 6726 runOnlyForDeploymentPostprocessing = 0; 6717 6727 shellPath = /bin/sh; 6718 shellScript = "if [[ \"${ACTION}\" == \"installhdrs\" ]]; then\n exit 0\nfi\n\ncd \"${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore\"\n\n/usr/bin/env ruby JavaScriptCore/offlineasm/asm.rb JavaScriptCore/llint/LowLevelInterpreter.asm ${BUILT_PRODUCTS_DIR}/JSCLLIntOffsetsExtractor LLIntAssembly.h || exit 1";6728 shellScript = "if [[ \"${ACTION}\" == \"installhdrs\" ]]; then\n exit 0\nfi\n\ncd \"${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore\"\n\n/usr/bin/env ruby JavaScriptCore/offlineasm/asm.rb -I${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore JavaScriptCore/llint/LowLevelInterpreter.asm ${BUILT_PRODUCTS_DIR}/JSCLLIntOffsetsExtractor LLIntAssembly.h || exit 1"; 6719 6729 }; 6720 6730 65FB3F6509D11E9100F49DEB /* Generate Derived Sources */ = { … … 7429 7439 targetProxy = 5D6B2A56152B9E2E005231DE /* PBXContainerItemProxy */; 7430 7440 }; 7441 65244BD318ECB5000010B708 /* PBXTargetDependency */ = { 7442 isa = PBXTargetDependency; 7443 target = 65FB3F6609D11E9100F49DEB /* Derived Sources */; 7444 targetProxy = 65244BD218ECB5000010B708 /* PBXContainerItemProxy */; 7445 }; 7446 65442D5018EBB744007AF92F /* PBXTargetDependency */ = { 7447 isa = PBXTargetDependency; 7448 target = 65FB3F6609D11E9100F49DEB /* Derived Sources */; 7449 targetProxy = 65442D4F18EBB744007AF92F /* PBXContainerItemProxy */; 7450 }; 7431 7451 65788A9E18B409EB00C189FF /* PBXTargetDependency */ = { 7432 7452 isa = PBXTargetDependency; 7433 7453 target = 0FF922C314F46B130041A24E /* JSCLLIntOffsetsExtractor */; 7434 7454 targetProxy = 65788A9F18B409EB00C189FF /* PBXContainerItemProxy */; 7435 };7436 65788AA918B40A3300C189FF /* PBXTargetDependency */ = {7437 isa = PBXTargetDependency;7438 target = 0F4680A914BA7FD900BFE272 /* LLInt Offsets */;7439 targetProxy = 65788AA818B40A3300C189FF /* PBXContainerItemProxy */;7440 7455 }; 7441 7456 65788AAB18B40A3B00C189FF /* PBXTargetDependency */ = { -
trunk/Source/JavaScriptCore/assembler/MacroAssemblerCodeRef.h
r163027 r167094 295 295 296 296 #if ENABLE(LLINT) 297 static MacroAssemblerCodePtr createLLIntCodePtr( LLIntCodecodeId)297 static MacroAssemblerCodePtr createLLIntCodePtr(OpcodeID codeId) 298 298 { 299 299 return createFromExecutableAddress(LLInt::getCodePtr(codeId)); … … 413 413 #if ENABLE(LLINT) 414 414 // Helper for creating self-managed code refs from LLInt. 415 static MacroAssemblerCodeRef createLLIntCodeRef( LLIntCodecodeId)415 static MacroAssemblerCodeRef createLLIntCodeRef(OpcodeID codeId) 416 416 { 417 417 return createSelfManagedCodeRef(MacroAssemblerCodePtr::createFromExecutableAddress(LLInt::getCodePtr(codeId))); -
trunk/Source/JavaScriptCore/bytecode/BytecodeList.json
r166418 r167094 1 1 [ 2 2 { 3 "section" : "Bytecodes", "emitInHFile" : true, "emitInASMFile" : true, "macroNameComponent" : "BYTECODE", 3 "section" : "Bytecodes", "emitInHFile" : true, "emitInASMFile" : true, 4 "macroNameComponent" : "BYTECODE", "asmPrefix" : "llint_", 4 5 "bytecodes" : [ 5 6 { "name" : "op_enter", "length" : 1 }, … … 126 127 }, 127 128 { 129 "section" : "CLoopHelpers", "emitInHFile" : true, "emitInASMFile" : false, "defaultLength" : 1, 130 "macroNameComponent" : "CLOOP_BYTECODE_HELPER", 131 "bytecodes" : [ 132 { "name" : "llint_entry" }, 133 { "name" : "getHostCallReturnValue" }, 134 { "name" : "llint_return_to_host" }, 135 { "name" : "llint_call_to_javascript" }, 136 { "name" : "llint_call_to_native_function" }, 137 { "name" : "llint_cloop_did_return_from_js_1" }, 138 { "name" : "llint_cloop_did_return_from_js_2" }, 139 { "name" : "llint_cloop_did_return_from_js_3" }, 140 { "name" : "llint_cloop_did_return_from_js_4" }, 141 { "name" : "llint_cloop_did_return_from_js_5" }, 142 { "name" : "llint_cloop_did_return_from_js_6" }, 143 { "name" : "llint_cloop_did_return_from_js_7" }, 144 { "name" : "llint_cloop_did_return_from_js_8" } 145 ] 146 }, 147 { 128 148 "section" : "NativeHelpers", "emitInHFile" : true, "emitInASMFile" : true, "defaultLength" : 1, 129 "macroNameComponent" : "BYTECODE_HELPER", "emitDefineID" : true,149 "macroNameComponent" : "BYTECODE_HELPER", 130 150 "bytecodes" : [ 131 151 { "name" : "llint_program_prologue" }, … … 139 159 { "name" : "llint_throw_during_call_trampoline" }, 140 160 { "name" : "llint_native_call_trampoline" }, 141 { "name" : "llint_native_construct_trampoline" } 142 ] 143 }, 144 { 145 "section" : "CLoopHelpers", "emitInHFile" : true, "emitInASMFile" : false, "defaultLength" : 1, 146 "macroNameComponent" : "CLOOP_BYTECODE_HELPER", 147 "bytecodes" : [ 148 { "name" : "llint_c_loop_init" }, 149 { "name" : "getHostCallReturnValue" }, 150 { "name" : "llint_return_to_host" }, 151 { "name" : "llint_call_to_javascript" }, 152 { "name" : "llint_call_to_native_function" }, 153 { "name" : "handleUncaughtException" }, 154 { "name" : "llint_cloop_did_return_from_js_1" }, 155 { "name" : "llint_cloop_did_return_from_js_2" }, 156 { "name" : "llint_cloop_did_return_from_js_3" }, 157 { "name" : "llint_cloop_did_return_from_js_4" }, 158 { "name" : "llint_cloop_did_return_from_js_5" }, 159 { "name" : "llint_cloop_did_return_from_js_6" }, 160 { "name" : "llint_cloop_did_return_from_js_7" }, 161 { "name" : "llint_cloop_did_return_from_js_8" } 161 { "name" : "llint_native_construct_trampoline" }, 162 { "name" : "handleUncaughtException" } 162 163 ] 163 164 } -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
r166678 r167094 1369 1369 break; 1370 1370 } 1371 #if ENABLE(LLINT_C_LOOP)1372 1371 default: 1373 1372 RELEASE_ASSERT_NOT_REACHED(); 1374 #endif1375 1373 } 1376 1374 … … 1588 1586 m_rareData->m_exceptionHandlers[i].scopeDepth = nonLocalScopeDepth + handler.scopeDepth; 1589 1587 #if ENABLE(JIT) && ENABLE(LLINT) 1590 m_rareData->m_exceptionHandlers[i].nativeCode = CodeLocationLabel(MacroAssemblerCodePtr::createFromExecutableAddress(LLInt::getCodePtr( llint_op_catch)));1588 m_rareData->m_exceptionHandlers[i].nativeCode = CodeLocationLabel(MacroAssemblerCodePtr::createFromExecutableAddress(LLInt::getCodePtr(op_catch))); 1591 1589 #endif 1592 1590 } -
trunk/Source/JavaScriptCore/bytecode/GetByIdStatus.cpp
r165459 r167094 65 65 Instruction* instruction = profiledBlock->instructions().begin() + bytecodeIndex; 66 66 67 if (instruction[0].u.opcode == LLInt::getOpcode( llint_op_get_array_length))67 if (instruction[0].u.opcode == LLInt::getOpcode(op_get_array_length)) 68 68 return GetByIdStatus(NoInformation, false); 69 69 -
trunk/Source/JavaScriptCore/bytecode/Opcode.h
r165676 r167094 61 61 const int maxOpcodeLength = 9; 62 62 #if ENABLE(LLINT_C_LOOP) 63 const int numOpcodeIDs = NUMBER_OF_BYTECODE_IDS + NUMBER_OF_ BYTECODE_HELPER_IDS + NUMBER_OF_CLOOP_BYTECODE_HELPER_IDS;63 const int numOpcodeIDs = NUMBER_OF_BYTECODE_IDS + NUMBER_OF_CLOOP_BYTECODE_HELPER_IDS + NUMBER_OF_BYTECODE_HELPER_IDS; 64 64 #else 65 const int numOpcodeIDs = NUMBER_OF_BYTECODE_IDS ;65 const int numOpcodeIDs = NUMBER_OF_BYTECODE_IDS + NUMBER_OF_BYTECODE_HELPER_IDS; 66 66 #endif 67 67 -
trunk/Source/JavaScriptCore/bytecode/PutByIdStatus.cpp
r166945 r167094 71 71 return PutByIdStatus(NoInformation); 72 72 73 if (instruction[0].u.opcode == LLInt::getOpcode( llint_op_put_by_id)74 || instruction[0].u.opcode == LLInt::getOpcode( llint_op_put_by_id_out_of_line)) {73 if (instruction[0].u.opcode == LLInt::getOpcode(op_put_by_id) 74 || instruction[0].u.opcode == LLInt::getOpcode(op_put_by_id_out_of_line)) { 75 75 PropertyOffset offset = structure->getConcurrently(*profiledBlock->vm(), uid); 76 76 if (!isValidOffset(offset)) … … 82 82 ASSERT(structure->transitionWatchpointSetHasBeenInvalidated()); 83 83 84 ASSERT(instruction[0].u.opcode == LLInt::getOpcode( llint_op_put_by_id_transition_direct)85 || instruction[0].u.opcode == LLInt::getOpcode(llint_op_put_by_id_transition_normal)86 || instruction[0].u.opcode == LLInt::getOpcode(llint_op_put_by_id_transition_direct_out_of_line)87 || instruction[0].u.opcode == LLInt::getOpcode(llint_op_put_by_id_transition_normal_out_of_line));84 ASSERT(instruction[0].u.opcode == LLInt::getOpcode(op_put_by_id_transition_direct) 85 || instruction[0].u.opcode == LLInt::getOpcode(op_put_by_id_transition_normal) 86 || instruction[0].u.opcode == LLInt::getOpcode(op_put_by_id_transition_direct_out_of_line) 87 || instruction[0].u.opcode == LLInt::getOpcode(op_put_by_id_transition_normal_out_of_line)); 88 88 89 89 Structure* newStructure = instruction[6].u.structure.get(); -
trunk/Source/JavaScriptCore/generate-bytecode-files
r164814 r167094 213 213 bytecodeHFile.write("#define NUMBER_OF_{0}_IDS {1}\n\n".format(section["macroNameComponent"], bytecodeNum)) 214 214 215 if "emitDefineID" in section:216 bytecodeNum = 0217 for bytecode in section["bytecodes"]:218 bytecodeHFile.write("#define %s_ID %s\n" % (bytecode["name"].upper(), bytecodeNum))219 bytecodeNum = bytecodeNum + 1220 221 bytecodeHFile.write("\n\n")222 223 215 if initASMFileName and section['emitInASMFile']: 216 prefix = "" 217 if "asmPrefix" in section: 218 prefix = section["asmPrefix"] 224 219 for bytecode in section["bytecodes"]: 225 initBytecodesFile.write("setEntryAddress({0}, _{1} )\n".format(initASMBytecodeNum, bytecode["name"]))220 initBytecodesFile.write("setEntryAddress({0}, _{1}{2})\n".format(initASMBytecodeNum, prefix, bytecode["name"])) 226 221 initASMBytecodeNum = initASMBytecodeNum + 1 227 222 -
trunk/Source/JavaScriptCore/jit/JIT.cpp
r166392 r167094 293 293 DEFINE_OP(op_get_from_scope) 294 294 DEFINE_OP(op_put_to_scope) 295 default: 296 RELEASE_ASSERT_NOT_REACHED(); 295 297 } 296 298 } -
trunk/Source/JavaScriptCore/jit/JITStubs.h
r165676 r167094 44 44 EncodedJSValue callToJavaScript(void*, VM*, ProtoCallFrame*); 45 45 EncodedJSValue callToNativeFunction(void*, VM*, ProtoCallFrame*); 46 void handleUncaughtException();47 46 } 48 47 #endif -
trunk/Source/JavaScriptCore/llint/LLIntCLoop.cpp
r164814 r167094 36 36 void CLoop::initialize() 37 37 { 38 execute(llint_ c_loop_init, 0, 0, 0, true);38 execute(llint_entry, 0, 0, 0, true); 39 39 } 40 40 -
trunk/Source/JavaScriptCore/llint/LLIntData.cpp
r164814 r167094 41 41 42 42 Instruction* Data::s_exceptionInstructions = 0; 43 Opcode* Data::s_opcodeMap = 0; 43 Opcode Data::s_opcodeMap[numOpcodeIDs] = {0}; 44 45 #if !ENABLE(LLINT_C_LOOP) 46 extern "C" void llint_entry(void*); 47 #endif 44 48 45 49 void initialize() 46 50 { 47 51 Data::s_exceptionInstructions = new Instruction[maxOpcodeLength + 1]; 48 Data::s_opcodeMap = new Opcode[numOpcodeIDs];49 52 50 #if ENABLE(LLINT_C_LOOP)53 #if ENABLE(LLINT_C_LOOP) 51 54 CLoop::initialize(); 52 55 53 #else // !ENABLE(LLINT_C_LOOP) 56 #else // !ENABLE(LLINT_C_LOOP) 57 llint_entry(&Data::s_opcodeMap); 58 54 59 for (int i = 0; i < maxOpcodeLength + 1; ++i) 55 60 Data::s_exceptionInstructions[i].u.pointer = 56 61 LLInt::getCodePtr(llint_throw_from_slow_path_trampoline); 57 #define OPCODE_ENTRY(opcode, length) \ 58 Data::s_opcodeMap[opcode] = static_cast<Opcode>(LLInt::getCodePtr(llint_##opcode)); 59 FOR_EACH_CORE_OPCODE_ID(OPCODE_ENTRY); 60 #undef OPCODE_ENTRY 61 #endif // !ENABLE(LLINT_C_LOOP) 62 #endif // !ENABLE(LLINT_C_LOOP) 62 63 } 63 64 -
trunk/Source/JavaScriptCore/llint/LLIntData.h
r164424 r167094 51 51 private: 52 52 static Instruction* s_exceptionInstructions; 53 static Opcode * s_opcodeMap;53 static Opcode s_opcodeMap[numOpcodeIDs]; 54 54 55 55 friend void initialize(); … … 87 87 } 88 88 89 #if ENABLE(JIT) 90 ALWAYS_INLINE LLIntCode getCodeFunctionPtr(OpcodeID codeId) 91 { 92 return reinterpret_cast<LLIntCode>(getCodePtr(codeId)); 93 } 94 #endif 95 89 96 #else // !ENABLE(LLINT) 90 97 … … 105 112 #endif // !ENABLE(LLINT) 106 113 107 ALWAYS_INLINE void* getOpcode(void llintOpcode())108 {109 return bitwise_cast<void*>(llintOpcode);110 }111 112 ALWAYS_INLINE void* getCodePtr(void glueHelper())113 {114 return bitwise_cast<void*>(glueHelper);115 }116 117 114 ALWAYS_INLINE void* getCodePtr(JSC::EncodedJSValue glueHelper()) 118 115 { -
trunk/Source/JavaScriptCore/llint/LLIntOpcode.h
r164814 r167094 49 49 50 50 51 #if ENABLE(LLINT_C_LOOP)52 51 #define FOR_EACH_LLINT_OPCODE_EXTENSION(macro) FOR_EACH_LLINT_NATIVE_HELPER(macro) 53 #else54 #define FOR_EACH_LLINT_OPCODE_EXTENSION(macro) // Nothing to add.55 #endif56 52 57 53 #else // !ENABLE(LLINT) -
trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
r166392 r167094 589 589 vm, codeBlock->ownerExecutable(), structure); 590 590 if (isInlineOffset(slot.cachedOffset())) { 591 pc[0].u.opcode = LLInt::getOpcode( llint_op_get_by_id);591 pc[0].u.opcode = LLInt::getOpcode(op_get_by_id); 592 592 pc[5].u.operand = offsetInInlineStorage(slot.cachedOffset()) * sizeof(JSValue) + JSObject::offsetOfInlineStorage(); 593 593 } else { 594 pc[0].u.opcode = LLInt::getOpcode( llint_op_get_by_id_out_of_line);594 pc[0].u.opcode = LLInt::getOpcode(op_get_by_id_out_of_line); 595 595 pc[5].u.operand = offsetInButterfly(slot.cachedOffset()) * sizeof(JSValue); 596 596 } … … 601 601 && isJSArray(baseValue) 602 602 && ident == exec->propertyNames().length) { 603 pc[0].u.opcode = LLInt::getOpcode( llint_op_get_array_length);603 pc[0].u.opcode = LLInt::getOpcode(op_get_array_length); 604 604 ArrayProfile* arrayProfile = codeBlock->getOrAddArrayProfile(pc - codeBlock->instructions().begin()); 605 605 arrayProfile->observeStructure(baseValue.asCell()->structure()); … … 654 654 // This is needed because some of the methods we call 655 655 // below may GC. 656 pc[0].u.opcode = LLInt::getOpcode( llint_op_put_by_id);656 pc[0].u.opcode = LLInt::getOpcode(op_put_by_id); 657 657 658 658 if (normalizePrototypeChain(exec, baseCell) != InvalidPrototypeChain) { … … 673 673 if (pc[8].u.operand) { 674 674 if (isInlineOffset(slot.cachedOffset())) 675 pc[0].u.opcode = LLInt::getOpcode( llint_op_put_by_id_transition_direct);675 pc[0].u.opcode = LLInt::getOpcode(op_put_by_id_transition_direct); 676 676 else 677 pc[0].u.opcode = LLInt::getOpcode( llint_op_put_by_id_transition_direct_out_of_line);677 pc[0].u.opcode = LLInt::getOpcode(op_put_by_id_transition_direct_out_of_line); 678 678 } else { 679 679 if (isInlineOffset(slot.cachedOffset())) 680 pc[0].u.opcode = LLInt::getOpcode( llint_op_put_by_id_transition_normal);680 pc[0].u.opcode = LLInt::getOpcode(op_put_by_id_transition_normal); 681 681 else 682 pc[0].u.opcode = LLInt::getOpcode( llint_op_put_by_id_transition_normal_out_of_line);682 pc[0].u.opcode = LLInt::getOpcode(op_put_by_id_transition_normal_out_of_line); 683 683 } 684 684 } … … 688 688 vm, codeBlock->ownerExecutable(), structure); 689 689 if (isInlineOffset(slot.cachedOffset())) { 690 pc[0].u.opcode = LLInt::getOpcode( llint_op_put_by_id);690 pc[0].u.opcode = LLInt::getOpcode(op_put_by_id); 691 691 pc[5].u.operand = offsetInInlineStorage(slot.cachedOffset()) * sizeof(JSValue) + JSObject::offsetOfInlineStorage(); 692 692 } else { 693 pc[0].u.opcode = LLInt::getOpcode( llint_op_put_by_id_out_of_line);693 pc[0].u.opcode = LLInt::getOpcode(op_put_by_id_out_of_line); 694 694 pc[5].u.operand = offsetInButterfly(slot.cachedOffset()) * sizeof(JSValue); 695 695 } -
trunk/Source/JavaScriptCore/llint/LLIntThunks.cpp
r164217 r167094 61 61 MacroAssemblerCodeRef functionForCallEntryThunkGenerator(VM* vm) 62 62 { 63 return generateThunkWithJumpTo(vm, llint_function_for_call_prologue, "function for call");63 return generateThunkWithJumpTo(vm, LLInt::getCodeFunctionPtr(llint_function_for_call_prologue), "function for call"); 64 64 } 65 65 66 66 MacroAssemblerCodeRef functionForConstructEntryThunkGenerator(VM* vm) 67 67 { 68 return generateThunkWithJumpTo(vm, llint_function_for_construct_prologue, "function for construct");68 return generateThunkWithJumpTo(vm, LLInt::getCodeFunctionPtr(llint_function_for_construct_prologue), "function for construct"); 69 69 } 70 70 71 71 MacroAssemblerCodeRef functionForCallArityCheckThunkGenerator(VM* vm) 72 72 { 73 return generateThunkWithJumpTo(vm, llint_function_for_call_arity_check, "function for call with arity check");73 return generateThunkWithJumpTo(vm, LLInt::getCodeFunctionPtr(llint_function_for_call_arity_check), "function for call with arity check"); 74 74 } 75 75 76 76 MacroAssemblerCodeRef functionForConstructArityCheckThunkGenerator(VM* vm) 77 77 { 78 return generateThunkWithJumpTo(vm, llint_function_for_construct_arity_check, "function for construct with arity check");78 return generateThunkWithJumpTo(vm, LLInt::getCodeFunctionPtr(llint_function_for_construct_arity_check), "function for construct with arity check"); 79 79 } 80 80 81 81 MacroAssemblerCodeRef evalEntryThunkGenerator(VM* vm) 82 82 { 83 return generateThunkWithJumpTo(vm, llint_eval_prologue, "eval");83 return generateThunkWithJumpTo(vm, LLInt::getCodeFunctionPtr(llint_eval_prologue), "eval"); 84 84 } 85 85 86 86 MacroAssemblerCodeRef programEntryThunkGenerator(VM* vm) 87 87 { 88 return generateThunkWithJumpTo(vm, llint_program_prologue, "program");88 return generateThunkWithJumpTo(vm, LLInt::getCodeFunctionPtr(llint_program_prologue), "program"); 89 89 } 90 90 -
trunk/Source/JavaScriptCore/llint/LLIntThunks.h
r164424 r167094 39 39 EncodedJSValue callToJavaScript(void*, VM*, ProtoCallFrame*); 40 40 EncodedJSValue callToNativeFunction(void*, VM*, ProtoCallFrame*); 41 #if ENABLE(JIT)42 void handleUncaughtException();43 #endif44 41 } 45 42 -
trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm
r167076 r167094 629 629 end 630 630 631 # Dummy entry point the C Loop uses to initialize.632 if C_LOOP633 _llint_c_loop_init:634 crash()635 end636 637 631 # stub to call into JavaScript or Native functions 638 632 # EncodedJSValue callToJavaScript(void* code, ExecState** vmTopCallFrame, ProtoCallFrame* protoFrame) … … 642 636 _llint_call_to_javascript: 643 637 else 638 global _callToJavaScript 644 639 _callToJavaScript: 645 640 end … … 650 645 _llint_call_to_native_function: 651 646 else 647 global _callToNativeFunction 652 648 _callToNativeFunction: 653 649 end … … 658 654 else 659 655 # void sanitizeStackForVMImpl(VM* vm) 656 global _sanitizeStackForVMImpl 660 657 _sanitizeStackForVMImpl: 661 658 if X86_64 … … 692 689 end 693 690 691 692 if C_LOOP 693 # Dummy entry point the C Loop uses to initialize. 694 _llint_entry: 695 crash() 696 else 697 macro initPCRelative(pcBase) 698 if X86_64 699 call _relativePCBase 700 _relativePCBase: 701 pop pcBase 702 elsif X86 or X86_WIN 703 call _relativePCBase 704 _relativePCBase: 705 pop pcBase 706 loadp 20[sp], t4 707 elsif ARM64 708 elsif ARMv7 709 _relativePCBase: 710 move pc, pcBase 711 subp 3, pcBase # Need to back up the PC and set the Thumb2 bit 712 elsif ARM or ARMv7_TRADITIONAL 713 _relativePCBase: 714 move pc, pcBase 715 subp 2, pcBase 716 elsif MIPS 717 crash() # Need to replace with any initialization steps needed to step up PC relative address calculation 718 elsif SH4 719 crash() # Need to replace with any initialization steps needed to step up PC relative address calculation 720 end 721 end 722 723 macro setEntryAddress(index, label) 724 if X86_64 725 leap (label - _relativePCBase)[t1], t0 726 move index, t2 727 storep t0, [t4, t2, 8] 728 elsif X86 or X86_WIN 729 leap (label - _relativePCBase)[t1], t0 730 move index, t2 731 storep t0, [t4, t2, 4] 732 elsif ARM64 733 pcrtoaddr label, t1 734 move index, t2 735 storep t1, [a0, t2, 8] 736 elsif ARM or ARMv7 or ARMv7_TRADITIONAL 737 move (label - _relativePCBase), t2 738 addp t2, t1, t2 739 move index, t3 740 storep t2, [a0, t3, 4] 741 elsif MIPS 742 crash() # Need to replace with code to turn label into and absolute address and save at index 743 elsif SH4 744 crash() # Need to replace with code to turn label into and absolute address and save at index 745 end 746 end 747 748 global _llint_entry 749 # Entry point for the llint to initialize. 750 _llint_entry: 751 functionPrologue() 752 pushCalleeSaves 753 initPCRelative(t1) 754 755 # Include generated bytecode initialization file. 756 include InitBytecodes 757 758 popCalleeSaves 759 functionEpilogue() 760 ret 761 end 694 762 695 763 _llint_program_prologue: -
trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.cpp
r165320 r167094 106 106 #define OFFLINE_ASM_OPCODE_LABEL(opcode) DEFINE_OPCODE(opcode) USE_LABEL(opcode); TRACE_OPCODE(opcode); 107 107 108 #define OFFLINE_ASM_GLOBAL_LABEL(label) OFFLINE_ASM_GLUE_LABEL(label) 109 108 110 #if ENABLE(COMPUTED_GOTO_OPCODES) 109 111 #define OFFLINE_ASM_GLUE_LABEL(label) label: USE_LABEL(label); … … 496 498 #define OFFLINE_ASM_END ); 497 499 498 #define OFFLINE_ASM_OPCODE_LABEL(__opcode) OFFLINE_ASM_ GLOBAL_LABEL(llint_##__opcode)499 #define OFFLINE_ASM_GLUE_LABEL(__opcode) OFFLINE_ASM_ GLOBAL_LABEL(__opcode)500 #define OFFLINE_ASM_OPCODE_LABEL(__opcode) OFFLINE_ASM_LOCAL_LABEL(llint_##__opcode) 501 #define OFFLINE_ASM_GLUE_LABEL(__opcode) OFFLINE_ASM_LOCAL_LABEL(__opcode) 500 502 501 503 #if CPU(ARM_THUMB2) -
trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.h
r164424 r167094 48 48 } // namespace JSC 49 49 50 #else // !ENABLE(LLINT_C_LOOP) 51 52 #define LLINT_INSTRUCTION_DECL(opcode, length) extern "C" void llint_##opcode(); 53 FOR_EACH_OPCODE_ID(LLINT_INSTRUCTION_DECL); 54 #undef LLINT_INSTRUCTION_DECL 55 56 #define DECLARE_LLINT_NATIVE_HELPER(name, length) extern "C" void name(); 57 FOR_EACH_LLINT_NATIVE_HELPER(DECLARE_LLINT_NATIVE_HELPER) 58 #undef DECLARE_LLINT_NATIVE_HELPER 59 60 #endif // !ENABLE(LLINT_C_LOOP) 50 #endif // ENABLE(LLINT_C_LOOP) 61 51 62 52 #endif // ENABLE(LLINT) -
trunk/Source/JavaScriptCore/offlineasm/arm.rb
r163881 r167094 70 70 def armMoveImmediate(value, register) 71 71 # Currently we only handle the simple cases, and fall back to mov/movt for the complex ones. 72 if value >= 0 && value < 256 72 if value.is_a? String 73 $asm.puts "mov #{register.armOperand}, (#{value})" 74 elsif value >= 0 && value < 256 73 75 $asm.puts "mov #{register.armOperand}, \##{value}" 74 76 elsif (~value) >= 0 && (~value) < 256 … … 107 109 when "sp" 108 110 "sp" 111 when "pc" 112 "pc" 109 113 else 110 114 raise "Bad register #{name} for ARM at #{codeOriginString}" -
trunk/Source/JavaScriptCore/offlineasm/arm64.rb
r166166 r167094 821 821 when "memfence" 822 822 $asm.puts "dmb sy" 823 when "pcrtoaddr" 824 $asm.puts "adr #{operands[1].arm64Operand(:ptr)}, #{operands[0].value}" 823 825 else 824 826 lowerDefault -
trunk/Source/JavaScriptCore/offlineasm/asm.rb
r164164 r167094 173 173 end 174 174 175 def putsLabel(labelName )175 def putsLabel(labelName, isGlobal) 176 176 raise unless @state == :asm 177 177 @numGlobalLabels += 1 178 putsProcEndIfNeeded if $emitWinAsm 178 putsProcEndIfNeeded if $emitWinAsm and isGlobal 179 179 putsNewlineSpacerIfAppropriate(:global) 180 180 @internalComment = $enableLabelCountComments ? "Global Label #{@numGlobalLabels}" : nil 181 if /\Allint_op_/.match(labelName) 181 if isGlobal 182 if !$emitWinAsm 183 @outp.puts(formatDump("OFFLINE_ASM_GLOBAL_LABEL(#{labelName})", lastComment)) 184 else 185 putsProc(labelName, lastComment) 186 end 187 elsif /\Allint_op_/.match(labelName) 182 188 if !$emitWinAsm 183 189 @outp.puts(formatDump("OFFLINE_ASM_OPCODE_LABEL(op_#{$~.post_match})", lastComment)) 184 190 else 185 191 label = "llint_" + "op_#{$~.post_match}" 186 putsProc(label, lastComment)187 end 192 @outp.puts(formatDump(" _#{label}:", lastComment)) 193 end 188 194 else 189 195 if !$emitWinAsm 190 196 @outp.puts(formatDump("OFFLINE_ASM_GLUE_LABEL(#{labelName})", lastComment)) 191 197 else 192 putsProc(labelName, lastComment)198 @outp.puts(formatDump(" _#{labelName}:", lastComment)) 193 199 end 194 200 end … … 207 213 end 208 214 end 209 215 216 def self.externLabelReference(labelName) 217 if !$emitWinAsm 218 "\" LOCAL_REFERENCE(#{labelName}) \"" 219 else 220 "#{labelName}" 221 end 222 end 223 210 224 def self.labelReference(labelName) 211 225 if !$emitWinAsm 212 "\" LOCAL_ REFERENCE(#{labelName}) \""213 else 214 " #{labelName}"226 "\" LOCAL_LABEL_STRING(#{labelName}) \"" 227 else 228 "_#{labelName}" 215 229 end 216 230 end … … 262 276 end 263 277 end 278 279 IncludeFile.processIncludeOptions() 264 280 265 281 asmFile = ARGV.shift -
trunk/Source/JavaScriptCore/offlineasm/ast.rb
r148474 r167094 230 230 end 231 231 232 def immediateOperand? 233 true 234 end 235 232 236 def register? 233 237 false … … 256 260 end 257 261 258 def address? 259 false 260 end 261 262 def label? 263 false 264 end 265 266 def immediate? 262 def value 263 "#{left.value} + #{right.value}" 264 end 265 266 def address? 267 false 268 end 269 270 def label? 271 false 272 end 273 274 def immediate? 275 true 276 end 277 278 def immediateOperand? 267 279 true 268 280 end … … 294 306 end 295 307 296 def address? 297 false 298 end 299 300 def label? 301 false 302 end 303 304 def immediate? 308 def value 309 "#{left.value} - #{right.value}" 310 end 311 312 def address? 313 false 314 end 315 316 def label? 317 false 318 end 319 320 def immediate? 321 true 322 end 323 324 def immediateOperand? 305 325 true 306 326 end … … 344 364 end 345 365 366 def immediateOperand? 367 false 368 end 369 346 370 def register? 347 371 false … … 381 405 end 382 406 407 def immediateOperand? 408 false 409 end 410 383 411 def register? 384 412 false … … 419 447 end 420 448 449 def immediateOperand? 450 false 451 end 452 421 453 def register? 422 454 false … … 457 489 end 458 490 491 def immediateOperand? 492 false 493 end 494 459 495 def register? 460 496 false … … 495 531 end 496 532 533 def immediateOperand? 534 false 535 end 536 497 537 def register? 498 538 false … … 530 570 def immediate? 531 571 true 572 end 573 574 def immediateOperand? 575 false 532 576 end 533 577 … … 608 652 end 609 653 654 def immediateOperand? 655 false 656 end 657 610 658 def register? 611 659 true … … 627 675 628 676 def immediate? 677 false 678 end 679 680 def immediateOperand? 629 681 false 630 682 end … … 698 750 def immediate? 699 751 false 752 end 753 754 def immediateOperand? 755 true 700 756 end 701 757 … … 760 816 end 761 817 818 def immediateOperand? 819 false 820 end 821 762 822 def register? 763 823 false … … 791 851 def immediate? 792 852 false 853 end 854 855 def immediateOperand? 856 true 793 857 end 794 858 … … 865 929 866 930 $labelMapping = {} 931 $referencedExternLabels = Array.new 867 932 868 933 class Label < NoChildren … … 872 937 super(codeOrigin) 873 938 @name = name 874 end 875 876 def self.forName(codeOrigin, name) 939 @extern = true 940 @global = false 941 end 942 943 def self.forName(codeOrigin, name, definedInFile = false) 877 944 if $labelMapping[name] 878 945 raise "Label name collision: #{name}" unless $labelMapping[name].is_a? Label … … 880 947 $labelMapping[name] = Label.new(codeOrigin, name) 881 948 end 949 if definedInFile 950 $labelMapping[name].clearExtern() 951 end 882 952 $labelMapping[name] 883 953 end 884 954 955 def self.setAsGlobal(codeOrigin, name) 956 if $labelMapping[name] 957 label = $labelMapping[name] 958 raise "Label: #{name} declared global multiple times" unless not label.global? 959 label.setGlobal() 960 else 961 newLabel = Label.new(codeOrigin, name) 962 newLabel.setGlobal() 963 $labelMapping[name] = newLabel 964 end 965 end 966 967 def self.resetReferenced 968 $referencedExternLabels = Array.new 969 end 970 971 def self.forReferencedExtern() 972 $referencedExternLabels.each { 973 | label | 974 yield "#{label.name}" 975 } 976 end 977 978 def clearExtern 979 @extern = false 980 end 981 982 def extern? 983 @extern 984 end 985 986 def setGlobal 987 @global = true 988 end 989 990 def global? 991 @global 992 end 993 885 994 def dump 886 995 "#{name}:" … … 950 1059 end 951 1060 1061 def extern? 1062 $labelMapping[name].is_a? Label and $labelMapping[name].extern? 1063 end 1064 1065 def used 1066 if !$referencedExternLabels.include?(@label) and extern? 1067 $referencedExternLabels.push(@label) 1068 end 1069 end 1070 952 1071 def dump 953 1072 label.name 954 1073 end 955 1074 956 def address? 957 false 958 end 959 960 def label? 961 true 962 end 963 964 def immediate? 965 false 1075 def value 1076 asmLabel() 1077 end 1078 1079 def address? 1080 false 1081 end 1082 1083 def label? 1084 true 1085 end 1086 1087 def immediate? 1088 false 1089 end 1090 1091 def immediateOperand? 1092 true 966 1093 end 967 1094 end … … 990 1117 label.name 991 1118 end 992 993 def address? 994 false 995 end 996 997 def label? 998 true 999 end 1000 1001 def immediate? 1002 false 1119 1120 def value 1121 asmLabel() 1122 end 1123 1124 def address? 1125 false 1126 end 1127 1128 def label? 1129 true 1130 end 1131 1132 def immediate? 1133 false 1134 end 1135 1136 def immediateOperand? 1137 true 1003 1138 end 1004 1139 end -
trunk/Source/JavaScriptCore/offlineasm/backends.rb
r164374 r167094 82 82 class Label 83 83 def lower(name) 84 $asm.putsLabel(self.name[1..-1] )84 $asm.putsLabel(self.name[1..-1], @global) 85 85 end 86 86 end … … 94 94 class LabelReference 95 95 def asmLabel 96 Assembler.labelReference(name[1..-1]) 96 if extern? 97 Assembler.externLabelReference(name[1..-1]) 98 else 99 Assembler.labelReference(name[1..-1]) 100 end 97 101 end 102 98 103 def cLabel 99 104 Assembler.cLabelReference(name[1..-1]) … … 105 110 Assembler.localLabelReference("_offlineasm_"+name[1..-1]) 106 111 end 112 107 113 def cLabel 108 114 Assembler.cLocalLabelReference("_offlineasm_"+name[1..-1]) -
trunk/Source/JavaScriptCore/offlineasm/cloop.rb
r165213 r167094 1125 1125 $asm.putc "opcode = #{operands[0].clValue(:opcode)};" 1126 1126 $asm.putc "DISPATCH_OPCODE();" 1127 $asm.putsLabel("llint_cloop_did_return_from_js_#{@@didReturnFromJSLabelCounter}" )1127 $asm.putsLabel("llint_cloop_did_return_from_js_#{@@didReturnFromJSLabelCounter}", false) 1128 1128 1129 1129 # We can't do generic function calls with an arbitrary set of args, but -
trunk/Source/JavaScriptCore/offlineasm/generate_offset_extractor.rb
r128015 r167094 34 34 require "settings" 35 35 require "transform" 36 37 IncludeFile.processIncludeOptions() 36 38 37 39 inputFlnm = ARGV.shift -
trunk/Source/JavaScriptCore/offlineasm/instructions.rb
r163351 r167094 267 267 ARM64_INSTRUCTIONS = 268 268 [ 269 "pcrtoaddr", # Address from PC relative offset - adr instruction 269 270 "popLRAndFP", # ARM64 requires registers to be pushed and popped in pairs, 270 271 "pushLRAndFP" # therefore we do LR (link register) and FP (frame pointer) together. -
trunk/Source/JavaScriptCore/offlineasm/parser.rb
r163351 r167094 39 39 def to_s 40 40 "#{fileName}:#{lineNumber}" 41 end 42 end 43 44 class IncludeFile 45 @@includeDirs = [] 46 47 attr_reader :fileName 48 49 def initialize(moduleName, defaultDir) 50 directory = nil 51 @@includeDirs.each { 52 | includePath | 53 fileName = includePath + (moduleName + ".asm") 54 directory = includePath unless not File.file?(fileName) 55 } 56 if not directory 57 directory = defaultDir 58 end 59 60 @fileName = directory + (moduleName + ".asm") 61 end 62 63 def self.processIncludeOptions() 64 while ARGV[0][/-I/] 65 path = ARGV.shift[2..-1] 66 if not path 67 path = ARGV.shift 68 end 69 @@includeDirs << (path + "/") 70 end 41 71 end 42 72 end … … 158 188 159 189 def isKeyword(token) 160 token =~ /\A((true)|(false)|(if)|(then)|(else)|(elsif)|(end)|(and)|(or)|(not)|( macro)|(const)|(sizeof)|(error)|(include))\Z/ or190 token =~ /\A((true)|(false)|(if)|(then)|(else)|(elsif)|(end)|(and)|(or)|(not)|(global)|(macro)|(const)|(sizeof)|(error)|(include))\Z/ or 161 191 token =~ REGISTER_PATTERN or 162 192 isInstruction(token) … … 381 411 codeOrigin, names = parseColonColon 382 412 Sizeof.forName(codeOrigin, names.join('::')) 413 elsif isLabel @tokens[@idx] 414 result = LabelReference.new(@tokens[@idx].codeOrigin, Label.forName(@tokens[@idx].codeOrigin, @tokens[@idx].string)) 415 @idx += 1 416 result 417 elsif isLocalLabel @tokens[@idx] 418 result = LocalLabelReference.new(@tokens[@idx].codeOrigin, LocalLabel.forName(@tokens[@idx].codeOrigin, @tokens[@idx].string)) 419 @idx += 1 420 result 383 421 else 384 422 parseError … … 574 612 @idx += 1 575 613 list << Macro.new(codeOrigin, name, variables, body) 614 elsif @tokens[@idx] == "global" 615 codeOrigin = @tokens[@idx].codeOrigin 616 @idx += 1 617 skipNewLine 618 parseError unless isLabel(@tokens[@idx]) 619 name = @tokens[@idx].string 620 @idx += 1 621 Label.setAsGlobal(codeOrigin, name) 576 622 elsif isInstruction @tokens[@idx] 577 623 codeOrigin = @tokens[@idx].codeOrigin … … 678 724 # It's a label. 679 725 if isLabel name 680 list << Label.forName(codeOrigin, name )726 list << Label.forName(codeOrigin, name, true) 681 727 else 682 728 list << LocalLabel.forName(codeOrigin, name) … … 687 733 parseError unless isIdentifier(@tokens[@idx]) 688 734 moduleName = @tokens[@idx].string 689 fileName = @tokens[@idx].codeOrigin.fileName.dirname + (moduleName + ".asm")735 fileName = IncludeFile.new(moduleName, @tokens[@idx].codeOrigin.fileName.dirname).fileName 690 736 @idx += 1 691 737 $stderr.puts "offlineasm: Including file #{fileName}" … … 696 742 } 697 743 Sequence.new(firstCodeOrigin, list) 744 end 745 746 def parseIncludes(final, comment) 747 firstCodeOrigin = @tokens[@idx].codeOrigin 748 fileList = [] 749 fileList << @tokens[@idx].codeOrigin.fileName 750 loop { 751 if (@idx == @tokens.length and not final) or (final and @tokens[@idx] =~ final) 752 break 753 elsif @tokens[@idx] == "include" 754 @idx += 1 755 parseError unless isIdentifier(@tokens[@idx]) 756 moduleName = @tokens[@idx].string 757 fileName = IncludeFile.new(moduleName, @tokens[@idx].codeOrigin.fileName.dirname).fileName 758 @idx += 1 759 760 fileList << fileName 761 else 762 @idx += 1 763 end 764 } 765 766 return fileList 698 767 end 699 768 end … … 709 778 710 779 def parseHash(fileName) 711 dirHash(Pathname.new(fileName).dirname, /\.asm$/) 712 end 713 780 parser = Parser.new(IO::read(fileName), fileName) 781 fileList = parser.parseIncludes(nil, "") 782 fileListHash(fileList) 783 end 784 -
trunk/Source/JavaScriptCore/offlineasm/registers.rb
r160100 r167094 45 45 "sp", 46 46 "lr", 47 47 "pc", 48 48 # 64-bit only registers: 49 49 "csr1", # tag type number register -
trunk/Source/JavaScriptCore/offlineasm/self_hash.rb
r122650 r167094 46 46 47 47 # 48 # fileListHash(fileList) -> SHA1 hexdigest 49 # 50 # Returns a hash of all files in the list. 51 # 52 53 def fileListHash(fileList) 54 contents = "" 55 fileList.each { 56 | fileName | 57 contents += IO::read(fileName) 58 } 59 return Digest::SHA1.hexdigest(contents) 60 end 61 62 # 48 63 # selfHash -> SHA1 hexdigest 49 64 # -
trunk/Source/JavaScriptCore/offlineasm/settings.rb
r164164 r167094 173 173 174 174 def emitCodeInConfiguration(concreteSettings, ast, backend) 175 Label.resetReferenced 176 175 177 if !$emitWinAsm 176 178 $output.puts cppSettingsTest(concreteSettings) … … 194 196 $output.puts "_TEXT ENDS" 195 197 $output.puts "END" 198 199 # Write symbols needed by MASM 200 File.open("#{File.basename($output.path)}.sym", "w") { 201 | outp | 202 Label.forReferencedExtern { 203 | name | 204 outp.puts "EXTERN #{name[1..-1]} : near" 205 } 206 } 196 207 end 197 208 end -
trunk/Source/JavaScriptCore/offlineasm/transform.rb
r157474 r167094 458 458 end 459 459 460 class SubImmediates 461 def validate 462 raise "Invalid operand #{left.dump} to immediate subtraction" unless left.immediateOperand? 463 raise "Invalid operand #{right.dump} to immediate subtraction" unless right.immediateOperand? 464 end 465 end 466 460 467 class Error 461 468 def validate -
trunk/Source/JavaScriptCore/offlineasm/x86.rb
r165205 r167094 464 464 465 465 class LocalLabelReference 466 def x86Operand(kind) 467 asmLabel 468 end 466 469 def x86CallOperand(kind) 467 470 asmLabel … … 512 515 class Instruction 513 516 @@floatingPointCompareImplicitOperand = isIntelSyntax ? "st(0), " : "" 514 @@exportedSymbols = Array.new515 517 516 518 def x86Operands(*kinds) … … 847 849 end 848 850 849 def writeSymbolToFile(symbol)850 raise unless isMSVC851 852 alreadyExported = @@exportedSymbols.include?(symbol)853 854 if !alreadyExported855 @@exportedSymbols.push(symbol)856 857 # Write symbols needed by MASM858 File.open("#{File.basename($output.path)}.sym", "a") {859 | outp |860 outp.puts "EXTERN #{symbol} : near"861 }862 end863 end864 865 851 def lowerX86Common 866 852 $asm.codeOrigin codeOriginString if $enableCodeOriginComments … … 1339 1325 end 1340 1326 op = operands[0].x86CallOperand(:ptr) 1341 if isMSVC && (operands[0].is_a? LabelReference)1342 writeSymbolToFile(op)1327 if operands[0].is_a? LabelReference 1328 operands[0].used 1343 1329 end 1344 1330 $asm.puts "call #{op}" -
trunk/Source/WebKit/ChangeLog
r167088 r167094 1 2014-04-10 Michael Saboff <msaboff@apple.com> 2 3 LLInt interpreter code should be generated as part of one function 4 https://bugs.webkit.org/show_bug.cgi?id=131205 5 6 Reviewed by Mark Lam. 7 8 Updated VS dependencies for JavaScriptCore changes. 9 10 * WebKit.vcxproj/WebKit.sln: 11 1 12 2014-04-10 Brent Fulgham <bfulgham@apple.com> 2 13 -
trunk/Source/WebKit/WebKit.vcxproj/WebKit.sln
r166764 r167094 69 69 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LLIntOffsetsExtractor", "..\..\JavaScriptCore\JavaScriptCore.vcxproj\LLInt\LLIntOffsetsExtractor\LLIntOffsetsExtractor.vcxproj", "{D595E3F6-24F2-4C60-935C-95D50C6B3E96}" 70 70 ProjectSection(ProjectDependencies) = postProject 71 {3670D01F-95F3-45A8-B878-947EB6CF214E} = {3670D01F-95F3-45A8-B878-947EB6CF214E} 71 72 {877150A0-41B3-4730-9D98-1B8298098B14} = {877150A0-41B3-4730-9D98-1B8298098B14} 72 73 EndProjectSection … … 79 80 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LLIntAssembly", "..\..\JavaScriptCore\JavaScriptCore.vcxproj\LLInt\LLIntAssembly\LLIntAssembly.vcxproj", "{9221744B-5715-4F56-9590-42F7AB23DD8B}" 80 81 ProjectSection(ProjectDependencies) = postProject 82 {3670D01F-95F3-45A8-B878-947EB6CF214E} = {3670D01F-95F3-45A8-B878-947EB6CF214E} 81 83 {D595E3F6-24F2-4C60-935C-95D50C6B3E96} = {D595E3F6-24F2-4C60-935C-95D50C6B3E96} 82 84 EndProjectSection
Note:
See TracChangeset
for help on using the changeset viewer.