Changeset 240138 in webkit
- Timestamp:
- Jan 17, 2019 6:11:44 PM (5 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r240136 r240138 1 2019-01-17 Mark Lam <mark.lam@apple.com> 2 3 Audit bytecode fields and ensure that LLInt instructions for accessing them are appropriate. 4 https://bugs.webkit.org/show_bug.cgi?id=193557 5 <rdar://problem/47369125> 6 7 Reviewed by Yusuke Suzuki. 8 9 1. Rename some bytecode fields so that it's easier to discern whether the LLInt 10 is accessing them the right way: 11 - distinguish between targetVirtualRegister and targetLabel. 12 - name all StructureID fields as structureID (oldStructureID, newStructureID) 13 instead of structure (oldStructure, newStructure). 14 15 2. Use bitwise_cast in struct Fits when sizeof(T) == size. 16 This prevents potential undefined behavior issues arising from doing 17 assignments with reinterpret_cast'ed pointers. 18 19 3. Make Special::Pointer an unsigned type (previously int). 20 Make ResolveType an unsigned type (previously int). 21 22 4. In LowLevelInterpreter*.asm: 23 24 - rename the op macro argument to opcodeName or opcodeStruct respectively. 25 This makes it clearer which argument type the macro is working with. 26 27 - rename the name macro argument to opcodeName. 28 29 - fix operator types to match the field type being accessed. The following 30 may have resulted in bugs before: 31 32 1. The following should be read with getu() instead of get() because they 33 are unsigned ints: 34 OpSwitchImm::m_tableIndex 35 OpSwitchChar::m_tableIndex 36 OpGetFromArguments::m_index 37 OpPutToArguments::m_index 38 OpGetRestLength::m_numParametersToSkip 39 40 OpJneqPtr::m_specialPointer should also be read with getu() though this 41 wasn't a bug because it was previously an int by default, and is only 42 changed to an unsigned int in this patch. 43 44 2.The following should be read with loadi (not loadp) because they are of 45 unsigned type (not a pointer): 46 OpResolveScope::Metadata::m_resolveType 47 CodeBlock::m_numParameters (see prepareForTailCall) 48 49 3. OpPutToScope::Metadata::m_operand should be read with loadp (not loadis) 50 because it is a uintptr_t. 51 52 4. The following should be read with loadi (not loadis) because they are 53 unsigned ints: 54 OpNegate::Metadata::m_arithProfile + ArithProfile::m_bits 55 OpPutById::Metadata::m_oldStructureID 56 OpPutToScope::Metadata::m_getPutInfo + GetPutInfo::m_operand 57 58 These may not have manifested in bugs because the operations that follow 59 the load are 32-bit instructions which ignore the high word. 60 61 5. Give class GetPutInfo a default constructor so that we can use bitwise_cast 62 on it. Also befriend LLIntOffsetsExtractor so that we can take the offset of 63 m_operand in it. 64 65 * bytecode/ArithProfile.h: 66 * bytecode/BytecodeList.rb: 67 * bytecode/BytecodeUseDef.h: 68 (JSC::computeUsesForBytecodeOffset): 69 (JSC::computeDefsForBytecodeOffset): 70 * bytecode/CodeBlock.cpp: 71 (JSC::CodeBlock::propagateTransitions): 72 (JSC::CodeBlock::finalizeLLIntInlineCaches): 73 * bytecode/Fits.h: 74 * bytecode/GetByIdMetadata.h: 75 * bytecode/GetByIdStatus.cpp: 76 (JSC::GetByIdStatus::computeFromLLInt): 77 * bytecode/LLIntPrototypeLoadAdaptiveStructureWatchpoint.cpp: 78 (JSC::LLIntPrototypeLoadAdaptiveStructureWatchpoint::clearLLIntGetByIdCache): 79 * bytecode/PreciseJumpTargetsInlines.h: 80 (JSC::jumpTargetForInstruction): 81 (JSC::updateStoredJumpTargetsForInstruction): 82 * bytecode/PutByIdStatus.cpp: 83 (JSC::PutByIdStatus::computeFromLLInt): 84 * bytecode/SpecialPointer.h: 85 * bytecompiler/BytecodeGenerator.cpp: 86 (JSC::Label::setLocation): 87 * dfg/DFGByteCodeParser.cpp: 88 (JSC::DFG::ByteCodeParser::parseBlock): 89 * jit/JITArithmetic.cpp: 90 (JSC::JIT::emit_compareAndJump): 91 (JSC::JIT::emit_compareUnsignedAndJump): 92 (JSC::JIT::emit_compareAndJumpSlow): 93 * jit/JITArithmetic32_64.cpp: 94 (JSC::JIT::emit_compareAndJump): 95 (JSC::JIT::emit_compareUnsignedAndJump): 96 (JSC::JIT::emit_compareAndJumpSlow): 97 (JSC::JIT::emitBinaryDoubleOp): 98 * jit/JITOpcodes.cpp: 99 (JSC::JIT::emit_op_jmp): 100 (JSC::JIT::emit_op_jfalse): 101 (JSC::JIT::emit_op_jeq_null): 102 (JSC::JIT::emit_op_jneq_null): 103 (JSC::JIT::emit_op_jneq_ptr): 104 (JSC::JIT::emit_op_jeq): 105 (JSC::JIT::emit_op_jtrue): 106 (JSC::JIT::emit_op_jneq): 107 (JSC::JIT::compileOpStrictEqJump): 108 (JSC::JIT::emitSlow_op_jstricteq): 109 (JSC::JIT::emitSlow_op_jnstricteq): 110 (JSC::JIT::emit_op_check_tdz): 111 (JSC::JIT::emitSlow_op_jeq): 112 (JSC::JIT::emitSlow_op_jneq): 113 (JSC::JIT::emit_op_profile_type): 114 * jit/JITOpcodes32_64.cpp: 115 (JSC::JIT::emit_op_jmp): 116 (JSC::JIT::emit_op_jfalse): 117 (JSC::JIT::emit_op_jtrue): 118 (JSC::JIT::emit_op_jeq_null): 119 (JSC::JIT::emit_op_jneq_null): 120 (JSC::JIT::emit_op_jneq_ptr): 121 (JSC::JIT::emit_op_jeq): 122 (JSC::JIT::emitSlow_op_jeq): 123 (JSC::JIT::emit_op_jneq): 124 (JSC::JIT::emitSlow_op_jneq): 125 (JSC::JIT::compileOpStrictEqJump): 126 (JSC::JIT::emitSlow_op_jstricteq): 127 (JSC::JIT::emitSlow_op_jnstricteq): 128 (JSC::JIT::emit_op_check_tdz): 129 (JSC::JIT::emit_op_profile_type): 130 * llint/LLIntSlowPaths.cpp: 131 (JSC::LLInt::LLINT_SLOW_PATH_DECL): 132 (JSC::LLInt::setupGetByIdPrototypeCache): 133 * llint/LowLevelInterpreter.asm: 134 * llint/LowLevelInterpreter32_64.asm: 135 * llint/LowLevelInterpreter64.asm: 136 * runtime/CommonSlowPaths.cpp: 137 * runtime/GetPutInfo.h: 138 1 139 2019-01-17 Truitt Savell <tsavell@apple.com> 2 140 -
trunk/Source/JavaScriptCore/bytecode/ArithProfile.h
r237972 r240138 1 1 /* 2 * Copyright (C) 2016 Apple Inc. All rights reserved.2 * Copyright (C) 2016-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 307 307 308 308 uint32_t m_bits { 0 }; // We take care to update m_bits only in a single operation. We don't ever store an inconsistent bit representation to it. 309 310 friend class JSC::LLIntOffsetsExtractor; 309 311 }; 310 312 -
trunk/Source/JavaScriptCore/bytecode/BytecodeList.rb
r240023 r240138 1 # Copyright (C) 2018 Apple Inc. All rights reserved.1 # Copyright (C) 2018-2019 Apple Inc. All rights reserved. 2 2 # 3 3 # Redistribution and use in source and binary forms, with or without … … 143 143 op :check_tdz, 144 144 args: { 145 target : VirtualRegister,145 targetVirtualRegister: VirtualRegister, 146 146 } 147 147 … … 450 450 metadata: { 451 451 profile: ValueProfile, # not used in llint 452 structure : StructureID,452 structureID: StructureID, 453 453 offset: unsigned, 454 454 } … … 472 472 }, 473 473 metadata: { 474 oldStructure : StructureID,474 oldStructureID: StructureID, 475 475 offset: unsigned, 476 newStructure : StructureID,476 newStructureID: StructureID, 477 477 structureChain: WriteBarrierBase[StructureChain], 478 478 } … … 599 599 op :jmp, 600 600 args: { 601 target : BoundLabel,601 targetLabel: BoundLabel, 602 602 } 603 603 … … 605 605 args: { 606 606 condition: VirtualRegister, 607 target : BoundLabel,607 targetLabel: BoundLabel, 608 608 } 609 609 … … 611 611 args: { 612 612 condition: VirtualRegister, 613 target : BoundLabel,613 targetLabel: BoundLabel, 614 614 } 615 615 … … 617 617 args: { 618 618 value: VirtualRegister, 619 target : BoundLabel,619 targetLabel: BoundLabel, 620 620 } 621 621 … … 623 623 args: { 624 624 value: VirtualRegister, 625 target : BoundLabel,625 targetLabel: BoundLabel, 626 626 } 627 627 … … 630 630 value: VirtualRegister, 631 631 specialPointer: Special::Pointer, 632 target : BoundLabel,632 targetLabel: BoundLabel, 633 633 }, 634 634 metadata: { … … 656 656 lhs: VirtualRegister, 657 657 rhs: VirtualRegister, 658 target : BoundLabel,658 targetLabel: BoundLabel, 659 659 } 660 660 … … 966 966 op :profile_type, 967 967 args: { 968 target : VirtualRegister,968 targetVirtualRegister: VirtualRegister, 969 969 symbolTableOrScopeDepth: int, 970 970 flag: ProfileTypeBytecodeFlag, -
trunk/Source/JavaScriptCore/bytecode/BytecodeUseDef.h
r240041 r240138 95 95 USES(OpGetScope, dst) 96 96 USES(OpToThis, srcDst) 97 USES(OpCheckTdz, target )97 USES(OpCheckTdz, targetVirtualRegister) 98 98 USES(OpIdentityWithProfile, srcDst) 99 USES(OpProfileType, target );99 USES(OpProfileType, targetVirtualRegister); 100 100 USES(OpThrow, value) 101 101 USES(OpThrowStaticError, message) … … 449 449 DEFS(OpNewObject, dst) 450 450 DEFS(OpToThis, srcDst) 451 DEFS(OpCheckTdz, target )451 DEFS(OpCheckTdz, targetVirtualRegister) 452 452 DEFS(OpGetScope, dst) 453 453 DEFS(OpCreateDirectArguments, dst) -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
r240041 r240138 1096 1096 if (instruction->is<OpPutById>()) { 1097 1097 auto& metadata = instruction->as<OpPutById>().metadata(this); 1098 StructureID oldStructureID = metadata.m_oldStructure ;1099 StructureID newStructureID = metadata.m_newStructure ;1098 StructureID oldStructureID = metadata.m_oldStructureID; 1099 StructureID newStructureID = metadata.m_newStructureID; 1100 1100 if (!oldStructureID || !newStructureID) 1101 1101 continue; … … 1227 1227 if (metadata.m_mode != GetByIdMode::Default) 1228 1228 break; 1229 StructureID oldStructureID = metadata.m_modeMetadata.defaultMode.structure ;1229 StructureID oldStructureID = metadata.m_modeMetadata.defaultMode.structureID; 1230 1230 if (!oldStructureID || Heap::isMarked(vm.heap.structureIDTable().get(oldStructureID))) 1231 1231 break; … … 1237 1237 case op_get_by_id_direct: { 1238 1238 auto& metadata = curInstruction->as<OpGetByIdDirect>().metadata(this); 1239 StructureID oldStructureID = metadata.m_structure ;1239 StructureID oldStructureID = metadata.m_structureID; 1240 1240 if (!oldStructureID || Heap::isMarked(vm.heap.structureIDTable().get(oldStructureID))) 1241 1241 break; 1242 1242 if (Options::verboseOSR()) 1243 1243 dataLogF("Clearing LLInt property access.\n"); 1244 metadata.m_structure = 0;1244 metadata.m_structureID = 0; 1245 1245 metadata.m_offset = 0; 1246 1246 break; … … 1248 1248 case op_put_by_id: { 1249 1249 auto& metadata = curInstruction->as<OpPutById>().metadata(this); 1250 StructureID oldStructureID = metadata.m_oldStructure ;1251 StructureID newStructureID = metadata.m_newStructure ;1250 StructureID oldStructureID = metadata.m_oldStructureID; 1251 StructureID newStructureID = metadata.m_newStructureID; 1252 1252 StructureChain* chain = metadata.m_structureChain.get(); 1253 1253 if ((!oldStructureID || Heap::isMarked(vm.heap.structureIDTable().get(oldStructureID))) … … 1257 1257 if (Options::verboseOSR()) 1258 1258 dataLogF("Clearing LLInt put transition.\n"); 1259 metadata.m_oldStructure = 0;1259 metadata.m_oldStructureID = 0; 1260 1260 metadata.m_offset = 0; 1261 metadata.m_newStructure = 0;1261 metadata.m_newStructureID = 0; 1262 1262 metadata.m_structureChain.clear(); 1263 1263 break; -
trunk/Source/JavaScriptCore/bytecode/Fits.h
r240023 r240138 1 1 /* 2 * Copyright (C) 2018 Apple Inc. All rights reserved.2 * Copyright (C) 2018-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 53 53 static bool check(T) { return true; } 54 54 55 static typename TypeBySize<size>::type convert(T t) { return *reinterpret_cast<typename TypeBySize<size>::type*>(&t); }55 static typename TypeBySize<size>::type convert(T t) { return bitwise_cast<typename TypeBySize<size>::type>(t); } 56 56 57 57 template<class T1 = T, OpcodeSize size1 = size, typename = std::enable_if_t<!std::is_same<T1, typename TypeBySize<size1>::type>::value, std::true_type>> 58 static T1 convert(typename TypeBySize<size1>::type t) { return *reinterpret_cast<T1*>(&t); }58 static T1 convert(typename TypeBySize<size1>::type t) { return bitwise_cast<T1>(t); } 59 59 }; 60 60 -
trunk/Source/JavaScriptCore/bytecode/GetByIdMetadata.h
r237547 r240138 1 1 /* 2 * Copyright (C) 2018 Apple Inc. All rights reserved.2 * Copyright (C) 2018-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 40 40 41 41 struct Default { 42 StructureID structure ;42 StructureID structureID; 43 43 PropertyOffset cachedOffset; 44 44 } defaultMode; 45 45 46 46 struct Unset { 47 StructureID structure ;47 StructureID structureID; 48 48 } unsetMode; 49 49 50 50 struct ProtoLoad { 51 StructureID structure ;51 StructureID structureID; 52 52 PropertyOffset cachedOffset; 53 53 JSObject* cachedSlot; -
trunk/Source/JavaScriptCore/bytecode/GetByIdStatus.cpp
r240041 r240138 67 67 if (metadata.m_mode != GetByIdMode::Default) 68 68 return GetByIdStatus(NoInformation, false); 69 structureID = metadata.m_modeMetadata.defaultMode.structure ;69 structureID = metadata.m_modeMetadata.defaultMode.structureID; 70 70 break; 71 71 } 72 72 case op_get_by_id_direct: 73 structureID = instruction->as<OpGetByIdDirect>().metadata(profiledBlock).m_structure ;73 structureID = instruction->as<OpGetByIdDirect>().metadata(profiledBlock).m_structureID; 74 74 break; 75 75 case op_try_get_by_id: { -
trunk/Source/JavaScriptCore/bytecode/LLIntPrototypeLoadAdaptiveStructureWatchpoint.cpp
r240041 r240138 62 62 metadata.m_mode = GetByIdMode::Default; 63 63 metadata.m_modeMetadata.defaultMode.cachedOffset = 0; 64 metadata.m_modeMetadata.defaultMode.structure = 0;64 metadata.m_modeMetadata.defaultMode.structureID = 0; 65 65 } 66 66 -
trunk/Source/JavaScriptCore/bytecode/PreciseJumpTargetsInlines.h
r240041 r240138 109 109 { 110 110 auto bytecode = instruction->as<Op>(); 111 return jumpTargetForInstruction(codeBlock, instruction, bytecode.m_target );111 return jumpTargetForInstruction(codeBlock, instruction, bytecode.m_targetLabel); 112 112 } 113 113 … … 140 140 int32_t target = jumpTargetForInstruction<__op>(codeBlockOrHashMap, instruction); \ 141 141 int32_t newTarget = function(target); \ 142 instruction->cast<__op>()->setTarget (BoundLabel(newTarget), [&]() { \142 instruction->cast<__op>()->setTargetLabel(BoundLabel(newTarget), [&]() { \ 143 143 codeBlock->addOutOfLineJumpTarget(finalOffset + instruction.offset(), newTarget); \ 144 144 return BoundLabel(); \ -
trunk/Source/JavaScriptCore/bytecode/PutByIdStatus.cpp
r240041 r240138 56 56 auto& metadata = bytecode.metadata(profiledBlock); 57 57 58 StructureID structureID = metadata.m_oldStructure ;58 StructureID structureID = metadata.m_oldStructureID; 59 59 if (!structureID) 60 60 return PutByIdStatus(NoInformation); … … 62 62 Structure* structure = vm.heap.structureIDTable().get(structureID); 63 63 64 StructureID newStructureID = metadata.m_newStructure ;64 StructureID newStructureID = metadata.m_newStructureID; 65 65 if (!newStructureID) { 66 66 PropertyOffset offset = structure->getConcurrently(uid); -
trunk/Source/JavaScriptCore/bytecode/SpecialPointer.h
r237547 r240138 1 1 /* 2 * Copyright (C) 2012 Apple Inc. All rights reserved.2 * Copyright (C) 2012-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 32 32 33 33 namespace Special { 34 enum Pointer {34 enum Pointer : unsigned { 35 35 CallFunction, 36 36 ApplyFunction, -
trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
r240041 r240138 103 103 #define CASE(__op) \ 104 104 case __op::opcodeID: \ 105 instruction->cast<__op>()->setTarget (BoundLabel(target), [&]() { \105 instruction->cast<__op>()->setTargetLabel(BoundLabel(target), [&]() { \ 106 106 generator.m_codeBlock->addOutOfLineJumpTarget(instruction.offset(), target); \ 107 107 return BoundLabel(); \ -
trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
r240106 r240138 5091 5091 case op_check_tdz: { 5092 5092 auto bytecode = currentInstruction->as<OpCheckTdz>(); 5093 addToGraph(CheckNotEmpty, get(bytecode.m_target ));5093 addToGraph(CheckNotEmpty, get(bytecode.m_targetVirtualRegister)); 5094 5094 NEXT_OPCODE(op_check_tdz); 5095 5095 } … … 5599 5599 auto bytecode = currentInstruction->as<OpProfileType>(); 5600 5600 auto& metadata = bytecode.metadata(codeBlock); 5601 Node* valueToProfile = get(bytecode.m_target );5601 Node* valueToProfile = get(bytecode.m_targetVirtualRegister); 5602 5602 addToGraph(ProfileType, OpInfo(metadata.m_typeLocation), valueToProfile); 5603 5603 NEXT_OPCODE(op_profile_type); … … 5616 5616 ASSERT(!m_currentBlock->terminal()); 5617 5617 auto bytecode = currentInstruction->as<OpJmp>(); 5618 int relativeOffset = jumpTarget(bytecode.m_target );5618 int relativeOffset = jumpTarget(bytecode.m_targetLabel); 5619 5619 addToGraph(Jump, OpInfo(m_currentIndex + relativeOffset)); 5620 5620 if (relativeOffset <= 0) … … 5625 5625 case op_jtrue: { 5626 5626 auto bytecode = currentInstruction->as<OpJtrue>(); 5627 unsigned relativeOffset = jumpTarget(bytecode.m_target );5627 unsigned relativeOffset = jumpTarget(bytecode.m_targetLabel); 5628 5628 Node* condition = get(bytecode.m_condition); 5629 5629 addToGraph(Branch, OpInfo(branchData(m_currentIndex + relativeOffset, m_currentIndex + currentInstruction->size())), condition); … … 5633 5633 case op_jfalse: { 5634 5634 auto bytecode = currentInstruction->as<OpJfalse>(); 5635 unsigned relativeOffset = jumpTarget(bytecode.m_target );5635 unsigned relativeOffset = jumpTarget(bytecode.m_targetLabel); 5636 5636 Node* condition = get(bytecode.m_condition); 5637 5637 addToGraph(Branch, OpInfo(branchData(m_currentIndex + currentInstruction->size(), m_currentIndex + relativeOffset)), condition); … … 5641 5641 case op_jeq_null: { 5642 5642 auto bytecode = currentInstruction->as<OpJeqNull>(); 5643 unsigned relativeOffset = jumpTarget(bytecode.m_target );5643 unsigned relativeOffset = jumpTarget(bytecode.m_targetLabel); 5644 5644 Node* value = get(bytecode.m_value); 5645 5645 Node* nullConstant = addToGraph(JSConstant, OpInfo(m_constantNull)); … … 5651 5651 case op_jneq_null: { 5652 5652 auto bytecode = currentInstruction->as<OpJneqNull>(); 5653 unsigned relativeOffset = jumpTarget(bytecode.m_target );5653 unsigned relativeOffset = jumpTarget(bytecode.m_targetLabel); 5654 5654 Node* value = get(bytecode.m_value); 5655 5655 Node* nullConstant = addToGraph(JSConstant, OpInfo(m_constantNull)); … … 5661 5661 case op_jless: { 5662 5662 auto bytecode = currentInstruction->as<OpJless>(); 5663 unsigned relativeOffset = jumpTarget(bytecode.m_target );5663 unsigned relativeOffset = jumpTarget(bytecode.m_targetLabel); 5664 5664 Node* op1 = get(bytecode.m_lhs); 5665 5665 Node* op2 = get(bytecode.m_rhs); … … 5671 5671 case op_jlesseq: { 5672 5672 auto bytecode = currentInstruction->as<OpJlesseq>(); 5673 unsigned relativeOffset = jumpTarget(bytecode.m_target );5673 unsigned relativeOffset = jumpTarget(bytecode.m_targetLabel); 5674 5674 Node* op1 = get(bytecode.m_lhs); 5675 5675 Node* op2 = get(bytecode.m_rhs); … … 5681 5681 case op_jgreater: { 5682 5682 auto bytecode = currentInstruction->as<OpJgreater>(); 5683 unsigned relativeOffset = jumpTarget(bytecode.m_target );5683 unsigned relativeOffset = jumpTarget(bytecode.m_targetLabel); 5684 5684 Node* op1 = get(bytecode.m_lhs); 5685 5685 Node* op2 = get(bytecode.m_rhs); … … 5691 5691 case op_jgreatereq: { 5692 5692 auto bytecode = currentInstruction->as<OpJgreatereq>(); 5693 unsigned relativeOffset = jumpTarget(bytecode.m_target );5693 unsigned relativeOffset = jumpTarget(bytecode.m_targetLabel); 5694 5694 Node* op1 = get(bytecode.m_lhs); 5695 5695 Node* op2 = get(bytecode.m_rhs); … … 5701 5701 case op_jeq: { 5702 5702 auto bytecode = currentInstruction->as<OpJeq>(); 5703 unsigned relativeOffset = jumpTarget(bytecode.m_target );5703 unsigned relativeOffset = jumpTarget(bytecode.m_targetLabel); 5704 5704 Node* op1 = get(bytecode.m_lhs); 5705 5705 Node* op2 = get(bytecode.m_rhs); … … 5711 5711 case op_jstricteq: { 5712 5712 auto bytecode = currentInstruction->as<OpJstricteq>(); 5713 unsigned relativeOffset = jumpTarget(bytecode.m_target );5713 unsigned relativeOffset = jumpTarget(bytecode.m_targetLabel); 5714 5714 Node* op1 = get(bytecode.m_lhs); 5715 5715 Node* op2 = get(bytecode.m_rhs); … … 5721 5721 case op_jnless: { 5722 5722 auto bytecode = currentInstruction->as<OpJnless>(); 5723 unsigned relativeOffset = jumpTarget(bytecode.m_target );5723 unsigned relativeOffset = jumpTarget(bytecode.m_targetLabel); 5724 5724 Node* op1 = get(bytecode.m_lhs); 5725 5725 Node* op2 = get(bytecode.m_rhs); … … 5731 5731 case op_jnlesseq: { 5732 5732 auto bytecode = currentInstruction->as<OpJnlesseq>(); 5733 unsigned relativeOffset = jumpTarget(bytecode.m_target );5733 unsigned relativeOffset = jumpTarget(bytecode.m_targetLabel); 5734 5734 Node* op1 = get(bytecode.m_lhs); 5735 5735 Node* op2 = get(bytecode.m_rhs); … … 5741 5741 case op_jngreater: { 5742 5742 auto bytecode = currentInstruction->as<OpJngreater>(); 5743 unsigned relativeOffset = jumpTarget(bytecode.m_target );5743 unsigned relativeOffset = jumpTarget(bytecode.m_targetLabel); 5744 5744 Node* op1 = get(bytecode.m_lhs); 5745 5745 Node* op2 = get(bytecode.m_rhs); … … 5751 5751 case op_jngreatereq: { 5752 5752 auto bytecode = currentInstruction->as<OpJngreatereq>(); 5753 unsigned relativeOffset = jumpTarget(bytecode.m_target );5753 unsigned relativeOffset = jumpTarget(bytecode.m_targetLabel); 5754 5754 Node* op1 = get(bytecode.m_lhs); 5755 5755 Node* op2 = get(bytecode.m_rhs); … … 5761 5761 case op_jneq: { 5762 5762 auto bytecode = currentInstruction->as<OpJneq>(); 5763 unsigned relativeOffset = jumpTarget(bytecode.m_target );5763 unsigned relativeOffset = jumpTarget(bytecode.m_targetLabel); 5764 5764 Node* op1 = get(bytecode.m_lhs); 5765 5765 Node* op2 = get(bytecode.m_rhs); … … 5771 5771 case op_jnstricteq: { 5772 5772 auto bytecode = currentInstruction->as<OpJnstricteq>(); 5773 unsigned relativeOffset = jumpTarget(bytecode.m_target );5773 unsigned relativeOffset = jumpTarget(bytecode.m_targetLabel); 5774 5774 Node* op1 = get(bytecode.m_lhs); 5775 5775 Node* op2 = get(bytecode.m_rhs); … … 5781 5781 case op_jbelow: { 5782 5782 auto bytecode = currentInstruction->as<OpJbelow>(); 5783 unsigned relativeOffset = jumpTarget(bytecode.m_target );5783 unsigned relativeOffset = jumpTarget(bytecode.m_targetLabel); 5784 5784 Node* op1 = get(bytecode.m_lhs); 5785 5785 Node* op2 = get(bytecode.m_rhs); … … 5791 5791 case op_jbeloweq: { 5792 5792 auto bytecode = currentInstruction->as<OpJbeloweq>(); 5793 unsigned relativeOffset = jumpTarget(bytecode.m_target );5793 unsigned relativeOffset = jumpTarget(bytecode.m_targetLabel); 5794 5794 Node* op1 = get(bytecode.m_lhs); 5795 5795 Node* op2 = get(bytecode.m_rhs); … … 6108 6108 actualPointerFor(m_inlineStackTop->m_codeBlock, specialPointer)); 6109 6109 FrozenValue* frozenPointer = m_graph.freeze(actualPointer); 6110 unsigned relativeOffset = jumpTarget(bytecode.m_target );6110 unsigned relativeOffset = jumpTarget(bytecode.m_targetLabel); 6111 6111 Node* child = get(bytecode.m_value); 6112 6112 if (bytecode.metadata(codeBlock).m_hasJumped) { -
trunk/Source/JavaScriptCore/jit/JITArithmetic.cpp
r240041 r240138 179 179 int op1 = bytecode.m_lhs.offset(); 180 180 int op2 = bytecode.m_rhs.offset(); 181 unsigned target = jumpTarget(instruction, bytecode.m_target );181 unsigned target = jumpTarget(instruction, bytecode.m_targetLabel); 182 182 if (isOperandConstantChar(op1)) { 183 183 emitGetVirtualRegister(op2, regT0); … … 226 226 int op1 = bytecode.m_lhs.offset(); 227 227 int op2 = bytecode.m_rhs.offset(); 228 unsigned target = jumpTarget(instruction, bytecode.m_target );228 unsigned target = jumpTarget(instruction, bytecode.m_targetLabel); 229 229 if (isOperandConstantInt(op2)) { 230 230 emitGetVirtualRegister(op1, regT0); … … 270 270 int op1 = bytecode.m_lhs.offset(); 271 271 int op2 = bytecode.m_rhs.offset(); 272 unsigned target = jumpTarget(instruction, bytecode.m_target );272 unsigned target = jumpTarget(instruction, bytecode.m_targetLabel); 273 273 274 274 // We generate inline code for the following cases in the slow path: -
trunk/Source/JavaScriptCore/jit/JITArithmetic32_64.cpp
r240041 r240138 51 51 int op1 = bytecode.m_lhs.offset(); 52 52 int op2 = bytecode.m_rhs.offset(); 53 unsigned target = jumpTarget(instruction, bytecode.m_target );53 unsigned target = jumpTarget(instruction, bytecode.m_targetLabel); 54 54 55 55 // Character less. … … 105 105 int op1 = bytecode.m_lhs.offset(); 106 106 int op2 = bytecode.m_rhs.offset(); 107 unsigned target = jumpTarget(instruction, bytecode.m_target );107 unsigned target = jumpTarget(instruction, bytecode.m_targetLabel); 108 108 109 109 if (isOperandConstantInt(op1)) { … … 146 146 int op1 = bytecode.m_lhs.offset(); 147 147 int op2 = bytecode.m_rhs.offset(); 148 unsigned target = jumpTarget(instruction, bytecode.m_target );148 unsigned target = jumpTarget(instruction, bytecode.m_targetLabel); 149 149 150 150 linkAllSlowCases(iter); … … 200 200 auto bytecode = instruction->as<Op>(); 201 201 int opcodeID = Op::opcodeID; 202 int target = jumpTarget(instruction, bytecode.m_target );202 int target = jumpTarget(instruction, bytecode.m_targetLabel); 203 203 int op1 = bytecode.m_lhs.offset(); 204 204 int op2 = bytecode.m_rhs.offset(); -
trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp
r240041 r240138 87 87 { 88 88 auto bytecode = currentInstruction->as<OpJmp>(); 89 unsigned target = jumpTarget(currentInstruction, bytecode.m_target );89 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel); 90 90 addJump(jump(), target); 91 91 } … … 384 384 { 385 385 auto bytecode = currentInstruction->as<OpJfalse>(); 386 unsigned target = jumpTarget(currentInstruction, bytecode.m_target );386 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel); 387 387 388 388 GPRReg value = regT0; … … 399 399 auto bytecode = currentInstruction->as<OpJeqNull>(); 400 400 int src = bytecode.m_value.offset(); 401 unsigned target = jumpTarget(currentInstruction, bytecode.m_target );401 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel); 402 402 403 403 emitGetVirtualRegister(src, regT0); … … 423 423 auto bytecode = currentInstruction->as<OpJneqNull>(); 424 424 int src = bytecode.m_value.offset(); 425 unsigned target = jumpTarget(currentInstruction, bytecode.m_target );425 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel); 426 426 427 427 emitGetVirtualRegister(src, regT0); … … 449 449 int src = bytecode.m_value.offset(); 450 450 Special::Pointer ptr = bytecode.m_specialPointer; 451 unsigned target = jumpTarget(currentInstruction, bytecode.m_target );451 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel); 452 452 453 453 emitGetVirtualRegister(src, regT0); … … 471 471 { 472 472 auto bytecode = currentInstruction->as<OpJeq>(); 473 unsigned target = jumpTarget(currentInstruction, bytecode.m_target );473 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel); 474 474 emitGetVirtualRegisters(bytecode.m_lhs.offset(), regT0, bytecode.m_rhs.offset(), regT1); 475 475 emitJumpSlowCaseIfNotInt(regT0, regT1, regT2); … … 480 480 { 481 481 auto bytecode = currentInstruction->as<OpJtrue>(); 482 unsigned target = jumpTarget(currentInstruction, bytecode.m_target );482 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel); 483 483 484 484 GPRReg value = regT0; … … 504 504 { 505 505 auto bytecode = currentInstruction->as<OpJneq>(); 506 unsigned target = jumpTarget(currentInstruction, bytecode.m_target );506 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel); 507 507 emitGetVirtualRegisters(bytecode.m_lhs.offset(), regT0, bytecode.m_rhs.offset(), regT1); 508 508 emitJumpSlowCaseIfNotInt(regT0, regT1, regT2); … … 567 567 { 568 568 auto bytecode = currentInstruction->as<Op>(); 569 int target = jumpTarget(currentInstruction, bytecode.m_target );569 int target = jumpTarget(currentInstruction, bytecode.m_targetLabel); 570 570 int src1 = bytecode.m_lhs.offset(); 571 571 int src2 = bytecode.m_rhs.offset(); … … 608 608 609 609 auto bytecode = currentInstruction->as<OpJstricteq>(); 610 unsigned target = jumpTarget(currentInstruction, bytecode.m_target );610 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel); 611 611 callOperation(operationCompareStrictEq, regT0, regT1); 612 612 emitJumpSlowToHot(branchTest32(NonZero, returnValueGPR), target); … … 618 618 619 619 auto bytecode = currentInstruction->as<OpJnstricteq>(); 620 unsigned target = jumpTarget(currentInstruction, bytecode.m_target );620 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel); 621 621 callOperation(operationCompareStrictEq, regT0, regT1); 622 622 emitJumpSlowToHot(branchTest32(Zero, returnValueGPR), target); … … 933 933 { 934 934 auto bytecode = currentInstruction->as<OpCheckTdz>(); 935 emitGetVirtualRegister(bytecode.m_target .offset(), regT0);935 emitGetVirtualRegister(bytecode.m_targetVirtualRegister.offset(), regT0); 936 936 addSlowCase(branchIfEmpty(regT0)); 937 937 } … … 966 966 967 967 auto bytecode = currentInstruction->as<OpJeq>(); 968 unsigned target = jumpTarget(currentInstruction, bytecode.m_target );968 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel); 969 969 callOperation(operationCompareEq, regT0, regT1); 970 970 emitJumpSlowToHot(branchTest32(NonZero, returnValueGPR), target); … … 976 976 977 977 auto bytecode = currentInstruction->as<OpJneq>(); 978 unsigned target = jumpTarget(currentInstruction, bytecode.m_target );978 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel); 979 979 callOperation(operationCompareEq, regT0, regT1); 980 980 emitJumpSlowToHot(branchTest32(Zero, returnValueGPR), target); … … 1400 1400 auto& metadata = bytecode.metadata(m_codeBlock); 1401 1401 TypeLocation* cachedTypeLocation = metadata.m_typeLocation; 1402 int valueToProfile = bytecode.m_target .offset();1402 int valueToProfile = bytecode.m_targetVirtualRegister.offset(); 1403 1403 1404 1404 emitGetVirtualRegister(valueToProfile, regT0); -
trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp
r240041 r240138 75 75 { 76 76 auto bytecode = currentInstruction->as<OpJmp>(); 77 unsigned target = jumpTarget(currentInstruction, bytecode.m_target );77 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel); 78 78 addJump(jump(), target); 79 79 } … … 373 373 auto bytecode = currentInstruction->as<OpJfalse>(); 374 374 int cond = bytecode.m_condition.offset(); 375 unsigned target = jumpTarget(currentInstruction, bytecode.m_target );375 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel); 376 376 377 377 emitLoad(cond, regT1, regT0); … … 388 388 auto bytecode = currentInstruction->as<OpJtrue>(); 389 389 int cond = bytecode.m_condition.offset(); 390 unsigned target = jumpTarget(currentInstruction, bytecode.m_target );390 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel); 391 391 392 392 emitLoad(cond, regT1, regT0); … … 402 402 auto bytecode = currentInstruction->as<OpJeqNull>(); 403 403 int src = bytecode.m_value.offset(); 404 unsigned target = jumpTarget(currentInstruction, bytecode.m_target );404 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel); 405 405 406 406 emitLoad(src, regT1, regT0); … … 428 428 auto bytecode = currentInstruction->as<OpJneqNull>(); 429 429 int src = bytecode.m_value.offset(); 430 unsigned target = jumpTarget(currentInstruction, bytecode.m_target );430 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel); 431 431 432 432 emitLoad(src, regT1, regT0); … … 456 456 int src = bytecode.m_value.offset(); 457 457 Special::Pointer ptr = bytecode.m_specialPointer; 458 unsigned target = jumpTarget(currentInstruction, bytecode.m_target );458 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel); 459 459 460 460 emitLoad(src, regT1, regT0); … … 515 515 { 516 516 auto bytecode = currentInstruction->as<OpJeq>(); 517 unsigned target = jumpTarget(currentInstruction, bytecode.m_target );517 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel); 518 518 int src1 = bytecode.m_lhs.offset(); 519 519 int src2 = bytecode.m_rhs.offset(); … … 555 555 { 556 556 auto bytecode = currentInstruction->as<OpJeq>(); 557 unsigned target = jumpTarget(currentInstruction, bytecode.m_target );557 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel); 558 558 compileOpEqJumpSlow(iter, CompileOpEqType::Eq, target); 559 559 } … … 607 607 { 608 608 auto bytecode = currentInstruction->as<OpJneq>(); 609 unsigned target = jumpTarget(currentInstruction, bytecode.m_target );609 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel); 610 610 int src1 = bytecode.m_lhs.offset(); 611 611 int src2 = bytecode.m_rhs.offset(); … … 622 622 { 623 623 auto bytecode = currentInstruction->as<OpJneq>(); 624 unsigned target = jumpTarget(currentInstruction, bytecode.m_target );624 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel); 625 625 compileOpEqJumpSlow(iter, CompileOpEqType::NEq, target); 626 626 } … … 670 670 { 671 671 auto bytecode = currentInstruction->as<Op>(); 672 int target = jumpTarget(currentInstruction, bytecode.m_target );672 int target = jumpTarget(currentInstruction, bytecode.m_targetLabel); 673 673 int src1 = bytecode.m_lhs.offset(); 674 674 int src2 = bytecode.m_rhs.offset(); … … 709 709 710 710 auto bytecode = currentInstruction->as<OpJstricteq>(); 711 unsigned target = jumpTarget(currentInstruction, bytecode.m_target );711 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel); 712 712 callOperation(operationCompareStrictEq, JSValueRegs(regT1, regT0), JSValueRegs(regT3, regT2)); 713 713 emitJumpSlowToHot(branchTest32(NonZero, returnValueGPR), target); … … 719 719 720 720 auto bytecode = currentInstruction->as<OpJnstricteq>(); 721 unsigned target = jumpTarget(currentInstruction, bytecode.m_target );721 unsigned target = jumpTarget(currentInstruction, bytecode.m_targetLabel); 722 722 callOperation(operationCompareStrictEq, JSValueRegs(regT1, regT0), JSValueRegs(regT3, regT2)); 723 723 emitJumpSlowToHot(branchTest32(Zero, returnValueGPR), target); … … 1059 1059 { 1060 1060 auto bytecode = currentInstruction->as<OpCheckTdz>(); 1061 emitLoadTag(bytecode.m_target .offset(), regT0);1061 emitLoadTag(bytecode.m_targetVirtualRegister.offset(), regT0); 1062 1062 addSlowCase(branchIfEmpty(regT0)); 1063 1063 } … … 1272 1272 auto& metadata = bytecode.metadata(m_codeBlock); 1273 1273 TypeLocation* cachedTypeLocation = metadata.m_typeLocation; 1274 int valueToProfile = bytecode.m_target .offset();1274 int valueToProfile = bytecode.m_targetVirtualRegister.offset(); 1275 1275 1276 1276 // Load payload in T0. Load tag in T3. -
trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
r240041 r240138 123 123 } while (false) 124 124 125 #define JUMP_OFFSET(target ) \126 ((target ) ? (target) : exec->codeBlock()->outOfLineJumpOffset(pc))125 #define JUMP_OFFSET(targetOffset) \ 126 ((targetOffset) ? (targetOffset) : exec->codeBlock()->outOfLineJumpOffset(pc)) 127 127 128 128 #define JUMP_TO(target) do { \ … … 134 134 LLINT_CHECK_EXCEPTION(); \ 135 135 if (__b_condition) \ 136 JUMP_TO(JUMP_OFFSET(bytecode.m_target ));\136 JUMP_TO(JUMP_OFFSET(bytecode.m_targetLabel)); \ 137 137 else \ 138 138 JUMP_TO(pc->size()); \ … … 657 657 auto& metadata = bytecode.metadata(exec); 658 658 { 659 StructureID oldStructureID = metadata.m_structure ;659 StructureID oldStructureID = metadata.m_structureID; 660 660 if (oldStructureID) { 661 661 Structure* a = vm.heap.structureIDTable().get(oldStructureID); … … 673 673 if (slot.isValue()) { 674 674 // Start out by clearing out the old cache. 675 metadata.m_structure = 0;675 metadata.m_structureID = 0; 676 676 metadata.m_offset = 0; 677 677 … … 682 682 ConcurrentJSLocker locker(codeBlock->m_lock); 683 683 684 metadata.m_structure = structure->id();684 metadata.m_structureID = structure->id(); 685 685 metadata.m_offset = slot.cachedOffset(); 686 686 } … … 737 737 if (slot.isUnset()) { 738 738 metadata.m_mode = GetByIdMode::Unset; 739 metadata.m_modeMetadata.unsetMode.structure = structure->id();739 metadata.m_modeMetadata.unsetMode.structureID = structure->id(); 740 740 return; 741 741 } … … 743 743 744 744 metadata.m_mode = GetByIdMode::ProtoLoad; 745 metadata.m_modeMetadata.protoLoadMode.structure = structure->id();745 metadata.m_modeMetadata.protoLoadMode.structureID = structure->id(); 746 746 metadata.m_modeMetadata.protoLoadMode.cachedOffset = offset; 747 747 metadata.m_modeMetadata.protoLoadMode.cachedSlot = slot.slotBase(); … … 774 774 switch (mode) { 775 775 case GetByIdMode::Default: 776 oldStructureID = metadata.m_modeMetadata.defaultMode.structure ;776 oldStructureID = metadata.m_modeMetadata.defaultMode.structureID; 777 777 break; 778 778 case GetByIdMode::Unset: 779 oldStructureID = metadata.m_modeMetadata.unsetMode.structure ;779 oldStructureID = metadata.m_modeMetadata.unsetMode.structureID; 780 780 break; 781 781 case GetByIdMode::ProtoLoad: 782 oldStructureID = metadata.m_modeMetadata.protoLoadMode.structure ;782 oldStructureID = metadata.m_modeMetadata.protoLoadMode.structureID; 783 783 break; 784 784 default: … … 801 801 // Start out by clearing out the old cache. 802 802 metadata.m_mode = GetByIdMode::Default; 803 metadata.m_modeMetadata.defaultMode.structure = 0;803 metadata.m_modeMetadata.defaultMode.structureID = 0; 804 804 metadata.m_modeMetadata.defaultMode.cachedOffset = 0; 805 805 … … 813 813 ConcurrentJSLocker locker(codeBlock->m_lock); 814 814 815 metadata.m_modeMetadata.defaultMode.structure = structure->id();815 metadata.m_modeMetadata.defaultMode.structureID = structure->id(); 816 816 metadata.m_modeMetadata.defaultMode.cachedOffset = slot.cachedOffset(); 817 817 } … … 858 858 859 859 { 860 StructureID oldStructureID = metadata.m_oldStructure ;860 StructureID oldStructureID = metadata.m_oldStructureID; 861 861 if (oldStructureID) { 862 862 Structure* a = vm.heap.structureIDTable().get(oldStructureID); … … 873 873 874 874 // Start out by clearing out the old cache. 875 metadata.m_oldStructure = 0;875 metadata.m_oldStructureID = 0; 876 876 metadata.m_offset = 0; 877 metadata.m_newStructure = 0;877 metadata.m_newStructureID = 0; 878 878 metadata.m_structureChain.clear(); 879 879 … … 897 897 if (result != InvalidPrototypeChain && !sawPolyProto) { 898 898 ASSERT(structure->previousID()->isObject()); 899 metadata.m_oldStructure = structure->previousID()->id();899 metadata.m_oldStructureID = structure->previousID()->id(); 900 900 metadata.m_offset = slot.cachedOffset(); 901 metadata.m_newStructure = structure->id();901 metadata.m_newStructureID = structure->id(); 902 902 if (!(bytecode.m_flags & PutByIdIsDirect)) { 903 903 StructureChain* chain = structure->prototypeChain(exec, asObject(baseCell)); … … 909 909 } else { 910 910 structure->didCachePropertyReplacement(vm, slot.cachedOffset()); 911 metadata.m_oldStructure = structure->id();911 metadata.m_oldStructureID = structure->id(); 912 912 metadata.m_offset = slot.cachedOffset(); 913 913 } -
trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm
r240041 r240138 286 286 end 287 287 288 macro dispatch(advance )289 addp advance , PC288 macro dispatch(advanceReg) 289 addp advanceReg, PC 290 290 nextInstruction() 291 291 end 292 292 293 macro dispatchIndirect(offset )294 dispatch(offset )295 end 296 297 macro dispatchOp(size, op )293 macro dispatchIndirect(offsetReg) 294 dispatch(offsetReg) 295 end 296 297 macro dispatchOp(size, opcodeName) 298 298 macro dispatchNarrow() 299 dispatch(constexpr %op %_length)299 dispatch(constexpr %opcodeName%_length) 300 300 end 301 301 302 302 macro dispatchWide() 303 dispatch(constexpr %op %_length * 4 + 1)303 dispatch(constexpr %opcodeName%_length * 4 + 1) 304 304 end 305 305 … … 307 307 end 308 308 309 macro getu(size, op , fieldName, dst)309 macro getu(size, opcodeStruct, fieldName, dst) 310 310 size(getuOperandNarrow, getuOperandWide, macro (getu) 311 getu(op , fieldName, dst)311 getu(opcodeStruct, fieldName, dst) 312 312 end) 313 313 end 314 314 315 macro get(size, op , fieldName, dst)315 macro get(size, opcodeStruct, fieldName, dst) 316 316 size(getOperandNarrow, getOperandWide, macro (get) 317 get(op , fieldName, dst)317 get(opcodeStruct, fieldName, dst) 318 318 end) 319 319 end … … 335 335 end 336 336 337 macro jumpImpl(target )338 btiz target , .outOfLineJumpTarget339 dispatchIndirect(target )337 macro jumpImpl(targetOffsetReg) 338 btiz targetOffsetReg, .outOfLineJumpTarget 339 dispatchIndirect(targetOffsetReg) 340 340 .outOfLineJumpTarget: 341 341 callSlowPath(_llint_slow_path_out_of_line_jump_target) … … 359 359 end 360 360 361 macro llintOp( name, op, fn)362 commonOp(llint_% name%, traceExecution, macro(size)361 macro llintOp(opcodeName, opcodeStruct, fn) 362 commonOp(llint_%opcodeName%, traceExecution, macro(size) 363 363 macro getImpl(fieldName, dst) 364 get(size, op , fieldName, dst)364 get(size, opcodeStruct, fieldName, dst) 365 365 end 366 366 367 367 macro dispatchImpl() 368 dispatchOp(size, name)368 dispatchOp(size, opcodeName) 369 369 end 370 370 … … 373 373 end 374 374 375 macro llintOpWithReturn( name, op, fn)376 llintOp( name, op, macro(size, get, dispatch)375 macro llintOpWithReturn(opcodeName, opcodeStruct, fn) 376 llintOp(opcodeName, opcodeStruct, macro(size, get, dispatch) 377 377 makeReturn(get, dispatch, macro (return) 378 378 fn(size, get, dispatch, return) … … 381 381 end 382 382 383 macro llintOpWithMetadata( name, op, fn)384 llintOpWithReturn( name, op, macro (size, get, dispatch, return)383 macro llintOpWithMetadata(opcodeName, opcodeStruct, fn) 384 llintOpWithReturn(opcodeName, opcodeStruct, macro (size, get, dispatch, return) 385 385 macro meta(dst, scratch) 386 metadata(size, op , dst, scratch)386 metadata(size, opcodeStruct, dst, scratch) 387 387 end 388 388 fn(size, get, dispatch, meta, return) … … 390 390 end 391 391 392 macro llintOpWithJump( name, op, impl)393 llintOpWithMetadata( name, op, macro(size, get, dispatch, metadata, return)392 macro llintOpWithJump(opcodeName, opcodeStruct, impl) 393 llintOpWithMetadata(opcodeName, opcodeStruct, macro(size, get, dispatch, metadata, return) 394 394 macro jump(fieldName) 395 395 get(fieldName, t0) … … 401 401 end 402 402 403 macro llintOpWithProfile( name, op, fn)404 llintOpWithMetadata( name, op, macro(size, get, dispatch, metadata, return)405 makeReturnProfiled(op , get, metadata, dispatch, macro (returnProfiled)403 macro llintOpWithProfile(opcodeName, opcodeStruct, fn) 404 llintOpWithMetadata(opcodeName, opcodeStruct, macro(size, get, dispatch, metadata, return) 405 makeReturnProfiled(opcodeStruct, get, metadata, dispatch, macro (returnProfiled) 406 406 fn(size, get, dispatch, returnProfiled) 407 407 end) … … 896 896 end 897 897 898 macro callTargetFunction(size, op , dispatch, callee, callPtrTag)898 macro callTargetFunction(size, opcodeStruct, dispatch, callee, callPtrTag) 899 899 if C_LOOP 900 900 cloopCallJSFunction callee … … 903 903 end 904 904 restoreStackPointerAfterCall() 905 dispatchAfterCall(size, op , dispatch)905 dispatchAfterCall(size, opcodeStruct, dispatch) 906 906 end 907 907 … … 916 916 loadi PayloadOffset + ArgumentCount[cfr], temp2 917 917 loadp CodeBlock[cfr], temp1 918 load pCodeBlock::m_numParameters[temp1], temp1918 loadi CodeBlock::m_numParameters[temp1], temp1 919 919 bilteq temp1, temp2, .noArityFixup 920 920 move temp1, temp2 … … 971 971 end 972 972 973 macro slowPathForCall(size, op , dispatch, slowPath, prepareCall)973 macro slowPathForCall(size, opcodeStruct, dispatch, slowPath, prepareCall) 974 974 callCallSlowPath( 975 975 slowPath, … … 980 980 prepareCall(callee, t2, t3, t4, SlowPathPtrTag) 981 981 .dontUpdateSP: 982 callTargetFunction(size, op , dispatch, callee, SlowPathPtrTag)982 callTargetFunction(size, opcodeStruct, dispatch, callee, SlowPathPtrTag) 983 983 end) 984 984 end … … 1193 1193 btpz t3, .argumentProfileDone # When we can't JIT, we don't allocate any argument value profiles. 1194 1194 mulp sizeof ValueProfile, t0, t2 # Aaaaahhhh! Need strength reduction! 1195 lshiftp 3, t0 1196 addp t2, t3 1195 lshiftp 3, t0 # offset of last JSValue arguments on the stack. 1196 addp t2, t3 # pointer to end of ValueProfile array in CodeBlock::m_argumentValueProfiles. 1197 1197 .argumentProfileLoop: 1198 1198 if JSVALUE64 … … 1434 1434 1435 1435 # Value-representation-agnostic code. 1436 macro slowPathOp(op )1437 llintOp(op_%op %, unused, macro (unused, unused, dispatch)1438 callSlowPath(_slow_path_%op %)1436 macro slowPathOp(opcodeName) 1437 llintOp(op_%opcodeName%, unused, macro (unused, unused, dispatch) 1438 callSlowPath(_slow_path_%opcodeName%) 1439 1439 dispatch() 1440 1440 end) … … 1482 1482 slowPathOp(unreachable) 1483 1483 1484 macro llintSlowPathOp(op )1485 llintOp(op_%op %, unused, macro (unused, unused, dispatch)1486 callSlowPath(_llint_slow_path_%op %)1484 macro llintSlowPathOp(opcodeName) 1485 llintOp(op_%opcodeName%, unused, macro (unused, unused, dispatch) 1486 callSlowPath(_llint_slow_path_%opcodeName%) 1487 1487 dispatch() 1488 1488 end) … … 1539 1539 1540 1540 llintOpWithJump(op_jmp, OpJmp, macro (size, get, jump, dispatch) 1541 jump(m_target )1541 jump(m_targetLabel) 1542 1542 end) 1543 1543 … … 1675 1675 1676 1676 1677 macro callOp( name, op, prepareCall, fn)1678 commonCallOp(op_% name%, _llint_slow_path_%name%, op, prepareCall, fn)1677 macro callOp(opcodeName, opcodeStruct, prepareCall, fn) 1678 commonCallOp(op_%opcodeName%, _llint_slow_path_%opcodeName%, opcodeStruct, prepareCall, fn) 1679 1679 end 1680 1680 … … 1691 1691 1692 1692 1693 macro doCallVarargs(size, op , dispatch, frameSlowPath, slowPath, prepareCall)1693 macro doCallVarargs(size, opcodeStruct, dispatch, frameSlowPath, slowPath, prepareCall) 1694 1694 callSlowPath(frameSlowPath) 1695 1695 branchIfException(_llint_throw_from_slow_path_trampoline) … … 1706 1706 end 1707 1707 end 1708 slowPathForCall(size, op , dispatch, slowPath, prepareCall)1708 slowPathForCall(size, opcodeStruct, dispatch, slowPath, prepareCall) 1709 1709 end 1710 1710 -
trunk/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
r240041 r240138 36 36 end 37 37 38 macro getuOperandNarrow(op , fieldName, dst)39 loadb constexpr %op %_%fieldName%_index[PC], dst40 end 41 42 macro getOperandNarrow(op , fieldName, dst)43 loadbsp constexpr %op %_%fieldName%_index[PC], dst44 end 45 46 macro getuOperandWide(op , fieldName, dst)47 loadi constexpr %op %_%fieldName%_index * 4 + 1[PC], dst48 end 49 50 macro getOperandWide(op , fieldName, dst)51 loadis constexpr %op %_%fieldName%_index * 4 + 1[PC], dst38 macro getuOperandNarrow(opcodeStruct, fieldName, dst) 39 loadb constexpr %opcodeStruct%_%fieldName%_index[PC], dst 40 end 41 42 macro getOperandNarrow(opcodeStruct, fieldName, dst) 43 loadbsp constexpr %opcodeStruct%_%fieldName%_index[PC], dst 44 end 45 46 macro getuOperandWide(opcodeStruct, fieldName, dst) 47 loadi constexpr %opcodeStruct%_%fieldName%_index * 4 + 1[PC], dst 48 end 49 50 macro getOperandWide(opcodeStruct, fieldName, dst) 51 loadis constexpr %opcodeStruct%_%fieldName%_index * 4 + 1[PC], dst 52 52 end 53 53 … … 63 63 end 64 64 65 macro makeReturnProfiled(op , get, metadata, dispatch, fn)65 macro makeReturnProfiled(opcodeStruct, get, metadata, dispatch, fn) 66 66 fn(macro (tag, payload) 67 67 move tag, t1 … … 69 69 70 70 metadata(t5, t2) 71 valueProfile(op , t5, t1, t0)71 valueProfile(opcodeStruct, t5, t1, t0) 72 72 get(m_dst, t2) 73 73 storei t1, TagOffset[cfr, t2, 8] … … 78 78 79 79 80 macro dispatchAfterCall(size, op , dispatch)80 macro dispatchAfterCall(size, opcodeStruct, dispatch) 81 81 loadi ArgumentCount + TagOffset[cfr], PC 82 get(size, op , m_dst, t3)82 get(size, opcodeStruct, m_dst, t3) 83 83 storei r1, TagOffset[cfr, t3, 8] 84 84 storei r0, PayloadOffset[cfr, t3, 8] 85 metadata(size, op , t2, t3)86 valueProfile(op , t2, r1, r0)85 metadata(size, opcodeStruct, t2, t3) 86 valueProfile(opcodeStruct, t2, r1, r0) 87 87 dispatch() 88 88 end … … 599 599 end 600 600 601 macro valueProfile(op , metadata, tag, payload)602 storei tag, %op %::Metadata::m_profile.m_buckets + TagOffset[metadata]603 storei payload, %op %::Metadata::m_profile.m_buckets + PayloadOffset[metadata]601 macro valueProfile(opcodeStruct, metadata, tag, payload) 602 storei tag, %opcodeStruct%::Metadata::m_profile.m_buckets + TagOffset[metadata] 603 storei payload, %opcodeStruct%::Metadata::m_profile.m_buckets + PayloadOffset[metadata] 604 604 end 605 605 … … 683 683 andp MarkedBlockMask, t3 684 684 loadp MarkedBlockFooterOffset + MarkedBlock::Footer::m_vm[t3], t3 685 bt iz VM::m_exception[t3], .noException685 btpz VM::m_exception[t3], .noException 686 686 jmp label 687 687 .noException: … … 735 735 llintOpWithReturn(op_get_scope, OpGetScope, macro (size, get, dispatch, return) 736 736 loadi Callee + PayloadOffset[cfr], t0 737 load iJSCallee::m_scope[t0], t0737 loadp JSCallee::m_scope[t0], t0 738 738 return (CellTag, t0) 739 739 end) … … 747 747 metadata(t2, t3) 748 748 loadp OpToThis::Metadata::m_cachedStructure[t2], t2 749 b pneq JSCell::m_structureID[t0], t2, .opToThisSlow749 bineq JSCell::m_structureID[t0], t2, .opToThisSlow 750 750 dispatch() 751 751 … … 757 757 758 758 llintOp(op_check_tdz, OpCheckTdz, macro (size, get, dispatch) 759 get(m_target , t0)759 get(m_targetVirtualRegister, t0) 760 760 loadConstantOrVariableTag(size, t0, t1) 761 761 bineq t1, EmptyValueTag, .opNotTDZ … … 787 787 788 788 789 macro equalityComparisonOp( name, op, integerComparison)790 llintOpWithReturn(op_% name%, op, macro (size, get, dispatch, return)789 macro equalityComparisonOp(opcodeName, opcodeStruct, integerComparison) 790 llintOpWithReturn(op_%opcodeName%, opcodeStruct, macro (size, get, dispatch, return) 791 791 get(m_rhs, t2) 792 792 get(m_lhs, t0) … … 800 800 801 801 .opEqSlow: 802 callSlowPath(_slow_path_% name%)802 callSlowPath(_slow_path_%opcodeName%) 803 803 dispatch() 804 804 end) … … 806 806 807 807 808 macro equalityJumpOp( name, op, integerComparison)809 llintOpWithJump(op_% name%, op, macro (size, get, jump, dispatch)808 macro equalityJumpOp(opcodeName, opcodeStruct, integerComparison) 809 llintOpWithJump(op_%opcodeName%, opcodeStruct, macro (size, get, jump, dispatch) 810 810 get(m_rhs, t2) 811 811 get(m_lhs, t0) … … 819 819 820 820 .jumpTarget: 821 jump(m_target )821 jump(m_targetLabel) 822 822 823 823 .slow: 824 callSlowPath(_llint_slow_path_% name%)824 callSlowPath(_llint_slow_path_%opcodeName%) 825 825 nextInstruction() 826 826 end) … … 828 828 829 829 830 macro equalNullComparisonOp( name, op, fn)831 llintOpWithReturn( name, op, macro (size, get, dispatch, return)830 macro equalNullComparisonOp(opcodeName, opcodeStruct, fn) 831 llintOpWithReturn(opcodeName, opcodeStruct, macro (size, get, dispatch, return) 832 832 get(m_operand, t0) 833 833 assertNotConstant(size, t0) … … 839 839 jmp .opEqNullNotImmediate 840 840 .opEqNullMasqueradesAsUndefined: 841 load pJSCell::m_structureID[t0], t1841 loadi JSCell::m_structureID[t0], t1 842 842 loadp CodeBlock[cfr], t0 843 843 loadp CodeBlock::m_globalObject[t0], t0 … … 870 870 871 871 872 macro strictEqOp( name, op, equalityOperation)873 llintOpWithReturn(op_% name%, op, macro (size, get, dispatch, return)872 macro strictEqOp(opcodeName, opcodeStruct, equalityOperation) 873 llintOpWithReturn(op_%opcodeName%, opcodeStruct, macro (size, get, dispatch, return) 874 874 get(m_rhs, t2) 875 875 get(m_lhs, t0) … … 886 886 887 887 .slow: 888 callSlowPath(_slow_path_% name%)888 callSlowPath(_slow_path_%opcodeName%) 889 889 dispatch() 890 890 end) … … 892 892 893 893 894 macro strictEqualityJumpOp( name, op, equalityOperation)895 llintOpWithJump(op_% name%, op, macro (size, get, jump, dispatch)894 macro strictEqualityJumpOp(opcodeName, opcodeStruct, equalityOperation) 895 llintOpWithJump(op_%opcodeName%, opcodeStruct, macro (size, get, jump, dispatch) 896 896 get(m_rhs, t2) 897 897 get(m_lhs, t0) … … 908 908 909 909 .jumpTarget: 910 jump(m_target )910 jump(m_targetLabel) 911 911 912 912 .slow: 913 callSlowPath(_llint_slow_path_% name%)913 callSlowPath(_llint_slow_path_%opcodeName%) 914 914 nextInstruction() 915 915 end) … … 933 933 934 934 935 macro preOp( name, op, operation)936 llintOp(op_% name%, op, macro (size, get, dispatch)935 macro preOp(opcodeName, opcodeStruct, operation) 936 llintOp(op_%opcodeName%, opcodeStruct, macro (size, get, dispatch) 937 937 get(m_srcDst, t0) 938 938 bineq TagOffset[cfr, t0, 8], Int32Tag, .slow … … 943 943 944 944 .slow: 945 callSlowPath(_slow_path_% name%)945 callSlowPath(_slow_path_%opcodeName%) 946 946 dispatch() 947 947 end) … … 993 993 994 994 macro arithProfile(type) 995 ori type, OpNegate::Metadata::m_arithProfile [t5]995 ori type, OpNegate::Metadata::m_arithProfile + ArithProfile::m_bits[t5] 996 996 end 997 997 … … 1016 1016 1017 1017 1018 macro binaryOpCustomStore( name, op, integerOperationAndStore, doubleOperation)1019 llintOpWithMetadata(op_% name%, op, macro (size, get, dispatch, metadata, return)1018 macro binaryOpCustomStore(opcodeName, opcodeStruct, integerOperationAndStore, doubleOperation) 1019 llintOpWithMetadata(op_%opcodeName%, opcodeStruct, macro (size, get, dispatch, metadata, return) 1020 1020 macro arithProfile(type) 1021 ori type, %op %::Metadata::m_arithProfile[t5]1021 ori type, %opcodeStruct%::Metadata::m_arithProfile + ArithProfile::m_bits[t5] 1022 1022 end 1023 1023 … … 1064 1064 1065 1065 .slow: 1066 callSlowPath(_slow_path_% name%)1066 callSlowPath(_slow_path_%opcodeName%) 1067 1067 dispatch() 1068 1068 end) 1069 1069 end 1070 1070 1071 macro binaryOp( name, op, integerOperation, doubleOperation)1072 binaryOpCustomStore( name, op,1071 macro binaryOp(opcodeName, opcodeStruct, integerOperation, doubleOperation) 1072 binaryOpCustomStore(opcodeName, opcodeStruct, 1073 1073 macro (int32Tag, left, right, slow, index) 1074 1074 integerOperation(left, right, slow) … … 1131 1131 1132 1132 1133 macro commonBitOp(opKind, name, op, operation)1134 opKind(op_% name%, op, macro (size, get, dispatch, return)1133 macro commonBitOp(opKind, opcodeName, opcodeStruct, operation) 1134 opKind(op_%opcodeName%, opcodeStruct, macro (size, get, dispatch, return) 1135 1135 get(m_rhs, t2) 1136 1136 get(m_lhs, t0) … … 1143 1143 1144 1144 .slow: 1145 callSlowPath(_slow_path_% name%)1145 callSlowPath(_slow_path_%opcodeName%) 1146 1146 dispatch() 1147 1147 end) 1148 1148 end 1149 1149 1150 macro bitOp( name, op, operation)1151 commonBitOp(llintOpWithReturn, name, op, operation)1152 end 1153 1154 macro bitOpProfiled( name, op, operation)1155 commonBitOp(llintOpWithProfile, name, op, operation)1150 macro bitOp(opcodeName, opcodeStruct, operation) 1151 commonBitOp(llintOpWithReturn, opcodeName, opcodeStruct, operation) 1152 end 1153 1154 macro bitOpProfiled(opcodeName, opcodeStruct, operation) 1155 commonBitOp(llintOpWithProfile, opcodeName, opcodeStruct, operation) 1156 1156 end 1157 1157 … … 1237 1237 return(BooleanTag, 0) 1238 1238 .opIsUndefinedMasqueradesAsUndefined: 1239 load pJSCell::m_structureID[t3], t11239 loadi JSCell::m_structureID[t3], t1 1240 1240 loadp CodeBlock[cfr], t3 1241 1241 loadp CodeBlock::m_globalObject[t3], t3 … … 1329 1329 metadata(t5, t0) 1330 1330 get(m_base, t0) 1331 loadi OpGetByIdDirect::Metadata::m_structure [t5], t11331 loadi OpGetByIdDirect::Metadata::m_structureID[t5], t1 1332 1332 loadConstantOrVariablePayload(size, t0, CellTag, t3, .opGetByIdDirectSlow) 1333 1333 loadi OpGetByIdDirect::Metadata::m_offset[t5], t2 … … 1350 1350 .opGetByIdProtoLoad: 1351 1351 bbneq t1, constexpr GetByIdMode::ProtoLoad, .opGetByIdArrayLength 1352 loadi OpGetById::Metadata::m_modeMetadata.protoLoadMode.structure [t5], t11352 loadi OpGetById::Metadata::m_modeMetadata.protoLoadMode.structureID[t5], t1 1353 1353 loadConstantOrVariablePayload(size, t0, CellTag, t3, .opGetByIdSlow) 1354 1354 loadis OpGetById::Metadata::m_modeMetadata.protoLoadMode.cachedOffset[t5], t2 … … 1374 1374 .opGetByIdUnset: 1375 1375 bbneq t1, constexpr GetByIdMode::Unset, .opGetByIdDefault 1376 loadi OpGetById::Metadata::m_modeMetadata.unsetMode.structure [t5], t11376 loadi OpGetById::Metadata::m_modeMetadata.unsetMode.structureID[t5], t1 1377 1377 loadConstantOrVariablePayload(size, t0, CellTag, t3, .opGetByIdSlow) 1378 1378 bineq JSCell::m_structureID[t3], t1, .opGetByIdSlow … … 1381 1381 1382 1382 .opGetByIdDefault: 1383 loadi OpGetById::Metadata::m_modeMetadata.defaultMode.structure [t5], t11383 loadi OpGetById::Metadata::m_modeMetadata.defaultMode.structureID[t5], t1 1384 1384 loadConstantOrVariablePayload(size, t0, CellTag, t3, .opGetByIdSlow) 1385 1385 loadis OpGetById::Metadata::m_modeMetadata.defaultMode.cachedOffset[t5], t2 … … 1401 1401 loadConstantOrVariablePayload(size, t3, CellTag, t0, .opPutByIdSlow) 1402 1402 loadi JSCell::m_structureID[t0], t2 1403 bineq t2, OpPutById::Metadata::m_oldStructure [t5], .opPutByIdSlow1403 bineq t2, OpPutById::Metadata::m_oldStructureID[t5], .opPutByIdSlow 1404 1404 1405 1405 # At this point, we have: … … 1409 1409 # We will lose currentStructureID in the shenanigans below. 1410 1410 1411 loadi OpPutById::Metadata::m_newStructure [t5], t11411 loadi OpPutById::Metadata::m_newStructureID[t5], t1 1412 1412 1413 1413 btiz t1, .opPutByIdNotTransition … … 1418 1418 btpz t3, .opPutByIdTransitionDirect 1419 1419 1420 loadi OpPutById::Metadata::m_oldStructure [t5], t2 # Need old structure again.1420 loadi OpPutById::Metadata::m_oldStructureID[t5], t2 # Need old structure again. 1421 1421 loadp StructureChain::m_vector[t3], t3 1422 1422 assert(macro (ok) btpnz t3, ok end) … … 1426 1426 .opPutByIdTransitionChainLoop: 1427 1427 loadp [t3], t1 1428 b pneq t1, JSCell::m_structureID[t2], .opPutByIdSlow1428 bineq t1, JSCell::m_structureID[t2], .opPutByIdSlow 1429 1429 addp 4, t3 1430 1430 loadp Structure::m_prototype[t1], t2 … … 1432 1432 1433 1433 .opPutByIdTransitionChainDone: 1434 loadi OpPutById::Metadata::m_newStructure [t5], t11434 loadi OpPutById::Metadata::m_newStructureID[t5], t1 1435 1435 1436 1436 .opPutByIdTransitionDirect: … … 1508 1508 1509 1509 1510 macro putByValOp( name, op)1511 llintOpWithMetadata(op_% name%, op, macro (size, get, dispatch, metadata, return)1510 macro putByValOp(opcodeName, opcodeStruct) 1511 llintOpWithMetadata(op_%opcodeName%, opcodeStruct, macro (size, get, dispatch, metadata, return) 1512 1512 macro contiguousPutByVal(storeCallback) 1513 1513 biaeq t3, -sizeof IndexingHeader + IndexingHeader::u.lengths.publicLength[t0], .outOfBounds … … 1519 1519 .outOfBounds: 1520 1520 biaeq t3, -sizeof IndexingHeader + IndexingHeader::u.lengths.vectorLength[t0], .opPutByValOutOfBounds 1521 storeb 1, %op %::Metadata::m_arrayProfile.m_mayStoreToHole[t5]1521 storeb 1, %opcodeStruct%::Metadata::m_arrayProfile.m_mayStoreToHole[t5] 1522 1522 addi 1, t3, t2 1523 1523 storei t2, -sizeof IndexingHeader + IndexingHeader::u.lengths.publicLength[t0] … … 1530 1530 loadConstantOrVariablePayload(size, t0, CellTag, t1, .opPutByValSlow) 1531 1531 move t1, t2 1532 arrayProfile(%op %::Metadata::m_arrayProfile, t2, t5, t0)1532 arrayProfile(%opcodeStruct%::Metadata::m_arrayProfile, t2, t5, t0) 1533 1533 get(m_property, t0) 1534 1534 loadConstantOrVariablePayload(size, t0, Int32Tag, t3, .opPutByValSlow) … … 1584 1584 1585 1585 .opPutByValArrayStorageEmpty: 1586 storeb 1, %op %::Metadata::m_arrayProfile.m_mayStoreToHole[t5]1586 storeb 1, %opcodeStruct%::Metadata::m_arrayProfile.m_mayStoreToHole[t5] 1587 1587 addi 1, ArrayStorage::m_numValuesInVector[t0] 1588 1588 bib t3, -sizeof IndexingHeader + IndexingHeader::u.lengths.publicLength[t0], .opPutByValArrayStorageStoreResult … … 1592 1592 1593 1593 .opPutByValOutOfBounds: 1594 storeb 1, %op %::Metadata::m_arrayProfile.m_outOfBounds[t5]1594 storeb 1, %opcodeStruct%::Metadata::m_arrayProfile.m_outOfBounds[t5] 1595 1595 .opPutByValSlow: 1596 callSlowPath(_llint_slow_path_% name%)1596 callSlowPath(_llint_slow_path_%opcodeName%) 1597 1597 dispatch() 1598 1598 end) … … 1605 1605 1606 1606 1607 macro llintJumpTrueOrFalseOp( name, op, conditionOp)1608 llintOpWithJump(op_% name%, op, macro (size, get, jump, dispatch)1607 macro llintJumpTrueOrFalseOp(opcodeName, opcodeStruct, conditionOp) 1608 llintOpWithJump(op_%opcodeName%, opcodeStruct, macro (size, get, jump, dispatch) 1609 1609 get(m_condition, t1) 1610 1610 loadConstantOrVariablePayload(size, t1, BooleanTag, t0, .slow) … … 1613 1613 1614 1614 .target: 1615 jump(m_target )1615 jump(m_targetLabel) 1616 1616 1617 1617 .slow: 1618 callSlowPath(_llint_slow_path_% name%)1618 callSlowPath(_llint_slow_path_%opcodeName%) 1619 1619 nextInstruction() 1620 1620 end) … … 1622 1622 1623 1623 1624 macro equalNullJumpOp( name, op, cellHandler, immediateHandler)1625 llintOpWithJump(op_% name%, op, macro (size, get, jump, dispatch)1624 macro equalNullJumpOp(opcodeName, opcodeStruct, cellHandler, immediateHandler) 1625 llintOpWithJump(op_%opcodeName%, opcodeStruct, macro (size, get, jump, dispatch) 1626 1626 get(m_value, t0) 1627 1627 assertNotConstant(size, t0) … … 1629 1629 loadi PayloadOffset[cfr, t0, 8], t0 1630 1630 bineq t1, CellTag, .immediate 1631 load pJSCell::m_structureID[t0], t21631 loadi JSCell::m_structureID[t0], t2 1632 1632 cellHandler(t2, JSCell::m_flags[t0], .target) 1633 1633 dispatch() 1634 1634 1635 1635 .target: 1636 jump(m_target )1636 jump(m_targetLabel) 1637 1637 1638 1638 .immediate: … … 1666 1666 llintOpWithMetadata(op_jneq_ptr, OpJneqPtr, macro (size, get, dispatch, metadata, return) 1667 1667 get(m_value, t0) 1668 get (m_specialPointer, t1)1668 getu(size, OpJneqPtr, m_specialPointer, t1) 1669 1669 loadp CodeBlock[cfr], t2 1670 1670 loadp CodeBlock::m_globalObject[t2], t2 … … 1675 1675 metadata(t5, t2) 1676 1676 storeb 1, OpJneqPtr::Metadata::m_hasJumped[t5] 1677 get(m_target , t0)1677 get(m_targetLabel, t0) 1678 1678 jumpImpl(t0) 1679 1679 .opJneqPtrFallThrough: … … 1682 1682 1683 1683 1684 macro compareUnsignedJumpOp( name, op, integerCompare)1685 llintOpWithJump(op_% name%, op, macro (size, get, jump, dispatch)1684 macro compareUnsignedJumpOp(opcodeName, opcodeStruct, integerCompare) 1685 llintOpWithJump(op_%opcodeName%, opcodeStruct, macro (size, get, jump, dispatch) 1686 1686 get(m_lhs, t2) 1687 1687 get(m_rhs, t3) … … 1692 1692 1693 1693 .jumpTarget: 1694 jump(m_target )1694 jump(m_targetLabel) 1695 1695 end) 1696 1696 end 1697 1697 1698 1698 1699 macro compareUnsignedOp( name, op, integerCompareAndSet)1700 llintOpWithReturn(op_% name%, op, macro (size, get, dispatch, return)1699 macro compareUnsignedOp(opcodeName, opcodeStruct, integerCompareAndSet) 1700 llintOpWithReturn(op_%opcodeName%, opcodeStruct, macro (size, get, dispatch, return) 1701 1701 get(m_rhs, t2) 1702 1702 get(m_lhs, t0) … … 1709 1709 1710 1710 1711 macro compareJumpOp( name, op, integerCompare, doubleCompare)1712 llintOpWithJump(op_% name%, op, macro (size, get, jump, dispatch)1711 macro compareJumpOp(opcodeName, opcodeStruct, integerCompare, doubleCompare) 1712 llintOpWithJump(op_%opcodeName%, opcodeStruct, macro (size, get, jump, dispatch) 1713 1713 get(m_lhs, t2) 1714 1714 get(m_rhs, t3) … … 1741 1741 1742 1742 .jumpTarget: 1743 jump(m_target )1743 jump(m_targetLabel) 1744 1744 1745 1745 .slow: 1746 callSlowPath(_llint_slow_path_% name%)1746 callSlowPath(_llint_slow_path_%opcodeName%) 1747 1747 nextInstruction() 1748 1748 end) … … 1752 1752 llintOpWithJump(op_switch_imm, OpSwitchImm, macro (size, get, jump, dispatch) 1753 1753 get(m_scrutinee, t2) 1754 get (m_tableIndex, t3)1754 getu(size, OpSwitchImm, m_tableIndex, t3) 1755 1755 loadConstantOrVariable(size, t2, t1, t0) 1756 1756 loadp CodeBlock[cfr], t2 … … 1780 1780 llintOpWithJump(op_switch_char, OpSwitchChar, macro (size, get, jump, dispatch) 1781 1781 get(m_scrutinee, t2) 1782 get (m_tableIndex, t3)1782 getu(size, OpSwitchChar, m_tableIndex, t3) 1783 1783 loadConstantOrVariable(size, t2, t1, t0) 1784 1784 loadp CodeBlock[cfr], t2 … … 1815 1815 1816 1816 1817 macro arrayProfileForCall(op , getu)1817 macro arrayProfileForCall(opcodeStruct, getu) 1818 1818 getu(m_argv, t3) 1819 1819 negi t3 1820 1820 bineq ThisArgumentOffset + TagOffset[cfr, t3, 8], CellTag, .done 1821 1821 loadi ThisArgumentOffset + PayloadOffset[cfr, t3, 8], t0 1822 load pJSCell::m_structureID[t0], t01823 store p t0, %op%::Metadata::m_arrayProfile.m_lastSeenStructureID[t5]1822 loadi JSCell::m_structureID[t0], t0 1823 storei t0, %opcodeStruct%::Metadata::m_arrayProfile.m_lastSeenStructureID[t5] 1824 1824 .done: 1825 1825 end 1826 1826 1827 macro commonCallOp( name, slowPath, op, prepareCall, prologue)1828 llintOpWithMetadata( name, op, macro (size, get, dispatch, metadata, return)1827 macro commonCallOp(opcodeName, slowPath, opcodeStruct, prepareCall, prologue) 1828 llintOpWithMetadata(opcodeName, opcodeStruct, macro (size, get, dispatch, metadata, return) 1829 1829 metadata(t5, t0) 1830 1830 1831 1831 prologue(macro (fieldName, dst) 1832 getu(size, op , fieldName, dst)1832 getu(size, opcodeStruct, fieldName, dst) 1833 1833 end, metadata) 1834 1834 1835 1835 get(m_callee, t0) 1836 loadp %op %::Metadata::m_callLinkInfo.callee[t5], t21836 loadp %opcodeStruct%::Metadata::m_callLinkInfo.callee[t5], t2 1837 1837 loadConstantOrVariablePayload(size, t0, CellTag, t3, .opCallSlow) 1838 1838 bineq t3, t2, .opCallSlow 1839 getu(size, op , m_argv, t3)1839 getu(size, opcodeStruct, m_argv, t3) 1840 1840 lshifti 3, t3 1841 1841 negi t3 1842 1842 addp cfr, t3 # t3 contains the new value of cfr 1843 1843 storei t2, Callee + PayloadOffset[t3] 1844 getu(size, op , m_argc, t2)1844 getu(size, opcodeStruct, m_argc, t2) 1845 1845 storei PC, ArgumentCount + TagOffset[cfr] 1846 1846 storei t2, ArgumentCount + PayloadOffset[t3] 1847 1847 storei CellTag, Callee + TagOffset[t3] 1848 1848 move t3, sp 1849 prepareCall(%op %::Metadata::m_callLinkInfo.machineCodeTarget[t5], t2, t3, t4, JSEntryPtrTag)1850 callTargetFunction(size, op , dispatch, %op%::Metadata::m_callLinkInfo.machineCodeTarget[t5], JSEntryPtrTag)1849 prepareCall(%opcodeStruct%::Metadata::m_callLinkInfo.machineCodeTarget[t5], t2, t3, t4, JSEntryPtrTag) 1850 callTargetFunction(size, opcodeStruct, dispatch, %opcodeStruct%::Metadata::m_callLinkInfo.machineCodeTarget[t5], JSEntryPtrTag) 1851 1851 1852 1852 .opCallSlow: 1853 slowPathForCall(size, op , dispatch, slowPath, prepareCall)1853 slowPathForCall(size, opcodeStruct, dispatch, slowPath, prepareCall) 1854 1854 end) 1855 1855 end … … 1906 1906 loadp MarkedBlockFooterOffset + MarkedBlock::Footer::m_vm[t3], t3 1907 1907 1908 load iVM::m_exception[t3], t01909 store i0, VM::m_exception[t3]1908 loadp VM::m_exception[t3], t0 1909 storep 0, VM::m_exception[t3] 1910 1910 get(size, OpCatch, m_exception, t2) 1911 1911 storei t0, PayloadOffset[cfr, t2, 8] … … 2014 2014 end 2015 2015 2016 bt inz VM::m_exception[t3], .handleException2016 btpnz VM::m_exception[t3], .handleException 2017 2017 2018 2018 functionEpilogue() … … 2069 2069 end 2070 2070 2071 bt inz VM::m_exception[t3], .handleException2071 btpnz VM::m_exception[t3], .handleException 2072 2072 2073 2073 functionEpilogue() … … 2114 2114 2115 2115 metadata(t5, t0) 2116 load pOpResolveScope::Metadata::m_resolveType[t5], t02116 loadi OpResolveScope::Metadata::m_resolveType[t5], t0 2117 2117 2118 2118 #rGlobalProperty: … … 2162 2162 2163 2163 2164 macro loadWithStructureCheck(op , get, operand, slowPath)2164 macro loadWithStructureCheck(opcodeStruct, get, operand, slowPath) 2165 2165 get(m_scope, t0) 2166 2166 loadp PayloadOffset[cfr, t0, 8], t0 2167 loadp %op %::Metadata::m_structure[t5], t12168 b pneq JSCell::m_structureID[t0], t1, slowPath2167 loadp %opcodeStruct%::Metadata::m_structure[t5], t1 2168 bineq JSCell::m_structureID[t0], t1, slowPath 2169 2169 end 2170 2170 … … 2196 2196 2197 2197 metadata(t5, t0) 2198 loadi OpGetFromScope::Metadata::m_getPutInfo [t5], t02198 loadi OpGetFromScope::Metadata::m_getPutInfo + GetPutInfo::m_operand[t5], t0 2199 2199 andi ResolveTypeMask, t0 2200 2200 … … 2254 2254 get(m_value, t1) 2255 2255 loadConstantOrVariable(size, t1, t2, t3) 2256 load isOpPutToScope::Metadata::m_operand[t5], t12256 loadp OpPutToScope::Metadata::m_operand[t5], t1 2257 2257 storePropertyAtVariableOffset(t1, t0, t2, t3) 2258 2258 end … … 2271 2271 get(m_value, t1) 2272 2272 loadConstantOrVariable(size, t1, t2, t3) 2273 load isOpPutToScope::Metadata::m_operand[t5], t12273 loadp OpPutToScope::Metadata::m_operand[t5], t1 2274 2274 storei t2, JSLexicalEnvironment_variables + TagOffset[t0, t1, 8] 2275 2275 storei t3, JSLexicalEnvironment_variables + PayloadOffset[t0, t1, 8] … … 2283 2283 notifyWrite(t1, .pDynamic) 2284 2284 .noVariableWatchpointSet: 2285 load isOpPutToScope::Metadata::m_operand[t5], t12285 loadp OpPutToScope::Metadata::m_operand[t5], t1 2286 2286 storei t2, JSLexicalEnvironment_variables + TagOffset[t0, t1, 8] 2287 2287 storei t3, JSLexicalEnvironment_variables + PayloadOffset[t0, t1, 8] … … 2290 2290 2291 2291 metadata(t5, t0) 2292 loadi OpPutToScope::Metadata::m_getPutInfo [t5], t02292 loadi OpPutToScope::Metadata::m_getPutInfo + GetPutInfo::m_operand[t5], t0 2293 2293 andi ResolveTypeMask, t0 2294 2294 … … 2369 2369 get(m_arguments, t0) 2370 2370 loadi PayloadOffset[cfr, t0, 8], t0 2371 get (m_index, t1)2371 getu(size, OpGetFromArguments, m_index, t1) 2372 2372 loadi DirectArguments_storage + TagOffset[t0, t1, 8], t2 2373 2373 loadi DirectArguments_storage + PayloadOffset[t0, t1, 8], t3 … … 2382 2382 get(m_value, t1) 2383 2383 loadConstantOrVariable(size, t1, t2, t3) 2384 get (m_index, t1)2384 getu(size, OpPutToArguments, m_index, t1) 2385 2385 storei t2, DirectArguments_storage + TagOffset[t0, t1, 8] 2386 2386 storei t3, DirectArguments_storage + PayloadOffset[t0, t1, 8] … … 2405 2405 2406 2406 # t0 is holding the payload, t5 is holding the tag. 2407 get(m_target , t2)2407 get(m_targetVirtualRegister, t2) 2408 2408 loadConstantOrVariable(size, t2, t5, t0) 2409 2409 … … 2457 2457 loadi PayloadOffset + ArgumentCount[cfr], t0 2458 2458 subi 1, t0 2459 get (m_numParametersToSkip, t1)2459 getu(size, OpGetRestLength, m_numParametersToSkip, t1) 2460 2460 bilteq t0, t1, .storeZero 2461 2461 subi t1, t0 -
trunk/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
r240041 r240138 37 37 end 38 38 39 macro getuOperandNarrow(op , fieldName, dst)40 loadb constexpr %op %_%fieldName%_index[PB, PC, 1], dst41 end 42 43 macro getOperandNarrow(op , fieldName, dst)44 loadbsp constexpr %op %_%fieldName%_index[PB, PC, 1], dst45 end 46 47 macro getuOperandWide(op , fieldName, dst)48 loadi constexpr %op %_%fieldName%_index * 4 + 1[PB, PC, 1], dst49 end 50 51 macro getOperandWide(op , fieldName, dst)52 loadis constexpr %op %_%fieldName%_index * 4 + 1[PB, PC, 1], dst39 macro getuOperandNarrow(opcodeStruct, fieldName, dst) 40 loadb constexpr %opcodeStruct%_%fieldName%_index[PB, PC, 1], dst 41 end 42 43 macro getOperandNarrow(opcodeStruct, fieldName, dst) 44 loadbsp constexpr %opcodeStruct%_%fieldName%_index[PB, PC, 1], dst 45 end 46 47 macro getuOperandWide(opcodeStruct, fieldName, dst) 48 loadi constexpr %opcodeStruct%_%fieldName%_index * 4 + 1[PB, PC, 1], dst 49 end 50 51 macro getOperandWide(opcodeStruct, fieldName, dst) 52 loadis constexpr %opcodeStruct%_%fieldName%_index * 4 + 1[PB, PC, 1], dst 53 53 end 54 54 … … 62 62 end 63 63 64 macro makeReturnProfiled(op , get, metadata, dispatch, fn)64 macro makeReturnProfiled(opcodeStruct, get, metadata, dispatch, fn) 65 65 fn(macro (value) 66 66 move value, t3 67 67 metadata(t1, t2) 68 valueProfile(op , t1, t3)68 valueProfile(opcodeStruct, t1, t3) 69 69 get(m_dst, t1) 70 70 storeq t3, [cfr, t1, 8] … … 73 73 end 74 74 75 macro valueProfile(op , metadata, value)76 storeq value, %op %::Metadata::m_profile.m_buckets[metadata]77 end 78 79 macro dispatchAfterCall(size, op , dispatch)75 macro valueProfile(opcodeStruct, metadata, value) 76 storeq value, %opcodeStruct%::Metadata::m_profile.m_buckets[metadata] 77 end 78 79 macro dispatchAfterCall(size, opcodeStruct, dispatch) 80 80 loadi ArgumentCount + TagOffset[cfr], PC 81 81 loadp CodeBlock[cfr], PB 82 82 loadp CodeBlock::m_instructionsRawPointer[PB], PB 83 83 unpoison(_g_CodeBlockPoison, PB, t1) 84 get(size, op , m_dst, t1)84 get(size, opcodeStruct, m_dst, t1) 85 85 storeq r0, [cfr, t1, 8] 86 metadata(size, op , t2, t1)87 valueProfile(op , t2, r0)86 metadata(size, opcodeStruct, t2, t1) 87 valueProfile(opcodeStruct, t2, r0) 88 88 dispatch() 89 89 end … … 711 711 712 712 llintOp(op_check_tdz, OpCheckTdz, macro (size, get, dispatch) 713 get(m_target , t0)713 get(m_targetVirtualRegister, t0) 714 714 loadConstantOrVariable(size, t0, t1) 715 715 bqneq t1, ValueEmpty, .opNotTDZ … … 742 742 743 743 744 macro equalityComparisonOp( name, op, integerComparison)745 llintOpWithReturn(op_% name%, op, macro (size, get, dispatch, return)744 macro equalityComparisonOp(opcodeName, opcodeStruct, integerComparison) 745 llintOpWithReturn(op_%opcodeName%, opcodeStruct, macro (size, get, dispatch, return) 746 746 get(m_rhs, t0) 747 747 get(m_lhs, t2) … … 753 753 754 754 .slow: 755 callSlowPath(_slow_path_% name%)755 callSlowPath(_slow_path_%opcodeName%) 756 756 dispatch() 757 757 end) … … 759 759 760 760 761 macro equalNullComparisonOp( name, op, fn)762 llintOpWithReturn( name, op, macro (size, get, dispatch, return)761 macro equalNullComparisonOp(opcodeName, opcodeStruct, fn) 762 llintOpWithReturn(opcodeName, opcodeStruct, macro (size, get, dispatch, return) 763 763 get(m_operand, t0) 764 764 loadq [cfr, t0, 8], t0 … … 800 800 801 801 802 macro strictEqOp( name, op, equalityOperation)803 llintOpWithReturn(op_% name%, op, macro (size, get, dispatch, return)802 macro strictEqOp(opcodeName, opcodeStruct, equalityOperation) 803 llintOpWithReturn(op_%opcodeName%, opcodeStruct, macro (size, get, dispatch, return) 804 804 get(m_rhs, t0) 805 805 get(m_lhs, t2) … … 820 820 821 821 .slow: 822 callSlowPath(_slow_path_% name%)822 callSlowPath(_slow_path_%opcodeName%) 823 823 dispatch() 824 824 end) … … 834 834 835 835 836 macro strictEqualityJumpOp( name, op, equalityOperation)837 llintOpWithJump(op_% name%, op, macro (size, get, jump, dispatch)836 macro strictEqualityJumpOp(opcodeName, opcodeStruct, equalityOperation) 837 llintOpWithJump(op_%opcodeName%, opcodeStruct, macro (size, get, jump, dispatch) 838 838 get(m_lhs, t2) 839 839 get(m_rhs, t3) … … 853 853 854 854 .jumpTarget: 855 jump(m_target )855 jump(m_targetLabel) 856 856 857 857 .slow: 858 callSlowPath(_llint_slow_path_% name%)858 callSlowPath(_llint_slow_path_%opcodeName%) 859 859 nextInstruction() 860 860 end) … … 870 870 871 871 872 macro preOp( name, op, arithmeticOperation)873 llintOp(op_% name%, op, macro (size, get, dispatch)872 macro preOp(opcodeName, opcodeStruct, arithmeticOperation) 873 llintOp(op_%opcodeName%, opcodeStruct, macro (size, get, dispatch) 874 874 get(m_srcDst, t0) 875 875 loadq [cfr, t0, 8], t1 … … 880 880 dispatch() 881 881 .slow: 882 callSlowPath(_slow_path_% name%)882 callSlowPath(_slow_path_%opcodeName%) 883 883 dispatch() 884 884 end) … … 930 930 loadConstantOrVariable(size, t0, t3) 931 931 metadata(t1, t2) 932 loadi s OpNegate::Metadata::m_arithProfile[t1], t2932 loadi OpNegate::Metadata::m_arithProfile + ArithProfile::m_bits[t1], t2 933 933 bqb t3, tagTypeNumber, .opNegateNotInt 934 934 btiz t3, 0x7fffffff, .opNegateSlow … … 936 936 orq tagTypeNumber, t3 937 937 ori ArithProfileInt, t2 938 storei t2, OpNegate::Metadata::m_arithProfile [t1]938 storei t2, OpNegate::Metadata::m_arithProfile + ArithProfile::m_bits[t1] 939 939 return(t3) 940 940 .opNegateNotInt: … … 942 942 xorq 0x8000000000000000, t3 943 943 ori ArithProfileNumber, t2 944 storei t2, OpNegate::Metadata::m_arithProfile [t1]944 storei t2, OpNegate::Metadata::m_arithProfile + ArithProfile::m_bits[t1] 945 945 return(t3) 946 946 … … 951 951 952 952 953 macro binaryOpCustomStore( name, op, integerOperationAndStore, doubleOperation)954 llintOpWithMetadata(op_% name%, op, macro (size, get, dispatch, metadata, return)953 macro binaryOpCustomStore(opcodeName, opcodeStruct, integerOperationAndStore, doubleOperation) 954 llintOpWithMetadata(op_%opcodeName%, opcodeStruct, macro (size, get, dispatch, metadata, return) 955 955 metadata(t5, t0) 956 956 957 957 macro profile(type) 958 ori type, %op %::Metadata::m_arithProfile[t5]958 ori type, %opcodeStruct%::Metadata::m_arithProfile + ArithProfile::m_bits[t5] 959 959 end 960 960 … … 1008 1008 1009 1009 .slow: 1010 callSlowPath(_slow_path_% name%)1010 callSlowPath(_slow_path_%opcodeName%) 1011 1011 dispatch() 1012 1012 end) … … 1053 1053 1054 1054 1055 macro binaryOp( name, op, integerOperation, doubleOperation)1056 binaryOpCustomStore( name, op,1055 macro binaryOp(opcodeName, opcodeStruct, integerOperation, doubleOperation) 1056 binaryOpCustomStore(opcodeName, opcodeStruct, 1057 1057 macro (left, right, slow, index) 1058 1058 integerOperation(left, right, slow) … … 1084 1084 1085 1085 1086 macro commonBitOp(opKind, name, op, operation)1087 opKind(op_% name%, op, macro (size, get, dispatch, return)1086 macro commonBitOp(opKind, opcodeName, opcodeStruct, operation) 1087 opKind(op_%opcodeName%, opcodeStruct, macro (size, get, dispatch, return) 1088 1088 get(m_rhs, t0) 1089 1089 get(m_lhs, t2) … … 1097 1097 1098 1098 .slow: 1099 callSlowPath(_slow_path_% name%)1099 callSlowPath(_slow_path_%opcodeName%) 1100 1100 dispatch() 1101 1101 end) 1102 1102 end 1103 1103 1104 macro bitOp( name, op, operation)1105 commonBitOp(llintOpWithReturn, name, op, operation)1106 end 1107 1108 macro bitOpProfiled( name, op, operation)1109 commonBitOp(llintOpWithProfile, name, op, operation)1104 macro bitOp(opcodeName, opcodeStruct, operation) 1105 commonBitOp(llintOpWithReturn, opcodeName, opcodeStruct, operation) 1106 end 1107 1108 macro bitOpProfiled(opcodeName, opcodeStruct, operation) 1109 commonBitOp(llintOpWithProfile, opcodeName, opcodeStruct, operation) 1110 1110 end 1111 1111 … … 1270 1270 loadConstantOrVariableCell(size, t0, t3, .opGetByIdDirectSlow) 1271 1271 loadi JSCell::m_structureID[t3], t1 1272 loadi OpGetByIdDirect::Metadata::m_structure [t2], t01272 loadi OpGetByIdDirect::Metadata::m_structureID[t2], t0 1273 1273 bineq t0, t1, .opGetByIdDirectSlow 1274 1274 loadi OpGetByIdDirect::Metadata::m_offset[t2], t1 … … 1292 1292 bbneq t1, constexpr GetByIdMode::Default, .opGetByIdProtoLoad 1293 1293 loadi JSCell::m_structureID[t3], t1 1294 loadi OpGetById::Metadata::m_modeMetadata.defaultMode.structure [t2], t01294 loadi OpGetById::Metadata::m_modeMetadata.defaultMode.structureID[t2], t0 1295 1295 bineq t0, t1, .opGetByIdSlow 1296 1296 loadis OpGetById::Metadata::m_modeMetadata.defaultMode.cachedOffset[t2], t1 … … 1302 1302 bbneq t1, constexpr GetByIdMode::ProtoLoad, .opGetByIdArrayLength 1303 1303 loadi JSCell::m_structureID[t3], t1 1304 loadi OpGetById::Metadata::m_modeMetadata.protoLoadMode.structure [t2], t31304 loadi OpGetById::Metadata::m_modeMetadata.protoLoadMode.structureID[t2], t3 1305 1305 bineq t3, t1, .opGetByIdSlow 1306 1306 loadis OpGetById::Metadata::m_modeMetadata.protoLoadMode.cachedOffset[t2], t1 … … 1325 1325 .opGetByIdUnset: 1326 1326 loadi JSCell::m_structureID[t3], t1 1327 loadi OpGetById::Metadata::m_modeMetadata.unsetMode.structure [t2], t01327 loadi OpGetById::Metadata::m_modeMetadata.unsetMode.structureID[t2], t0 1328 1328 bineq t0, t1, .opGetByIdSlow 1329 1329 valueProfile(OpGetById, t2, ValueUndefined) … … 1340 1340 loadConstantOrVariableCell(size, t3, t0, .opPutByIdSlow) 1341 1341 metadata(t5, t2) 1342 loadi s OpPutById::Metadata::m_oldStructure[t5], t21342 loadi OpPutById::Metadata::m_oldStructureID[t5], t2 1343 1343 bineq t2, JSCell::m_structureID[t0], .opPutByIdSlow 1344 1344 … … 1348 1348 # t5 -> metadata 1349 1349 1350 loadi OpPutById::Metadata::m_newStructure [t5], t11350 loadi OpPutById::Metadata::m_newStructureID[t5], t1 1351 1351 btiz t1, .opPutByIdNotTransition 1352 1352 … … 1381 1381 .opPutByIdTransitionChainDone: 1382 1382 # Reload the new structure, since we clobbered it above. 1383 loadi OpPutById::Metadata::m_newStructure [t5], t11383 loadi OpPutById::Metadata::m_newStructureID[t5], t1 1384 1384 1385 1385 .opPutByIdTransitionDirect: … … 1575 1575 1576 1576 1577 macro putByValOp( name, op)1578 llintOpWithMetadata(op_% name%, op, macro (size, get, dispatch, metadata, return)1577 macro putByValOp(opcodeName, opcodeStruct) 1578 llintOpWithMetadata(op_%opcodeName%, opcodeStruct, macro (size, get, dispatch, metadata, return) 1579 1579 macro contiguousPutByVal(storeCallback) 1580 1580 biaeq t3, -sizeof IndexingHeader + IndexingHeader::u.lengths.publicLength[t0], .outOfBounds … … 1586 1586 .outOfBounds: 1587 1587 biaeq t3, -sizeof IndexingHeader + IndexingHeader::u.lengths.vectorLength[t0], .opPutByValOutOfBounds 1588 storeb 1, %op %::Metadata::m_arrayProfile.m_mayStoreToHole[t5]1588 storeb 1, %opcodeStruct%::Metadata::m_arrayProfile.m_mayStoreToHole[t5] 1589 1589 addi 1, t3, t2 1590 1590 storei t2, -sizeof IndexingHeader + IndexingHeader::u.lengths.publicLength[t0] … … 1596 1596 move t1, t2 1597 1597 metadata(t5, t0) 1598 arrayProfile(%op %::Metadata::m_arrayProfile, t2, t5, t0)1598 arrayProfile(%opcodeStruct%::Metadata::m_arrayProfile, t2, t5, t0) 1599 1599 get(m_property, t0) 1600 1600 loadConstantOrVariableInt32(size, t0, t3, .opPutByValSlow) … … 1651 1651 1652 1652 .opPutByValArrayStorageEmpty: 1653 storeb 1, %op %::Metadata::m_arrayProfile.m_mayStoreToHole[t5]1653 storeb 1, %opcodeStruct%::Metadata::m_arrayProfile.m_mayStoreToHole[t5] 1654 1654 addi 1, ArrayStorage::m_numValuesInVector[t0] 1655 1655 bib t3, -sizeof IndexingHeader + IndexingHeader::u.lengths.publicLength[t0], .opPutByValArrayStorageStoreResult … … 1659 1659 1660 1660 .opPutByValOutOfBounds: 1661 storeb 1, %op %::Metadata::m_arrayProfile.m_outOfBounds[t5]1661 storeb 1, %opcodeStruct%::Metadata::m_arrayProfile.m_outOfBounds[t5] 1662 1662 .opPutByValSlow: 1663 callSlowPath(_llint_slow_path_% name%)1663 callSlowPath(_llint_slow_path_%opcodeName%) 1664 1664 dispatch() 1665 1665 end) … … 1671 1671 1672 1672 1673 macro llintJumpTrueOrFalseOp( name, op, conditionOp)1674 llintOpWithJump(op_% name%, op, macro (size, get, jump, dispatch)1673 macro llintJumpTrueOrFalseOp(opcodeName, opcodeStruct, conditionOp) 1674 llintOpWithJump(op_%opcodeName%, opcodeStruct, macro (size, get, jump, dispatch) 1675 1675 get(m_condition, t1) 1676 1676 loadConstantOrVariable(size, t1, t0) … … 1680 1680 1681 1681 .target: 1682 jump(m_target )1682 jump(m_targetLabel) 1683 1683 1684 1684 .slow: 1685 callSlowPath(_llint_slow_path_% name%)1685 callSlowPath(_llint_slow_path_%opcodeName%) 1686 1686 nextInstruction() 1687 1687 end) … … 1689 1689 1690 1690 1691 macro equalNullJumpOp( name, op, cellHandler, immediateHandler)1692 llintOpWithJump(op_% name%, op, macro (size, get, jump, dispatch)1691 macro equalNullJumpOp(opcodeName, opcodeStruct, cellHandler, immediateHandler) 1692 llintOpWithJump(op_%opcodeName%, opcodeStruct, macro (size, get, jump, dispatch) 1693 1693 get(m_value, t0) 1694 1694 assertNotConstant(size, t0) … … 1700 1700 1701 1701 .target: 1702 jump(m_target )1702 jump(m_targetLabel) 1703 1703 1704 1704 .immediate: … … 1732 1732 llintOpWithMetadata(op_jneq_ptr, OpJneqPtr, macro (size, get, dispatch, metadata, return) 1733 1733 get(m_value, t0) 1734 get (m_specialPointer, t1)1734 getu(size, OpJneqPtr, m_specialPointer, t1) 1735 1735 loadp CodeBlock[cfr], t2 1736 1736 loadp CodeBlock::m_globalObject[t2], t2 … … 1742 1742 metadata(t5, t0) 1743 1743 storeb 1, OpJneqPtr::Metadata::m_hasJumped[t5] 1744 get(m_target , t0)1744 get(m_targetLabel, t0) 1745 1745 jumpImpl(t0) 1746 1746 end) 1747 1747 1748 1748 1749 macro compareJumpOp( name, op, integerCompare, doubleCompare)1750 llintOpWithJump(op_% name%, op, macro (size, get, jump, dispatch)1749 macro compareJumpOp(opcodeName, opcodeStruct, integerCompare, doubleCompare) 1750 llintOpWithJump(op_%opcodeName%, opcodeStruct, macro (size, get, jump, dispatch) 1751 1751 get(m_lhs, t2) 1752 1752 get(m_rhs, t3) … … 1782 1782 1783 1783 .jumpTarget: 1784 jump(m_target )1784 jump(m_targetLabel) 1785 1785 1786 1786 .slow: 1787 callSlowPath(_llint_slow_path_% name%)1787 callSlowPath(_llint_slow_path_%opcodeName%) 1788 1788 nextInstruction() 1789 1789 end) … … 1791 1791 1792 1792 1793 macro equalityJumpOp( name, op, integerComparison)1794 llintOpWithJump(op_% name%, op, macro (size, get, jump, dispatch)1793 macro equalityJumpOp(opcodeName, opcodeStruct, integerComparison) 1794 llintOpWithJump(op_%opcodeName%, opcodeStruct, macro (size, get, jump, dispatch) 1795 1795 get(m_lhs, t2) 1796 1796 get(m_rhs, t3) … … 1801 1801 1802 1802 .jumpTarget: 1803 jump(m_target )1803 jump(m_targetLabel) 1804 1804 1805 1805 .slow: 1806 callSlowPath(_llint_slow_path_% name%)1806 callSlowPath(_llint_slow_path_%opcodeName%) 1807 1807 nextInstruction() 1808 1808 end) … … 1810 1810 1811 1811 1812 macro compareUnsignedJumpOp( name, op, integerCompareMacro)1813 llintOpWithJump(op_% name%, op, macro (size, get, jump, dispatch)1812 macro compareUnsignedJumpOp(opcodeName, opcodeStruct, integerCompareMacro) 1813 llintOpWithJump(op_%opcodeName%, opcodeStruct, macro (size, get, jump, dispatch) 1814 1814 get(m_lhs, t2) 1815 1815 get(m_rhs, t3) … … 1820 1820 1821 1821 .jumpTarget: 1822 jump(m_target )1822 jump(m_targetLabel) 1823 1823 end) 1824 1824 end 1825 1825 1826 1826 1827 macro compareUnsignedOp( name, op, integerCompareAndSet)1828 llintOpWithReturn(op_% name%, op, macro (size, get, dispatch, return)1827 macro compareUnsignedOp(opcodeName, opcodeStruct, integerCompareAndSet) 1828 llintOpWithReturn(op_%opcodeName%, opcodeStruct, macro (size, get, dispatch, return) 1829 1829 get(m_lhs, t2) 1830 1830 get(m_rhs, t0) … … 1840 1840 llintOpWithJump(op_switch_imm, OpSwitchImm, macro (size, get, jump, dispatch) 1841 1841 get(m_scrutinee, t2) 1842 get (m_tableIndex, t3)1842 getu(size, OpSwitchImm, m_tableIndex, t3) 1843 1843 loadConstantOrVariable(size, t2, t1) 1844 1844 loadp CodeBlock[cfr], t2 … … 1868 1868 llintOpWithJump(op_switch_char, OpSwitchChar, macro (size, get, jump, dispatch) 1869 1869 get(m_scrutinee, t2) 1870 get (m_tableIndex, t3)1870 getu(size, OpSwitchChar, m_tableIndex, t3) 1871 1871 loadConstantOrVariable(size, t2, t1) 1872 1872 loadp CodeBlock[cfr], t2 … … 1904 1904 1905 1905 # we assume t5 contains the metadata, and we should not scratch that 1906 macro arrayProfileForCall(op , getu)1906 macro arrayProfileForCall(opcodeStruct, getu) 1907 1907 getu(m_argv, t3) 1908 1908 negp t3 … … 1910 1910 btqnz t0, tagMask, .done 1911 1911 loadi JSCell::m_structureID[t0], t3 1912 storei t3, %op %::Metadata::m_arrayProfile.m_lastSeenStructureID[t5]1912 storei t3, %opcodeStruct%::Metadata::m_arrayProfile.m_lastSeenStructureID[t5] 1913 1913 .done: 1914 1914 end 1915 1915 1916 macro commonCallOp( name, slowPath, op, prepareCall, prologue)1917 llintOpWithMetadata( name, op, macro (size, get, dispatch, metadata, return)1916 macro commonCallOp(opcodeName, slowPath, opcodeStruct, prepareCall, prologue) 1917 llintOpWithMetadata(opcodeName, opcodeStruct, macro (size, get, dispatch, metadata, return) 1918 1918 metadata(t5, t0) 1919 1919 1920 1920 prologue(macro (fieldName, dst) 1921 getu(size, op , fieldName, dst)1921 getu(size, opcodeStruct, fieldName, dst) 1922 1922 end, metadata) 1923 1923 1924 1924 get(m_callee, t0) 1925 loadp %op %::Metadata::m_callLinkInfo.callee[t5], t21925 loadp %opcodeStruct%::Metadata::m_callLinkInfo.callee[t5], t2 1926 1926 loadConstantOrVariable(size, t0, t3) 1927 1927 bqneq t3, t2, .opCallSlow 1928 getu(size, op , m_argv, t3)1928 getu(size, opcodeStruct, m_argv, t3) 1929 1929 lshifti 3, t3 1930 1930 negp t3 1931 1931 addp cfr, t3 1932 1932 storeq t2, Callee[t3] 1933 getu(size, op , m_argc, t2)1933 getu(size, opcodeStruct, m_argc, t2) 1934 1934 storei PC, ArgumentCount + TagOffset[cfr] 1935 1935 storei t2, ArgumentCount + PayloadOffset[t3] … … 1937 1937 if POISON 1938 1938 loadp _g_JITCodePoison, t2 1939 xorp %op %::Metadata::m_callLinkInfo.machineCodeTarget[t5], t21939 xorp %opcodeStruct%::Metadata::m_callLinkInfo.machineCodeTarget[t5], t2 1940 1940 prepareCall(t2, t1, t3, t4, JSEntryPtrTag) 1941 callTargetFunction(size, op , dispatch, t2, JSEntryPtrTag)1941 callTargetFunction(size, opcodeStruct, dispatch, t2, JSEntryPtrTag) 1942 1942 else 1943 prepareCall(%op %::Metadata::m_callLinkInfo.machineCodeTarget[t5], t2, t3, t4, JSEntryPtrTag)1944 callTargetFunction(size, op , dispatch, %op%::Metadata::m_callLinkInfo.machineCodeTarget[t5], JSEntryPtrTag)1943 prepareCall(%opcodeStruct%::Metadata::m_callLinkInfo.machineCodeTarget[t5], t2, t3, t4, JSEntryPtrTag) 1944 callTargetFunction(size, opcodeStruct, dispatch, %opcodeStruct%::Metadata::m_callLinkInfo.machineCodeTarget[t5], JSEntryPtrTag) 1945 1945 end 1946 1946 1947 1947 .opCallSlow: 1948 slowPathForCall(size, op , dispatch, slowPath, prepareCall)1948 slowPathForCall(size, opcodeStruct, dispatch, slowPath, prepareCall) 1949 1949 end) 1950 1950 end … … 2171 2171 end 2172 2172 2173 load pOpResolveScope::Metadata::m_resolveType[t5], t02173 loadi OpResolveScope::Metadata::m_resolveType[t5], t0 2174 2174 2175 2175 #rGlobalProperty: … … 2219 2219 2220 2220 2221 macro loadWithStructureCheck(op , get, slowPath)2221 macro loadWithStructureCheck(opcodeStruct, get, slowPath) 2222 2222 get(m_scope, t0) 2223 2223 loadq [cfr, t0, 8], t0 2224 2224 loadStructureWithScratch(t0, t2, t1, t3) 2225 loadp %op %::Metadata::m_structure[t5], t12225 loadp %opcodeStruct%::Metadata::m_structure[t5], t1 2226 2226 bpneq t2, t1, slowPath 2227 2227 end … … 2252 2252 end 2253 2253 2254 loadi OpGetFromScope::Metadata::m_getPutInfo [t5], t02254 loadi OpGetFromScope::Metadata::m_getPutInfo + GetPutInfo::m_operand[t5], t0 2255 2255 andi ResolveTypeMask, t0 2256 2256 … … 2310 2310 get(m_value, t1) 2311 2311 loadConstantOrVariable(size, t1, t2) 2312 load isOpPutToScope::Metadata::m_operand[t5], t12312 loadp OpPutToScope::Metadata::m_operand[t5], t1 2313 2313 storePropertyAtVariableOffset(t1, t0, t2) 2314 2314 end … … 2326 2326 get(m_value, t1) 2327 2327 loadConstantOrVariable(size, t1, t2) 2328 load isOpPutToScope::Metadata::m_operand[t5], t12328 loadp OpPutToScope::Metadata::m_operand[t5], t1 2329 2329 storeq t2, JSLexicalEnvironment_variables[t0, t1, 8] 2330 2330 end … … 2337 2337 notifyWrite(t3, .pDynamic) 2338 2338 .noVariableWatchpointSet: 2339 load isOpPutToScope::Metadata::m_operand[t5], t12339 loadp OpPutToScope::Metadata::m_operand[t5], t1 2340 2340 storeq t2, JSLexicalEnvironment_variables[t0, t1, 8] 2341 2341 end 2342 2342 2343 2343 macro checkTDZInGlobalPutToScopeIfNecessary() 2344 loadi s OpPutToScope::Metadata::m_getPutInfo[t5], t02344 loadi OpPutToScope::Metadata::m_getPutInfo + GetPutInfo::m_operand[t5], t0 2345 2345 andi InitializationModeMask, t0 2346 2346 rshifti InitializationModeShift, t0 … … 2353 2353 2354 2354 metadata(t5, t0) 2355 loadi OpPutToScope::Metadata::m_getPutInfo [t5], t02355 loadi OpPutToScope::Metadata::m_getPutInfo + GetPutInfo::m_operand[t5], t0 2356 2356 andi ResolveTypeMask, t0 2357 2357 … … 2467 2467 2468 2468 # t0 is holding the JSValue argument. 2469 get(m_target , t3)2469 get(m_targetVirtualRegister, t3) 2470 2470 loadConstantOrVariable(size, t3, t0) 2471 2471 -
trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.cpp
r240041 r240138 126 126 CHECK_EXCEPTION(); \ 127 127 if (bCondition) \ 128 pc = bytecode.m_target \129 ? reinterpret_cast<const Instruction*>(reinterpret_cast<const uint8_t*>(pc) + bytecode.m_target ) \128 pc = bytecode.m_targetLabel \ 129 ? reinterpret_cast<const Instruction*>(reinterpret_cast<const uint8_t*>(pc) + bytecode.m_targetLabel) \ 130 130 : exec->codeBlock()->outOfLineJumpTarget(pc); \ 131 131 else \ -
trunk/Source/JavaScriptCore/runtime/GetPutInfo.h
r237547 r240138 1 1 /* 2 * Copyright (C) 2015-201 8Apple Inc. All Rights Reserved.2 * Copyright (C) 2015-2019 Apple Inc. All Rights Reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 39 39 }; 40 40 41 enum ResolveType {41 enum ResolveType : unsigned { 42 42 // Lexical scope guaranteed a certain type of variable access. 43 43 GlobalProperty, … … 211 211 static_assert((modeBits & initializationBits & typeBits) == 0x0, "There should be no intersection between ResolveMode ResolveType and InitializationMode"); 212 212 213 GetPutInfo() = default; 214 213 215 GetPutInfo(ResolveMode resolveMode, ResolveType resolveType, InitializationMode initializationMode) 214 216 : m_operand((resolveMode << modeShift) | (static_cast<unsigned>(initializationMode) << initializationShift) | resolveType) … … 229 231 230 232 private: 231 Operand m_operand; 233 Operand m_operand { 0 }; 234 235 friend class JSC::LLIntOffsetsExtractor; 232 236 }; 233 237
Note: See TracChangeset
for help on using the changeset viewer.