Changeset 64943 in webkit
- Timestamp:
- Aug 8, 2010 12:22:06 AM (14 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 1 deleted
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/Android.mk
r64938 r64943 53 53 jit/JITCall.cpp \ 54 54 jit/JITCall32_64.cpp \ 55 jit/JITMarkObjects.cpp \56 55 jit/JITOpcodes.cpp \ 57 56 jit/JITPropertyAccess.cpp \ -
trunk/JavaScriptCore/CMakeLists.txt
r64938 r64943 56 56 jit/JITCall.cpp 57 57 jit/JIT.cpp 58 jit/JITMarkObjects.cpp59 58 jit/JITOpcodes32_64.cpp 60 59 jit/JITOpcodes.cpp -
trunk/JavaScriptCore/ChangeLog
r64938 r64943 1 2010-08-07 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r64938. 4 http://trac.webkit.org/changeset/64938 5 https://bugs.webkit.org/show_bug.cgi?id=43685 6 7 Did not compile on several ports (Requested by abarth on 8 #webkit). 9 10 * Android.mk: 11 * CMakeLists.txt: 12 * GNUmakefile.am: 13 * JavaScriptCore.gypi: 14 * JavaScriptCore.pro: 15 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 16 * JavaScriptCore.xcodeproj/project.pbxproj: 17 * assembler/AbstractMacroAssembler.h: 18 * assembler/MacroAssembler.h: 19 * assembler/MacroAssemblerX86.h: 20 (JSC::MacroAssemblerX86::load32): 21 (JSC::MacroAssemblerX86::store32): 22 * assembler/X86Assembler.h: 23 (JSC::X86Assembler::movl_rm): 24 (JSC::X86Assembler::movl_mr): 25 * bytecode/CodeBlock.cpp: 26 (JSC::CodeBlock::markAggregate): 27 * bytecode/Instruction.h: 28 (JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::): 29 (JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::set): 30 (JSC::PolymorphicAccessStructureList::PolymorphicAccessStructureList): 31 * bytecode/StructureStubInfo.cpp: 32 (JSC::StructureStubInfo::deref): 33 * bytecode/StructureStubInfo.h: 34 (JSC::StructureStubInfo::initGetByIdProto): 35 (JSC::StructureStubInfo::initGetByIdChain): 36 (JSC::StructureStubInfo::): 37 * jit/JIT.h: 38 * jit/JITMarkObjects.cpp: Removed. 39 * jit/JITPropertyAccess.cpp: 40 (JSC::JIT::compileGetDirectOffset): 41 (JSC::JIT::testPrototype): 42 (JSC::JIT::privateCompilePutByIdTransition): 43 (JSC::JIT::privateCompileGetByIdProto): 44 (JSC::JIT::privateCompileGetByIdProtoList): 45 (JSC::JIT::privateCompileGetByIdChainList): 46 (JSC::JIT::privateCompileGetByIdChain): 47 * jit/JITPropertyAccess32_64.cpp: 48 (JSC::JIT::compileGetDirectOffset): 49 (JSC::JIT::testPrototype): 50 (JSC::JIT::privateCompilePutByIdTransition): 51 (JSC::JIT::privateCompileGetByIdProto): 52 (JSC::JIT::privateCompileGetByIdProtoList): 53 (JSC::JIT::privateCompileGetByIdChainList): 54 (JSC::JIT::privateCompileGetByIdChain): 55 * jit/JITStubs.cpp: 56 (JSC::setupPolymorphicProtoList): 57 * wtf/Platform.h: 58 1 59 2010-08-07 Nathan Lawrence <nlawrence@apple.com> 2 60 -
trunk/JavaScriptCore/GNUmakefile.am
r64938 r64943 166 166 JavaScriptCore/jit/JIT.h \ 167 167 JavaScriptCore/jit/JITInlineMethods.h \ 168 JavaScriptCore/jit/JITMarkObjects.cpp \169 168 JavaScriptCore/jit/JITOpcodes32_64.cpp \ 170 169 JavaScriptCore/jit/JITOpcodes.cpp \ -
trunk/JavaScriptCore/JavaScriptCore.gypi
r64938 r64943 119 119 'jit/JITCode.h', 120 120 'jit/JITInlineMethods.h', 121 'jit/JITMarkObjects.cpp',122 121 'jit/JITOpcodes.cpp', 123 122 'jit/JITOpcodes32_64.cpp', -
trunk/JavaScriptCore/JavaScriptCore.pro
r64938 r64943 101 101 jit/JITCall32_64.cpp \ 102 102 jit/JIT.cpp \ 103 jit/JITMarkObjects.cpp \104 103 jit/JITOpcodes.cpp \ 105 104 jit/JITOpcodes32_64.cpp \ -
trunk/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
r64938 r64943 1690 1690 </File> 1691 1691 <File 1692 RelativePath="..\..\jit\JITMarkObjects.cpp"1693 >1694 <File1695 1692 RelativePath="..\..\jit\JITOpcodes.cpp" 1696 1693 > -
trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r64938 r64943 510 510 BCFD8C930EEB2EE700283848 /* JumpTable.h in Headers */ = {isa = PBXBuildFile; fileRef = BCFD8C910EEB2EE700283848 /* JumpTable.h */; }; 511 511 C0A272630E50A06300E96E15 /* NotFound.h in Headers */ = {isa = PBXBuildFile; fileRef = C0A2723F0E509F1E00E96E15 /* NotFound.h */; settings = {ATTRIBUTES = (Private, ); }; }; 512 DD23669811DBB22D00AF47C8 /* JITMarkObjects.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DD23669711DBB22D00AF47C8 /* JITMarkObjects.cpp */; };513 512 DD2724681208D1FF00F9ABE7 /* AlignedMemoryAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = DD2724671208D1FF00F9ABE7 /* AlignedMemoryAllocator.h */; }; 514 513 DD2724691208D1FF00F9ABE7 /* AlignedMemoryAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = DD2724671208D1FF00F9ABE7 /* AlignedMemoryAllocator.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 1064 1063 D21202280AD4310C00ED79B6 /* DateConversion.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DateConversion.cpp; sourceTree = "<group>"; }; 1065 1064 D21202290AD4310C00ED79B6 /* DateConversion.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DateConversion.h; sourceTree = "<group>"; }; 1066 DD23669711DBB22D00AF47C8 /* JITMarkObjects.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITMarkObjects.cpp; sourceTree = "<group>"; };1067 1065 DD2724671208D1FF00F9ABE7 /* AlignedMemoryAllocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AlignedMemoryAllocator.h; sourceTree = "<group>"; }; 1068 1066 DD377CBB12072C18006A2517 /* Bitmap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Bitmap.h; sourceTree = "<group>"; }; … … 1275 1273 isa = PBXGroup; 1276 1274 children = ( 1277 DD23669711DBB22D00AF47C8 /* JITMarkObjects.cpp */,1278 1275 A7B48DB60EE74CFC00DCBDB6 /* ExecutableAllocator.cpp */, 1279 1276 A7B48DB50EE74CFC00DCBDB6 /* ExecutableAllocator.h */, … … 2679 2676 DDF7ABD511F60ED200108E36 /* GCActivityCallbackCF.cpp in Sources */, 2680 2677 8627E5EB11F1281900A313B5 /* PageAllocation.cpp in Sources */, 2681 DD23669811DBB22D00AF47C8 /* JITMarkObjects.cpp in Sources */,2682 2678 DDE82AD71209D955005C1756 /* GCHandle.cpp in Sources */, 2683 2679 ); -
trunk/JavaScriptCore/assembler/AbstractMacroAssembler.h
r64938 r64943 522 522 } 523 523 524 static int32_t int32AtLocation(CodeLocationDataLabel32 dataLabel32)525 {526 return AssemblerType::int32AtLocation(dataLabel32.dataLocation());527 }528 529 static void* pointerAtLocation(CodeLocationDataLabelPtr dataLabelPtr)530 {531 return AssemblerType::pointerAtLocation(dataLabelPtr.dataLocation());532 }533 534 static void* jumpTarget(CodeLocationJump jump)535 {536 return AssemblerType::jumpTarget(jump.dataLocation());537 }538 539 524 static void repatchInt32(CodeLocationDataLabel32 dataLabel32, int32_t value) 540 525 { -
trunk/JavaScriptCore/assembler/MacroAssembler.h
r64938 r64943 210 210 } 211 211 212 void loadPtrWithPatch(void* address, RegisterID dest)213 {214 load32WithPatch(address, dest);215 }216 212 217 213 void loadPtr(ImplicitAddress address, RegisterID dest) -
trunk/JavaScriptCore/assembler/MacroAssemblerX86.h
r64938 r64943 83 83 } 84 84 85 void load32 WithPatch(void* address, RegisterID dest)85 void load32(void* address, RegisterID dest) 86 86 { 87 87 m_assembler.movl_mr(address, dest); 88 }89 90 void load32(void* address, RegisterID dest)91 {92 if (dest == X86Registers::eax)93 m_assembler.movl_mEAX(address);94 else95 m_assembler.movl_mr(address, dest);96 88 } 97 89 … … 114 106 void store32(RegisterID src, void* address) 115 107 { 116 if (src == X86Registers::eax) 117 m_assembler.movl_EAXm(address); 118 else 119 m_assembler.movl_rm(src, address); 108 m_assembler.movl_rm(src, address); 120 109 } 121 110 -
trunk/JavaScriptCore/assembler/X86Assembler.h
r64938 r64943 1155 1155 void movl_rm(RegisterID src, void* addr) 1156 1156 { 1157 m_formatter.oneByteOp(OP_MOV_EvGv, src, addr); 1157 if (src == X86Registers::eax) 1158 movl_EAXm(addr); 1159 else 1160 m_formatter.oneByteOp(OP_MOV_EvGv, src, addr); 1158 1161 } 1159 1162 1160 1163 void movl_mr(void* addr, RegisterID dst) 1161 1164 { 1162 m_formatter.oneByteOp(OP_MOV_GvEv, dst, addr); 1165 if (dst == X86Registers::eax) 1166 movl_mEAX(addr); 1167 else 1168 m_formatter.oneByteOp(OP_MOV_GvEv, dst, addr); 1163 1169 } 1164 1170 … … 1552 1558 1553 1559 setPointer(reinterpret_cast<char*>(code) + where.m_offset, value); 1554 }1555 1556 static int32_t int32AtLocation(void* where)1557 {1558 return static_cast<int32_t*>(where)[-1];1559 }1560 1561 static void* pointerAtLocation(void* where)1562 {1563 return static_cast<void**>(where)[-1];1564 }1565 1566 static void* jumpTarget(void* jump)1567 {1568 intptr_t src = reinterpret_cast<intptr_t>(jump);1569 int32_t offset = static_cast<int32_t*>(jump)[-1];1570 return reinterpret_cast<void*>(src + offset);1571 1560 } 1572 1561 -
trunk/JavaScriptCore/bytecode/CodeBlock.cpp
r64938 r64943 1521 1521 m_functionDecls[i]->markAggregate(markStack); 1522 1522 markStack.append(m_globalObject); 1523 #if ENABLE(MOVABLE_GC_OBJECTS)1524 // This is the code that is responsible for marking the actual pointers1525 // to JSCell*s in the JIT'ed code. Normally, these pointers are marked1526 // elsewhere, however when we have movable objects, we will need to update1527 // all of the references.1528 for (size_t i = 0; i < m_structureStubInfos.size(); ++i)1529 m_structureStubInfos[i].markAggregate(markStack, this);1530 #endif1531 1523 } 1532 1524 -
trunk/JavaScriptCore/bytecode/Instruction.h
r64938 r64943 64 64 StructureChain* chain; 65 65 } u; 66 #if ENABLE(MOVABLE_GC_OBJECTS)67 int count;68 PropertySlot::CachedPropertyType propertyType;69 #endif70 66 71 67 void set(PolymorphicAccessStructureListStubRoutineType _stubRoutine, Structure* _base) … … 77 73 } 78 74 79 #if ENABLE(MOVABLE_GC_OBJECTS)80 void set(PolymorphicAccessStructureListStubRoutineType _stubRoutine, Structure* _base, Structure* _proto, PropertySlot::CachedPropertyType _propertyType)81 #else82 75 void set(PolymorphicAccessStructureListStubRoutineType _stubRoutine, Structure* _base, Structure* _proto) 83 #endif84 76 { 85 77 stubRoutine = _stubRoutine; … … 87 79 u.proto = _proto; 88 80 isChain = false; 89 #if ENABLE(MOVABLE_GC_OBJECTS)90 propertyType = _propertyType;91 #endif92 81 } 93 82 94 #if ENABLE(MOVABLE_GC_OBJECTS)95 void set(PolymorphicAccessStructureListStubRoutineType _stubRoutine, Structure* _base, StructureChain* _chain, int _count, PropertySlot::CachedPropertyType _propertyType)96 #else97 83 void set(PolymorphicAccessStructureListStubRoutineType _stubRoutine, Structure* _base, StructureChain* _chain) 98 #endif99 84 { 100 85 stubRoutine = _stubRoutine; … … 102 87 u.chain = _chain; 103 88 isChain = true; 104 #if ENABLE(MOVABLE_GC_OBJECTS)105 count = _count;106 propertyType = _propertyType;107 #endif108 89 } 109 90 } list[POLYMORPHIC_LIST_CACHE_SIZE]; … … 114 95 } 115 96 116 #if ENABLE(MOVABLE_GC_OBJECTS)117 PolymorphicAccessStructureList(PolymorphicAccessStructureListStubRoutineType stubRoutine, Structure* firstBase, Structure* firstProto, PropertySlot::CachedPropertyType propertyType)118 {119 list[0].set(stubRoutine, firstBase, firstProto, propertyType);120 }121 #else122 97 PolymorphicAccessStructureList(PolymorphicAccessStructureListStubRoutineType stubRoutine, Structure* firstBase, Structure* firstProto) 123 98 { 124 99 list[0].set(stubRoutine, firstBase, firstProto); 125 100 } 126 #endif127 101 128 #if ENABLE(MOVABLE_GC_OBJECTS)129 PolymorphicAccessStructureList(PolymorphicAccessStructureListStubRoutineType stubRoutine, Structure* firstBase, StructureChain* firstChain, int count, PropertySlot::CachedPropertyType propertyType)130 {131 list[0].set(stubRoutine, firstBase, firstChain, count, propertyType);132 }133 #else134 102 PolymorphicAccessStructureList(PolymorphicAccessStructureListStubRoutineType stubRoutine, Structure* firstBase, StructureChain* firstChain) 135 103 { 136 104 list[0].set(stubRoutine, firstBase, firstChain); 137 105 } 138 #endif139 106 140 107 void derefStructures(int count) -
trunk/JavaScriptCore/bytecode/StructureStubInfo.cpp
r64938 r64943 26 26 #include "config.h" 27 27 #include "StructureStubInfo.h" 28 29 #include "JIT.h"30 28 31 29 namespace JSC { … … 78 76 } 79 77 } 80 81 #if ENABLE(MOVABLE_GC_OBJECTS)82 void StructureStubInfo::markAggregate(MarkStack& markStack, CodeBlock* codeBlock)83 {84 switch (accessType) {85 case access_get_by_id_proto:86 JIT::markGetByIdProto(markStack, codeBlock, this);87 return;88 case access_get_by_id_chain:89 JIT::markGetByIdChain(markStack, codeBlock, this);90 return;91 case access_get_by_id_proto_list:92 JIT::markGetByIdProtoList(markStack, codeBlock, this);93 return;94 case access_put_by_id_transition:95 JIT::markPutByIdTransition(markStack, codeBlock, this);96 return;97 case access_get_by_id_self:98 case access_get_by_id_self_list:99 case access_put_by_id_replace:100 case access_get_by_id:101 case access_put_by_id:102 case access_get_by_id_generic:103 case access_put_by_id_generic:104 case access_get_array_length:105 case access_get_string_length:106 return;107 default:108 ASSERT_NOT_REACHED();109 }110 }111 #endif112 113 78 #endif 114 79 -
trunk/JavaScriptCore/bytecode/StructureStubInfo.h
r64938 r64943 31 31 #include "Instruction.h" 32 32 #include "MacroAssembler.h" 33 #include "PropertySlot.h"34 33 #include "Opcode.h" 35 34 #include "Structure.h" … … 68 67 } 69 68 70 #if ENABLE(MOVABLE_GC_OBJECTS)71 void initGetByIdProto(Structure* baseObjectStructure, Structure* prototypeStructure, CodeLocationLabel routine, PropertySlot::CachedPropertyType propertyType)72 #else73 69 void initGetByIdProto(Structure* baseObjectStructure, Structure* prototypeStructure, CodeLocationLabel routine) 74 #endif75 70 { 76 71 accessType = access_get_by_id_proto; … … 83 78 84 79 stubRoutine = routine; 85 86 #if ENABLE(MOVABLE_GC_OBJECTS)87 u.getByIdProto.propertyType = propertyType;88 #endif89 80 } 90 81 91 #if ENABLE(MOVABLE_GC_OBJECTS)92 void initGetByIdChain(Structure* baseObjectStructure, StructureChain* chain, CodeLocationLabel routine, int count, PropertySlot::CachedPropertyType propertyType)93 #else94 82 void initGetByIdChain(Structure* baseObjectStructure, StructureChain* chain, CodeLocationLabel routine) 95 #endif96 83 { 97 84 accessType = access_get_by_id_chain; … … 104 91 105 92 stubRoutine = routine; 106 107 #if ENABLE(MOVABLE_GC_OBJECTS)108 u.getByIdChain.count = count;109 u.getByIdChain.propertyType = propertyType;110 #endif111 93 } 112 94 … … 158 140 159 141 void deref(); 160 #if ENABLE(MOVABLE_GC_OBJECTS)161 void markAggregate(MarkStack&, CodeBlock*);162 #endif163 142 164 143 bool seenOnce() … … 182 161 Structure* baseObjectStructure; 183 162 Structure* prototypeStructure; 184 #if ENABLE(MOVABLE_GC_OBJECTS)185 // The propertyType is required to properly determine the186 // structure of the underlying code so that we may patch it187 // correctly. Different code is generated for different188 // property types, and therefore, the offsets that we need to189 // patch at will change.190 PropertySlot::CachedPropertyType propertyType;191 #endif192 163 } getByIdProto; 193 164 struct { 194 165 Structure* baseObjectStructure; 195 166 StructureChain* chain; 196 #if ENABLE(MOVABLE_GC_OBJECTS)197 // We need the count so that we can iterate over the prototype198 // chain, marking all of the references to objects.199 int count;200 PropertySlot::CachedPropertyType propertyType;201 #endif202 167 } getByIdChain; 203 168 struct { -
trunk/JavaScriptCore/jit/JIT.h
r64938 r64943 238 238 static void patchMethodCallProto(CodeBlock* codeblock, MethodCallLinkInfo&, JSFunction*, Structure*, JSObject*, ReturnAddressPtr); 239 239 240 #if ENABLE(MOVABLE_GC_OBJECTS)241 static void patchPrototypeStructureAddress(CodeLocationDataLabelPtr, MarkStack&, RepatchBuffer&);242 static void patchGetDirectOffset(CodeLocationLabel, MarkStack&, RepatchBuffer&, PropertySlot::CachedPropertyType);243 static void markGetByIdChainInternal(CodeLocationLabel, MarkStack&, RepatchBuffer&, PropertySlot::CachedPropertyType);244 245 static void markGetByIdProto(MarkStack&, CodeBlock*, StructureStubInfo*);246 static void markGetByIdChain(MarkStack&, CodeBlock*, StructureStubInfo*);247 static void markGetByIdProtoList(MarkStack&, CodeBlock*, StructureStubInfo*);248 static void markPutByIdTransition(MarkStack&, CodeBlock*, StructureStubInfo*);249 static void markGlobalObjectReference(MarkStack&, CodeBlock*, CodeLocationDataLabelPtr);250 #endif251 252 240 static bool compilePatchGetArrayLength(JSGlobalData* globalData, CodeBlock* codeBlock, StructureStubInfo* stubInfo, ReturnAddressPtr returnAddress) 253 241 { … … 308 296 void emitLoadInt32ToDouble(unsigned index, FPRegisterID value); 309 297 310 unsigned testPrototype(JSValue, JumpList& failureCases);298 void testPrototype(JSValue, JumpList& failureCases); 311 299 312 300 #if USE(JSVALUE32_64) … … 379 367 static const int patchOffsetMethodCheckProtoStruct = 18; 380 368 static const int patchOffsetMethodCheckPutFunction = 29; 381 382 static const int patchOffsetGetByIdProtoStruct = 19;383 static const int patchOffsetPutByIdProtoStruct = 12;384 static const int patchLengthTestPrototype = 16;385 static const int patchLengthBranchPtr = 10;386 static const int patchLengthMove = 6;387 static const int patchLengthStore = 10;388 369 #elif CPU(ARM_TRADITIONAL) 389 370 // These architecture specific value are used to enable patching - see comment on op_put_by_id. … … 556 537 static const int patchOffsetMethodCheckProtoStruct = 30; 557 538 static const int patchOffsetMethodCheckPutFunction = 50; 558 559 static const int patchOffsetGetByIdProtoStruct = 40;560 static const int patchOffsetPutByIdProtoStruct = 20;561 static const int patchLengthTestPrototype = 29;562 static const int patchLengthBranchPtr = 9;563 static const int patchLengthMove = 10;564 static const int patchLengthStore = 13;565 539 #elif CPU(X86) 566 540 // These architecture specific value are used to enable patching - see comment on op_put_by_id. -
trunk/JavaScriptCore/jit/JITPropertyAccess.cpp
r64938 r64943 574 574 } 575 575 576 void JIT::compileGetDirectOffset(JSObject* base, RegisterID , RegisterID result, size_t cachedOffset)576 void JIT::compileGetDirectOffset(JSObject* base, RegisterID temp, RegisterID result, size_t cachedOffset) 577 577 { 578 578 if (base->isUsingInlineStorage()) … … 580 580 else { 581 581 PropertyStorage* protoPropertyStorage = &base->m_externalStorage; 582 loadPtr(static_cast<void*>(protoPropertyStorage), result);583 loadPtr(Address( result, cachedOffset * sizeof(JSValue)), result);582 loadPtr(static_cast<void*>(protoPropertyStorage), temp); 583 loadPtr(Address(temp, cachedOffset * sizeof(JSValue)), result); 584 584 } 585 585 } 586 586 587 unsigned JIT::testPrototype(JSValue prototype, JumpList& failureCases)587 void JIT::testPrototype(JSValue prototype, JumpList& failureCases) 588 588 { 589 589 if (prototype.isNull()) 590 return 0; 591 592 Label testPrototypeBegin(this); 590 return; 591 593 592 // We have a special case for X86_64 here because X86 instructions that take immediate values 594 593 // only take 32 bit immediate values, wheras the pointer constants we are using here are 64 bit … … 601 600 failureCases.append(branchPtr(NotEqual, AbsoluteAddress(&asCell(prototype)->m_structure), ImmPtr(asCell(prototype)->structure()))); 602 601 #endif 603 ASSERT_JIT_OFFSET(differenceBetween(testPrototypeBegin, Label(this)), patchLengthTestPrototype);604 605 return patchLengthTestPrototype;606 602 } 607 603 608 604 bool JIT::privateCompilePutByIdTransition(StructureStubInfo* stubInfo, Structure* oldStructure, Structure* newStructure, size_t cachedOffset, StructureChain* chain, ReturnAddressPtr returnAddress, bool direct) 609 605 { 610 Label putByIdTransitionBegin(this);611 606 JumpList failureCases; 612 607 // Check eax is an object of the right Structure. 613 608 failureCases.append(emitJumpIfNotJSCell(regT0)); 614 609 failureCases.append(branchPtr(NotEqual, Address(regT0, OBJECT_OFFSETOF(JSCell, m_structure)), ImmPtr(oldStructure))); 615 616 unsigned offset = patchOffsetPutByIdProtoStruct + patchLengthBranchPtr; 617 ASSERT_JIT_OFFSET(differenceBetween(putByIdTransitionBegin, Label(this)), offset); 618 619 offset += testPrototype(oldStructure->storedPrototype(), failureCases); 620 ASSERT_JIT_OFFSET(differenceBetween(putByIdTransitionBegin, Label(this)), offset); 610 testPrototype(oldStructure->storedPrototype(), failureCases); 621 611 622 612 // ecx = baseObject->m_structure 623 613 if (!direct) { 624 for (RefPtr<Structure>* it = chain->head(); *it; ++it) { 625 offset += testPrototype((*it)->storedPrototype(), failureCases); 626 ASSERT_JIT_OFFSET(differenceBetween(putByIdTransitionBegin, Label(this)), offset); 627 } 614 for (RefPtr<Structure>* it = chain->head(); *it; ++it) 615 testPrototype((*it)->storedPrototype(), failureCases); 628 616 } 629 617 … … 784 772 bool JIT::privateCompileGetByIdProto(StructureStubInfo* stubInfo, Structure* structure, Structure* prototypeStructure, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset, ReturnAddressPtr returnAddress, CallFrame* callFrame) 785 773 { 786 Label getByIdProtoBegin(this);787 774 // The prototype object definitely exists (if this stub exists the CodeBlock is referencing a Structure that is 788 775 // referencing the prototype object - let's speculatively load it's table nice and early!) … … 801 788 #endif 802 789 803 ASSERT_JIT_OFFSET(differenceBetween(getByIdProtoBegin, Label(this)), patchOffsetGetByIdProtoStruct + patchLengthBranchPtr);804 790 bool needsStubLink = false; 805 791 … … 852 838 // We don't want to patch more than once - in future go to cti_op_put_by_id_generic. 853 839 repatchBuffer.relinkCallerToFunction(returnAddress, FunctionPtr(cti_op_get_by_id_proto_list)); 854 #if ENABLE(MOVABLE_GC_OBJECTS)855 stubInfo->initGetByIdProto(structure, prototypeStructure, entryLabel, slot.cachedPropertyType());856 #else857 840 stubInfo->initGetByIdProto(structure, prototypeStructure, entryLabel); 858 #endif859 841 return true; 860 842 } … … 927 909 bool JIT::privateCompileGetByIdProtoList(StructureStubInfo* stubInfo, Structure* structure, Structure* prototypeStructure, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset, CallFrame* callFrame) 928 910 { 929 Label getByIdProtoListBegin(this);930 911 PolymorphicAccessStructureList* prototypeStructures = stubInfo->u.getByIdProtoList.structureList; 931 912 int currentIndex = stubInfo->u.getByIdProtoList.listSize; … … 946 927 Jump failureCases2 = branchPtr(NotEqual, AbsoluteAddress(prototypeStructureAddress), ImmPtr(prototypeStructure)); 947 928 #endif 948 949 ASSERT_JIT_OFFSET(differenceBetween(getByIdProtoListBegin, Label(this)), patchOffsetGetByIdProtoStruct + patchLengthBranchPtr);950 929 951 930 // Checks out okay! … … 995 974 structure->ref(); 996 975 prototypeStructure->ref(); 997 #if ENABLE(MOVABLE_GC_OBJECTS)998 prototypeStructures->list[currentIndex].set(entryLabel, structure, prototypeStructure, slot.cachedPropertyType());999 #else1000 976 prototypeStructures->list[currentIndex].set(entryLabel, structure, prototypeStructure); 1001 #endif1002 977 1003 978 // Finally patch the jump to slow case back in the hot path to jump here instead. … … 1015 990 1016 991 ASSERT(count); 1017 1018 Label getByIdChainListBegin(this);1019 992 JumpList bucketsOfFail; 1020 993 … … 1030 1003 currStructure = it->get(); 1031 1004 testPrototype(protoObject, bucketsOfFail); 1032 ASSERT_JIT_OFFSET(differenceBetween(getByIdChainListBegin, Label(this)),1033 patchOffsetGetByIdProtoStruct + patchLengthBranchPtr + i * patchLengthTestPrototype);1034 1005 } 1035 1006 ASSERT(protoObject); … … 1080 1051 structure->ref(); 1081 1052 chain->ref(); 1082 #if ENABLE(MOVABLE_GC_OBJECTS)1083 prototypeStructures->list[currentIndex].set(entryLabel, structure, chain, count, slot.cachedPropertyType());1084 #else1085 1053 prototypeStructures->list[currentIndex].set(entryLabel, structure, chain); 1086 #endif1087 1054 1088 1055 // Finally patch the jump to slow case back in the hot path to jump here instead. … … 1098 1065 ASSERT(count); 1099 1066 1100 Label getByIdChainBegin(this);1101 1067 JumpList bucketsOfFail; 1102 1068 … … 1111 1077 currStructure = it->get(); 1112 1078 testPrototype(protoObject, bucketsOfFail); 1113 ASSERT_JIT_OFFSET(differenceBetween(getByIdChainBegin, Label(this)),1114 patchOffsetGetByIdProtoStruct + patchLengthBranchPtr + i * patchLengthTestPrototype);1115 1079 } 1116 1080 ASSERT(protoObject); … … 1164 1128 // We don't want to patch more than once - in future go to cti_op_put_by_id_generic. 1165 1129 repatchBuffer.relinkCallerToFunction(returnAddress, FunctionPtr(cti_op_get_by_id_proto_list)); 1166 #if ENABLE(MOVABLE_GC_OBJECTS)1167 stubInfo->initGetByIdChain(structure, chain, entryLabel, count, slot.cachedPropertyType());1168 #else1169 1130 stubInfo->initGetByIdChain(structure, chain, entryLabel); 1170 #endif1171 1172 1131 return true; 1173 1132 } -
trunk/JavaScriptCore/jit/JITPropertyAccess32_64.cpp
r64938 r64943 575 575 void JIT::compileGetDirectOffset(JSObject* base, RegisterID temp, RegisterID resultTag, RegisterID resultPayload, size_t cachedOffset) 576 576 { 577 Label directOffsetBegin(this);578 577 if (base->isUsingInlineStorage()) { 579 // On X86, load32 will optimize for a slightly smaller instruction in the case that resultPayoad is regT0 580 // Since we want this instruction to always be the same length, we use load32WithPatch to avoid this problem 581 load32WithPatch(reinterpret_cast<char*>(&base->m_inlineStorage[cachedOffset]) + OBJECT_OFFSETOF(JSValue, u.asBits.payload), resultPayload); 582 ASSERT_JIT_OFFSET(differenceBetween(directOffsetBegin, Label(this)), patchLengthMove); 578 load32(reinterpret_cast<char*>(&base->m_inlineStorage[cachedOffset]) + OBJECT_OFFSETOF(JSValue, u.asBits.payload), resultPayload); 583 579 load32(reinterpret_cast<char*>(&base->m_inlineStorage[cachedOffset]) + OBJECT_OFFSETOF(JSValue, u.asBits.tag), resultTag); 584 580 return; … … 588 584 589 585 PropertyStorage* protoPropertyStorage = &base->m_externalStorage; 590 loadPtrWithPatch(static_cast<void*>(protoPropertyStorage), temp); 591 ASSERT_JIT_OFFSET(differenceBetween(directOffsetBegin, Label(this)), patchLengthMove); 586 loadPtr(static_cast<void*>(protoPropertyStorage), temp); 592 587 load32(Address(temp, offset + OBJECT_OFFSETOF(JSValue, u.asBits.payload)), resultPayload); 593 588 load32(Address(temp, offset + OBJECT_OFFSETOF(JSValue, u.asBits.tag)), resultTag); 594 589 } 595 590 596 unsigned JIT::testPrototype(JSValue prototype, JumpList& failureCases)591 void JIT::testPrototype(JSValue prototype, JumpList& failureCases) 597 592 { 598 593 if (prototype.isNull()) 599 return 0; 600 601 Label testPrototypeBegin(this); 594 return; 595 602 596 // We have a special case for X86_64 here because X86 instructions that take immediate values 603 597 // only take 32 bit immediate values, wheras the pointer constants we are using here are 64 bit … … 610 604 failureCases.append(branchPtr(NotEqual, AbsoluteAddress(&asCell(prototype)->m_structure), ImmPtr(asCell(prototype)->structure()))); 611 605 #endif 612 ASSERT_JIT_OFFSET(differenceBetween(testPrototypeBegin, Label(this)), patchLengthTestPrototype);613 614 return patchLengthTestPrototype;615 606 } 616 607 … … 619 610 // It is assumed that regT0 contains the basePayload and regT1 contains the baseTag. The value can be found on the stack. 620 611 621 Label putByIdTransitionBegin(this);622 612 JumpList failureCases; 623 613 failureCases.append(branch32(NotEqual, regT1, Imm32(JSValue::CellTag))); 624 614 failureCases.append(branchPtr(NotEqual, Address(regT0, OBJECT_OFFSETOF(JSCell, m_structure)), ImmPtr(oldStructure))); 625 626 int offset = patchOffsetPutByIdProtoStruct + patchLengthBranchPtr; 627 ASSERT_JIT_OFFSET(differenceBetween(putByIdTransitionBegin, Label(this)), offset); 628 629 offset += testPrototype(oldStructure->storedPrototype(), failureCases); 630 ASSERT_JIT_OFFSET(differenceBetween(putByIdTransitionBegin, Label(this)), offset); 615 testPrototype(oldStructure->storedPrototype(), failureCases); 631 616 632 617 if (!direct) { 633 618 // Verify that nothing in the prototype chain has a setter for this property. 634 for (RefPtr<Structure>* it = chain->head(); *it; ++it) { 635 offset += testPrototype((*it)->storedPrototype(), failureCases); 636 ASSERT_JIT_OFFSET(differenceBetween(putByIdTransitionBegin, Label(this)), offset); 637 } 619 for (RefPtr<Structure>* it = chain->head(); *it; ++it) 620 testPrototype((*it)->storedPrototype(), failureCases); 638 621 } 639 622 640 623 // Reallocate property storage if needed. 641 624 Call callTarget; … … 800 783 // regT0 holds a JSCell* 801 784 802 Label getByIdProtoBegin(this);803 785 // The prototype object definitely exists (if this stub exists the CodeBlock is referencing a Structure that is 804 786 // referencing the prototype object - let's speculatively load it's table nice and early!) … … 815 797 Jump failureCases2 = branchPtr(NotEqual, AbsoluteAddress(prototypeStructureAddress), ImmPtr(prototypeStructure)); 816 798 #endif 817 ASSERT_JIT_OFFSET(differenceBetween(getByIdProtoBegin, Label(this)), patchOffsetGetByIdProtoStruct + patchLengthBranchPtr);818 819 799 bool needsStubLink = false; 820 800 // Checks out okay! … … 869 849 // We don't want to patch more than once - in future go to cti_op_put_by_id_generic. 870 850 repatchBuffer.relinkCallerToFunction(returnAddress, FunctionPtr(cti_op_get_by_id_proto_list)); 871 #if ENABLE(MOVABLE_GC_OBJECTS)872 stubInfo->initGetByIdProto(structure, prototypeStructure, entryLabel, slot.cachedPropertyType());873 #else874 851 stubInfo->initGetByIdProto(structure, prototypeStructure, entryLabel); 875 #endif876 852 return true; 877 853 } … … 951 927 // regT0 holds a JSCell* 952 928 953 Label getByIdProtoListBegin(this);954 929 // The prototype object definitely exists (if this stub exists the CodeBlock is referencing a Structure that is 955 930 // referencing the prototype object - let's speculatively load it's table nice and early!) … … 967 942 Jump failureCases2 = branchPtr(NotEqual, AbsoluteAddress(prototypeStructureAddress), ImmPtr(prototypeStructure)); 968 943 #endif 969 ASSERT_JIT_OFFSET(differenceBetween(getByIdProtoListBegin, Label(this)), patchOffsetGetByIdProtoStruct + patchLengthBranchPtr);970 944 971 945 bool needsStubLink = false; … … 988 962 } else 989 963 compileGetDirectOffset(protoObject, regT2, regT1, regT0, cachedOffset); 990 964 991 965 Jump success = jump(); 992 966 … … 1013 987 structure->ref(); 1014 988 prototypeStructure->ref(); 1015 #if ENABLE(MOVABLE_GC_OBJECTS)1016 prototypeStructures->list[currentIndex].set(entryLabel, structure, prototypeStructure, slot.cachedPropertyType());1017 #else1018 989 prototypeStructures->list[currentIndex].set(entryLabel, structure, prototypeStructure); 1019 #endif 1020 990 1021 991 // Finally patch the jump to slow case back in the hot path to jump here instead. 1022 992 CodeLocationJump jumpLocation = stubInfo->hotPathBegin.jumpAtOffset(patchOffsetGetByIdBranchToSlowCase); … … 1035 1005 ASSERT(count); 1036 1006 1037 Label getByIdChainListBegin(this);1038 1007 JumpList bucketsOfFail; 1039 1008 … … 1048 1017 currStructure = it->get(); 1049 1018 testPrototype(protoObject, bucketsOfFail); 1050 1051 ASSERT_JIT_OFFSET(differenceBetween(getByIdChainListBegin, Label(this)),1052 patchOffsetGetByIdProtoStruct + patchLengthBranchPtr + static_cast<int>(i) * patchLengthTestPrototype);1053 1019 } 1054 1020 ASSERT(protoObject); … … 1073 1039 } else 1074 1040 compileGetDirectOffset(protoObject, regT2, regT1, regT0, cachedOffset); 1075 1041 1076 1042 Jump success = jump(); 1077 1043 … … 1099 1065 structure->ref(); 1100 1066 chain->ref(); 1101 #if ENABLE(MOVABLE_GC_OBJECTS)1102 prototypeStructures->list[currentIndex].set(entryLabel, structure, chain, count, slot.cachedPropertyType());1103 #else1104 1067 prototypeStructures->list[currentIndex].set(entryLabel, structure, chain); 1105 #endif 1106 1068 1107 1069 // Finally patch the jump to slow case back in the hot path to jump here instead. 1108 1070 CodeLocationJump jumpLocation = stubInfo->hotPathBegin.jumpAtOffset(patchOffsetGetByIdBranchToSlowCase); … … 1118 1080 ASSERT(count); 1119 1081 1120 Label getByIdChainBegin(this);1121 1082 JumpList bucketsOfFail; 1122 1083 … … 1131 1092 currStructure = it->get(); 1132 1093 testPrototype(protoObject, bucketsOfFail); 1133 1134 ASSERT_JIT_OFFSET(differenceBetween(getByIdChainBegin, Label(this)),1135 patchOffsetGetByIdProtoStruct + patchLengthBranchPtr + static_cast<int>(i) * patchLengthTestPrototype);1136 1094 } 1137 1095 ASSERT(protoObject); … … 1184 1142 // We don't want to patch more than once - in future go to cti_op_put_by_id_generic. 1185 1143 repatchBuffer.relinkCallerToFunction(returnAddress, FunctionPtr(cti_op_get_by_id_proto_list)); 1186 #if ENABLE(MOVABLE_GC_OBJECTS)1187 stubInfo->initGetByIdChain(structure, chain, entryLabel, count, slot.cachedPropertyType());1188 #else1189 1144 stubInfo->initGetByIdChain(structure, chain, entryLabel); 1190 #endif1191 1145 return true; 1192 1146 } -
trunk/JavaScriptCore/jit/JITStubs.cpp
r64938 r64943 1598 1598 { 1599 1599 if (stubInfo->accessType == access_get_by_id_proto) 1600 #if ENABLE(MOVABLE_GC_OBJECTS)1601 stubInfo->initGetByIdProtoList(new PolymorphicAccessStructureList(stubInfo->stubRoutine, stubInfo->u.getByIdProto.baseObjectStructure, stubInfo->u.getByIdProto.prototypeStructure, stubInfo->u.getByIdProto.propertyType));1602 #else1603 1600 stubInfo->initGetByIdProtoList(new PolymorphicAccessStructureList(stubInfo->stubRoutine, stubInfo->u.getByIdProto.baseObjectStructure, stubInfo->u.getByIdProto.prototypeStructure)); 1604 #endif1605 1601 else if (stubInfo->accessType == access_get_by_id_chain) 1606 #if ENABLE(MOVABLE_GC_OBJECTS)1607 stubInfo->initGetByIdProtoList(new PolymorphicAccessStructureList(stubInfo->stubRoutine, stubInfo->u.getByIdChain.baseObjectStructure, stubInfo->u.getByIdChain.chain, stubInfo->u.getByIdChain.count, stubInfo->u.getByIdChain.propertyType));1608 #else1609 1602 stubInfo->initGetByIdProtoList(new PolymorphicAccessStructureList(stubInfo->stubRoutine, stubInfo->u.getByIdChain.baseObjectStructure, stubInfo->u.getByIdChain.chain)); 1610 #endif1611 1603 ASSERT(stubInfo->accessType == access_get_by_id_proto_list); 1612 1604 } -
trunk/JavaScriptCore/wtf/Platform.h
r64938 r64943 1083 1083 #define ENABLE_JSC_ZOMBIES 0 1084 1084 1085 #define ENABLE_MOVABLE_GC_OBJECTS 01086 1087 1085 /* FIXME: Eventually we should enable this for all platforms and get rid of the define. */ 1088 1086 #if PLATFORM(MAC) || PLATFORM(WIN)
Note: See TracChangeset
for help on using the changeset viewer.