Changeset 46879 in webkit for trunk/JavaScriptCore/bytecode
- Timestamp:
- Aug 6, 2009, 8:05:42 PM (16 years ago)
- Location:
- trunk/JavaScriptCore/bytecode
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/bytecode/CodeBlock.cpp
r46620 r46879 231 231 static void printStructureStubInfo(const StructureStubInfo& stubInfo, unsigned instructionOffset) 232 232 { 233 switch (stubInfo. opcodeID) {234 case op_get_by_id_self:233 switch (stubInfo.accessType) { 234 case access_get_by_id_self: 235 235 printf(" [%4d] %s: %s\n", instructionOffset, "get_by_id_self", pointerToSourceString(stubInfo.u.getByIdSelf.baseObjectStructure).UTF8String().c_str()); 236 236 return; 237 case op_get_by_id_proto:237 case access_get_by_id_proto: 238 238 printf(" [%4d] %s: %s, %s\n", instructionOffset, "get_by_id_proto", pointerToSourceString(stubInfo.u.getByIdProto.baseObjectStructure).UTF8String().c_str(), pointerToSourceString(stubInfo.u.getByIdProto.prototypeStructure).UTF8String().c_str()); 239 239 return; 240 case op_get_by_id_chain:240 case access_get_by_id_chain: 241 241 printf(" [%4d] %s: %s, %s\n", instructionOffset, "get_by_id_chain", pointerToSourceString(stubInfo.u.getByIdChain.baseObjectStructure).UTF8String().c_str(), pointerToSourceString(stubInfo.u.getByIdChain.chain).UTF8String().c_str()); 242 242 return; 243 case op_get_by_id_self_list:243 case access_get_by_id_self_list: 244 244 printf(" [%4d] %s: %s (%d)\n", instructionOffset, "op_get_by_id_self_list", pointerToSourceString(stubInfo.u.getByIdSelfList.structureList).UTF8String().c_str(), stubInfo.u.getByIdSelfList.listSize); 245 245 return; 246 case op_get_by_id_proto_list:246 case access_get_by_id_proto_list: 247 247 printf(" [%4d] %s: %s (%d)\n", instructionOffset, "op_get_by_id_proto_list", pointerToSourceString(stubInfo.u.getByIdProtoList.structureList).UTF8String().c_str(), stubInfo.u.getByIdProtoList.listSize); 248 248 return; 249 case op_put_by_id_transition:249 case access_put_by_id_transition: 250 250 printf(" [%4d] %s: %s, %s, %s\n", instructionOffset, "put_by_id_transition", pointerToSourceString(stubInfo.u.putByIdTransition.previousStructure).UTF8String().c_str(), pointerToSourceString(stubInfo.u.putByIdTransition.structure).UTF8String().c_str(), pointerToSourceString(stubInfo.u.putByIdTransition.chain).UTF8String().c_str()); 251 251 return; 252 case op_put_by_id_replace:252 case access_put_by_id_replace: 253 253 printf(" [%4d] %s: %s\n", instructionOffset, "put_by_id_replace", pointerToSourceString(stubInfo.u.putByIdReplace.baseObjectStructure).UTF8String().c_str()); 254 254 return; 255 case op_get_by_id:255 case access_get_by_id: 256 256 printf(" [%4d] %s\n", instructionOffset, "get_by_id"); 257 257 return; 258 case op_put_by_id:258 case access_put_by_id: 259 259 printf(" [%4d] %s\n", instructionOffset, "put_by_id"); 260 260 return; 261 case op_get_by_id_generic:261 case access_get_by_id_generic: 262 262 printf(" [%4d] %s\n", instructionOffset, "op_get_by_id_generic"); 263 263 return; 264 case op_put_by_id_generic:264 case access_put_by_id_generic: 265 265 printf(" [%4d] %s\n", instructionOffset, "op_put_by_id_generic"); 266 266 return; 267 case op_get_array_length:267 case access_get_array_length: 268 268 printf(" [%4d] %s\n", instructionOffset, "op_get_array_length"); 269 269 return; 270 case op_get_string_length:270 case access_get_string_length: 271 271 printf(" [%4d] %s\n", instructionOffset, "op_get_string_length"); 272 272 return; … … 1320 1320 structure->deref(); 1321 1321 // Both members must be filled at the same time 1322 ASSERT( m_methodCallLinkInfos[i].cachedPrototypeStructure);1322 ASSERT(!!m_methodCallLinkInfos[i].cachedPrototypeStructure); 1323 1323 m_methodCallLinkInfos[i].cachedPrototypeStructure->deref(); 1324 1324 } -
trunk/JavaScriptCore/bytecode/CodeBlock.h
r46831 r46879 37 37 #include "JumpTable.h" 38 38 #include "Nodes.h" 39 #include "PtrAndFlags.h" 39 40 #include "RegExp.h" 40 41 #include "UString.h" … … 54 55 55 56 namespace JSC { 57 58 enum HasSeenShouldRepatch { 59 hasSeenShouldRepatch 60 }; 56 61 57 62 class ExecState; … … 106 111 CodeLocationDataLabelPtr hotPathBegin; 107 112 CodeLocationNearCall hotPathOther; 108 CodeBlock*ownerCodeBlock;113 PtrAndFlags<CodeBlock, HasSeenShouldRepatch> ownerCodeBlock; 109 114 CodeBlock* callee; 110 115 unsigned position; … … 112 117 void setUnlinked() { callee = 0; } 113 118 bool isLinked() { return callee; } 119 120 bool seenOnce() 121 { 122 return ownerCodeBlock.isFlagSet(hasSeenShouldRepatch); 123 } 124 125 void setSeen() 126 { 127 ownerCodeBlock.setFlag(hasSeenShouldRepatch); 128 } 114 129 }; 115 130 … … 117 132 MethodCallLinkInfo() 118 133 : cachedStructure(0) 119 , cachedPrototypeStructure(0) 120 { 134 { 135 } 136 137 bool seenOnce() 138 { 139 return cachedPrototypeStructure.isFlagSet(hasSeenShouldRepatch); 140 } 141 142 void setSeen() 143 { 144 cachedPrototypeStructure.setFlag(hasSeenShouldRepatch); 121 145 } 122 146 … … 124 148 CodeLocationDataLabelPtr structureLabel; 125 149 Structure* cachedStructure; 126 Structure*cachedPrototypeStructure;150 PtrAndFlags<Structure, HasSeenShouldRepatch> cachedPrototypeStructure; 127 151 }; 128 152 -
trunk/JavaScriptCore/bytecode/StructureStubInfo.cpp
r46620 r46879 32 32 void StructureStubInfo::deref() 33 33 { 34 switch ( opcodeID) {35 case op_get_by_id_self:34 switch (accessType) { 35 case access_get_by_id_self: 36 36 u.getByIdSelf.baseObjectStructure->deref(); 37 37 return; 38 case op_get_by_id_proto:38 case access_get_by_id_proto: 39 39 u.getByIdProto.baseObjectStructure->deref(); 40 40 u.getByIdProto.prototypeStructure->deref(); 41 41 return; 42 case op_get_by_id_chain:42 case access_get_by_id_chain: 43 43 u.getByIdChain.baseObjectStructure->deref(); 44 44 u.getByIdChain.chain->deref(); 45 45 return; 46 case op_get_by_id_self_list: {46 case access_get_by_id_self_list: { 47 47 PolymorphicAccessStructureList* polymorphicStructures = u.getByIdSelfList.structureList; 48 48 polymorphicStructures->derefStructures(u.getByIdSelfList.listSize); … … 50 50 return; 51 51 } 52 case op_get_by_id_proto_list: {52 case access_get_by_id_proto_list: { 53 53 PolymorphicAccessStructureList* polymorphicStructures = u.getByIdProtoList.structureList; 54 54 polymorphicStructures->derefStructures(u.getByIdProtoList.listSize); … … 56 56 return; 57 57 } 58 case op_put_by_id_transition:58 case access_put_by_id_transition: 59 59 u.putByIdTransition.previousStructure->deref(); 60 60 u.putByIdTransition.structure->deref(); 61 61 u.putByIdTransition.chain->deref(); 62 62 return; 63 case op_put_by_id_replace:63 case access_put_by_id_replace: 64 64 u.putByIdReplace.baseObjectStructure->deref(); 65 65 return; 66 case op_get_by_id:67 case op_put_by_id:68 case op_get_by_id_generic:69 case op_put_by_id_generic:70 case op_get_array_length:71 case op_get_string_length:66 case access_get_by_id: 67 case access_put_by_id: 68 case access_get_by_id_generic: 69 case access_put_by_id_generic: 70 case access_get_array_length: 71 case access_get_string_length: 72 72 // These instructions don't ref their Structures. 73 73 return; -
trunk/JavaScriptCore/bytecode/StructureStubInfo.h
r46620 r46879 36 36 namespace JSC { 37 37 38 enum AccessType { 39 access_get_by_id_self, 40 access_get_by_id_proto, 41 access_get_by_id_chain, 42 access_get_by_id_self_list, 43 access_get_by_id_proto_list, 44 access_put_by_id_transition, 45 access_put_by_id_replace, 46 access_get_by_id, 47 access_put_by_id, 48 access_get_by_id_generic, 49 access_put_by_id_generic, 50 access_get_array_length, 51 access_get_string_length, 52 }; 53 38 54 struct StructureStubInfo { 39 StructureStubInfo(OpcodeID opcodeID) 40 : opcodeID(opcodeID) 55 StructureStubInfo(AccessType accessType) 56 : accessType(accessType) 57 , seen(false) 41 58 { 42 59 } … … 44 61 void initGetByIdSelf(Structure* baseObjectStructure) 45 62 { 46 opcodeID = op_get_by_id_self;63 accessType = access_get_by_id_self; 47 64 48 65 u.getByIdSelf.baseObjectStructure = baseObjectStructure; … … 52 69 void initGetByIdProto(Structure* baseObjectStructure, Structure* prototypeStructure) 53 70 { 54 opcodeID = op_get_by_id_proto;71 accessType = access_get_by_id_proto; 55 72 56 73 u.getByIdProto.baseObjectStructure = baseObjectStructure; … … 63 80 void initGetByIdChain(Structure* baseObjectStructure, StructureChain* chain) 64 81 { 65 opcodeID = op_get_by_id_chain;82 accessType = access_get_by_id_chain; 66 83 67 84 u.getByIdChain.baseObjectStructure = baseObjectStructure; … … 74 91 void initGetByIdSelfList(PolymorphicAccessStructureList* structureList, int listSize) 75 92 { 76 opcodeID = op_get_by_id_self_list;93 accessType = access_get_by_id_self_list; 77 94 78 95 u.getByIdProtoList.structureList = structureList; … … 82 99 void initGetByIdProtoList(PolymorphicAccessStructureList* structureList, int listSize) 83 100 { 84 opcodeID = op_get_by_id_proto_list;101 accessType = access_get_by_id_proto_list; 85 102 86 103 u.getByIdProtoList.structureList = structureList; … … 92 109 void initPutByIdTransition(Structure* previousStructure, Structure* structure, StructureChain* chain) 93 110 { 94 opcodeID = op_put_by_id_transition;111 accessType = access_put_by_id_transition; 95 112 96 113 u.putByIdTransition.previousStructure = previousStructure; … … 106 123 void initPutByIdReplace(Structure* baseObjectStructure) 107 124 { 108 opcodeID = op_put_by_id_replace;125 accessType = access_put_by_id_replace; 109 126 110 127 u.putByIdReplace.baseObjectStructure = baseObjectStructure; … … 114 131 void deref(); 115 132 116 OpcodeID opcodeID; 133 bool seenOnce() 134 { 135 return seen; 136 } 137 138 void setSeen() 139 { 140 seen = true; 141 } 142 143 int accessType : 31; 144 int seen : 1; 145 117 146 union { 118 147 struct {
Note:
See TracChangeset
for help on using the changeset viewer.