Changeset 46620 in webkit for trunk/JavaScriptCore/bytecode
- Timestamp:
- Jul 30, 2009, 7:57:31 PM (16 years ago)
- Location:
- trunk/JavaScriptCore/bytecode
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/bytecode/CodeBlock.cpp
r46618 r46620 231 231 static void printStructureStubInfo(const StructureStubInfo& stubInfo, unsigned instructionOffset) 232 232 { 233 switch (stubInfo. accessType) {234 case access_get_by_id_self:233 switch (stubInfo.opcodeID) { 234 case op_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 access_get_by_id_proto:237 case op_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 access_get_by_id_chain:240 case op_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 access_get_by_id_self_list:243 case op_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 access_get_by_id_proto_list:246 case op_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 access_put_by_id_transition:249 case op_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 access_put_by_id_replace:252 case op_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 access_get_by_id:255 case op_get_by_id: 256 256 printf(" [%4d] %s\n", instructionOffset, "get_by_id"); 257 257 return; 258 case access_put_by_id:258 case op_put_by_id: 259 259 printf(" [%4d] %s\n", instructionOffset, "put_by_id"); 260 260 return; 261 case access_get_by_id_generic:261 case op_get_by_id_generic: 262 262 printf(" [%4d] %s\n", instructionOffset, "op_get_by_id_generic"); 263 263 return; 264 case access_put_by_id_generic:264 case op_put_by_id_generic: 265 265 printf(" [%4d] %s\n", instructionOffset, "op_put_by_id_generic"); 266 266 return; 267 case access_get_array_length:267 case op_get_array_length: 268 268 printf(" [%4d] %s\n", instructionOffset, "op_get_array_length"); 269 269 return; 270 case access_get_string_length:270 case op_get_string_length: 271 271 printf(" [%4d] %s\n", instructionOffset, "op_get_string_length"); 272 272 return; -
trunk/JavaScriptCore/bytecode/CodeBlock.h
r46618 r46620 37 37 #include "JumpTable.h" 38 38 #include "Nodes.h" 39 #include "PtrAndFlags.h"40 39 #include "RegExp.h" 41 40 #include "UString.h" … … 55 54 56 55 namespace JSC { 57 58 enum HasSeenShouldRepatch {59 hasSeenShouldRepatch60 };61 56 62 57 class ExecState; … … 111 106 CodeLocationDataLabelPtr hotPathBegin; 112 107 CodeLocationNearCall hotPathOther; 113 PtrAndFlags<CodeBlock, HasSeenShouldRepatch>ownerCodeBlock;108 CodeBlock* ownerCodeBlock; 114 109 CodeBlock* callee; 115 110 unsigned position; … … 117 112 void setUnlinked() { callee = 0; } 118 113 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 }129 114 }; 130 115 … … 136 121 } 137 122 138 bool seenOnce()139 {140 return cachedPrototypeStructure.isFlagSet(hasSeenShouldRepatch);141 }142 143 void setSeen()144 {145 cachedPrototypeStructure.setFlag(hasSeenShouldRepatch);146 }147 148 123 CodeLocationCall callReturnLocation; 149 124 CodeLocationDataLabelPtr structureLabel; 150 125 Structure* cachedStructure; 151 PtrAndFlags<Structure, HasSeenShouldRepatch>cachedPrototypeStructure;126 Structure* cachedPrototypeStructure; 152 127 }; 153 128 -
trunk/JavaScriptCore/bytecode/StructureStubInfo.cpp
r46618 r46620 32 32 void StructureStubInfo::deref() 33 33 { 34 switch ( accessType) {35 case access_get_by_id_self:34 switch (opcodeID) { 35 case op_get_by_id_self: 36 36 u.getByIdSelf.baseObjectStructure->deref(); 37 37 return; 38 case access_get_by_id_proto:38 case op_get_by_id_proto: 39 39 u.getByIdProto.baseObjectStructure->deref(); 40 40 u.getByIdProto.prototypeStructure->deref(); 41 41 return; 42 case access_get_by_id_chain:42 case op_get_by_id_chain: 43 43 u.getByIdChain.baseObjectStructure->deref(); 44 44 u.getByIdChain.chain->deref(); 45 45 return; 46 case access_get_by_id_self_list: {46 case op_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 access_get_by_id_proto_list: {52 case op_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 access_put_by_id_transition:58 case op_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 access_put_by_id_replace:63 case op_put_by_id_replace: 64 64 u.putByIdReplace.baseObjectStructure->deref(); 65 65 return; 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: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: 72 72 // These instructions don't ref their Structures. 73 73 return; -
trunk/JavaScriptCore/bytecode/StructureStubInfo.h
r46618 r46620 34 34 #include "Structure.h" 35 35 36 37 36 namespace JSC { 38 37 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 53 38 struct StructureStubInfo { 54 StructureStubInfo(int accessType) 55 : accessType(accessType) 56 , seen(false) 39 StructureStubInfo(OpcodeID opcodeID) 40 : opcodeID(opcodeID) 57 41 { 58 42 } … … 60 44 void initGetByIdSelf(Structure* baseObjectStructure) 61 45 { 62 accessType = access_get_by_id_self;46 opcodeID = op_get_by_id_self; 63 47 64 48 u.getByIdSelf.baseObjectStructure = baseObjectStructure; … … 68 52 void initGetByIdProto(Structure* baseObjectStructure, Structure* prototypeStructure) 69 53 { 70 accessType = access_get_by_id_proto;54 opcodeID = op_get_by_id_proto; 71 55 72 56 u.getByIdProto.baseObjectStructure = baseObjectStructure; … … 79 63 void initGetByIdChain(Structure* baseObjectStructure, StructureChain* chain) 80 64 { 81 accessType = access_get_by_id_chain;65 opcodeID = op_get_by_id_chain; 82 66 83 67 u.getByIdChain.baseObjectStructure = baseObjectStructure; … … 90 74 void initGetByIdSelfList(PolymorphicAccessStructureList* structureList, int listSize) 91 75 { 92 accessType = access_get_by_id_self_list;76 opcodeID = op_get_by_id_self_list; 93 77 94 78 u.getByIdProtoList.structureList = structureList; … … 98 82 void initGetByIdProtoList(PolymorphicAccessStructureList* structureList, int listSize) 99 83 { 100 accessType = access_get_by_id_proto_list;84 opcodeID = op_get_by_id_proto_list; 101 85 102 86 u.getByIdProtoList.structureList = structureList; … … 108 92 void initPutByIdTransition(Structure* previousStructure, Structure* structure, StructureChain* chain) 109 93 { 110 accessType = access_put_by_id_transition;94 opcodeID = op_put_by_id_transition; 111 95 112 96 u.putByIdTransition.previousStructure = previousStructure; … … 122 106 void initPutByIdReplace(Structure* baseObjectStructure) 123 107 { 124 accessType = access_put_by_id_replace;108 opcodeID = op_put_by_id_replace; 125 109 126 110 u.putByIdReplace.baseObjectStructure = baseObjectStructure; … … 130 114 void deref(); 131 115 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 116 OpcodeID opcodeID; 145 117 union { 146 118 struct {
Note:
See TracChangeset
for help on using the changeset viewer.