Changeset 46618 in webkit for trunk/JavaScriptCore/bytecode
- Timestamp:
- Jul 30, 2009, 7:20:11 PM (16 years ago)
- Location:
- trunk/JavaScriptCore/bytecode
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/bytecode/CodeBlock.cpp
r46598 r46618 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; -
trunk/JavaScriptCore/bytecode/CodeBlock.h
r46598 r46618 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 … … 121 136 } 122 137 138 bool seenOnce() 139 { 140 return cachedPrototypeStructure.isFlagSet(hasSeenShouldRepatch); 141 } 142 143 void setSeen() 144 { 145 cachedPrototypeStructure.setFlag(hasSeenShouldRepatch); 146 } 147 123 148 CodeLocationCall callReturnLocation; 124 149 CodeLocationDataLabelPtr structureLabel; 125 150 Structure* cachedStructure; 126 Structure*cachedPrototypeStructure;151 PtrAndFlags<Structure, HasSeenShouldRepatch> cachedPrototypeStructure; 127 152 }; 128 153 -
trunk/JavaScriptCore/bytecode/StructureStubInfo.cpp
r39229 r46618 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
r44711 r46618 34 34 #include "Structure.h" 35 35 36 36 37 namespace JSC { 37 38 39 static const int access_get_by_id_self = 0; 40 static const int access_get_by_id_proto = 1; 41 static const int access_get_by_id_chain = 2; 42 static const int access_get_by_id_self_list = 3; 43 static const int access_get_by_id_proto_list = 4; 44 static const int access_put_by_id_transition = 5; 45 static const int access_put_by_id_replace = 6; 46 static const int access_get_by_id = 7; 47 static const int access_put_by_id = 8; 48 static const int access_get_by_id_generic = 9; 49 static const int access_put_by_id_generic = 10; 50 static const int access_get_array_length = 11; 51 static const int access_get_string_length = 12; 52 38 53 struct StructureStubInfo { 39 StructureStubInfo(OpcodeID opcodeID) 40 : opcodeID(opcodeID) 54 StructureStubInfo(int accessType) 55 : accessType(accessType) 56 , seen(false) 41 57 { 42 58 } … … 44 60 void initGetByIdSelf(Structure* baseObjectStructure) 45 61 { 46 opcodeID = op_get_by_id_self;62 accessType = access_get_by_id_self; 47 63 48 64 u.getByIdSelf.baseObjectStructure = baseObjectStructure; … … 52 68 void initGetByIdProto(Structure* baseObjectStructure, Structure* prototypeStructure) 53 69 { 54 opcodeID = op_get_by_id_proto;70 accessType = access_get_by_id_proto; 55 71 56 72 u.getByIdProto.baseObjectStructure = baseObjectStructure; … … 63 79 void initGetByIdChain(Structure* baseObjectStructure, StructureChain* chain) 64 80 { 65 opcodeID = op_get_by_id_chain;81 accessType = access_get_by_id_chain; 66 82 67 83 u.getByIdChain.baseObjectStructure = baseObjectStructure; … … 74 90 void initGetByIdSelfList(PolymorphicAccessStructureList* structureList, int listSize) 75 91 { 76 opcodeID = op_get_by_id_self_list;92 accessType = access_get_by_id_self_list; 77 93 78 94 u.getByIdProtoList.structureList = structureList; … … 82 98 void initGetByIdProtoList(PolymorphicAccessStructureList* structureList, int listSize) 83 99 { 84 opcodeID = op_get_by_id_proto_list;100 accessType = access_get_by_id_proto_list; 85 101 86 102 u.getByIdProtoList.structureList = structureList; … … 92 108 void initPutByIdTransition(Structure* previousStructure, Structure* structure, StructureChain* chain) 93 109 { 94 opcodeID = op_put_by_id_transition;110 accessType = access_put_by_id_transition; 95 111 96 112 u.putByIdTransition.previousStructure = previousStructure; … … 106 122 void initPutByIdReplace(Structure* baseObjectStructure) 107 123 { 108 opcodeID = op_put_by_id_replace;124 accessType = access_put_by_id_replace; 109 125 110 126 u.putByIdReplace.baseObjectStructure = baseObjectStructure; … … 114 130 void deref(); 115 131 116 OpcodeID opcodeID; 132 bool seenOnce() 133 { 134 return seen; 135 } 136 137 void setSeen() 138 { 139 seen = true; 140 } 141 142 int accessType : 31; 143 int seen : 1; 144 117 145 union { 118 146 struct {
Note:
See TracChangeset
for help on using the changeset viewer.