Changeset 38425 in webkit for trunk/JavaScriptCore/VM/CodeBlock.cpp
- Timestamp:
- Nov 15, 2008, 12:34:40 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/VM/CodeBlock.cpp
r38423 r38425 40 40 namespace JSC { 41 41 42 #if !defined(NDEBUG) || ENABLE( OPCODE_SAMPLING)42 #if !defined(NDEBUG) || ENABLE(BYTECODE_SAMPLING) 43 43 44 44 static UString escapeQuotes(const UString& str) … … 185 185 unsigned instructionOffset = vPC - instructions.begin(); 186 186 187 if (vPC[0].u. opcode == interpreter->getOpcode(op_get_by_id)) {187 if (vPC[0].u.bytecode == interpreter->getBytecode(op_get_by_id)) { 188 188 printStructureID("get_by_id", vPC, 4); 189 189 return; 190 190 } 191 if (vPC[0].u. opcode == interpreter->getOpcode(op_get_by_id_self)) {191 if (vPC[0].u.bytecode == interpreter->getBytecode(op_get_by_id_self)) { 192 192 printStructureID("get_by_id_self", vPC, 4); 193 193 return; 194 194 } 195 if (vPC[0].u. opcode == interpreter->getOpcode(op_get_by_id_proto)) {195 if (vPC[0].u.bytecode == interpreter->getBytecode(op_get_by_id_proto)) { 196 196 printf(" [%4d] %s: %s, %s\n", instructionOffset, "get_by_id_proto", pointerToSourceString(vPC[4].u.structureID).UTF8String().c_str(), pointerToSourceString(vPC[5].u.structureID).UTF8String().c_str()); 197 197 return; 198 198 } 199 if (vPC[0].u. opcode == interpreter->getOpcode(op_put_by_id_transition)) {199 if (vPC[0].u.bytecode == interpreter->getBytecode(op_put_by_id_transition)) { 200 200 printf(" [%4d] %s: %s, %s, %s\n", instructionOffset, "put_by_id_new", pointerToSourceString(vPC[4].u.structureID).UTF8String().c_str(), pointerToSourceString(vPC[5].u.structureID).UTF8String().c_str(), pointerToSourceString(vPC[6].u.structureIDChain).UTF8String().c_str()); 201 201 return; 202 202 } 203 if (vPC[0].u. opcode == interpreter->getOpcode(op_get_by_id_chain)) {203 if (vPC[0].u.bytecode == interpreter->getBytecode(op_get_by_id_chain)) { 204 204 printf(" [%4d] %s: %s, %s\n", instructionOffset, "get_by_id_chain", pointerToSourceString(vPC[4].u.structureID).UTF8String().c_str(), pointerToSourceString(vPC[5].u.structureIDChain).UTF8String().c_str()); 205 205 return; 206 206 } 207 if (vPC[0].u. opcode == interpreter->getOpcode(op_put_by_id)) {207 if (vPC[0].u.bytecode == interpreter->getBytecode(op_put_by_id)) { 208 208 printStructureID("put_by_id", vPC, 4); 209 209 return; 210 210 } 211 if (vPC[0].u. opcode == interpreter->getOpcode(op_put_by_id_replace)) {211 if (vPC[0].u.bytecode == interpreter->getBytecode(op_put_by_id_replace)) { 212 212 printStructureID("put_by_id_replace", vPC, 4); 213 213 return; 214 214 } 215 if (vPC[0].u. opcode == interpreter->getOpcode(op_resolve_global)) {215 if (vPC[0].u.bytecode == interpreter->getBytecode(op_resolve_global)) { 216 216 printStructureID("resolve_global", vPC, 4); 217 217 return; … … 219 219 220 220 // These instructions doesn't ref StructureIDs. 221 ASSERT(vPC[0].u. opcode == interpreter->getOpcode(op_get_by_id_generic) || vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id_generic) || vPC[0].u.opcode == interpreter->getOpcode(op_call) || vPC[0].u.opcode == interpreter->getOpcode(op_call_eval) || vPC[0].u.opcode == interpreter->getOpcode(op_construct));221 ASSERT(vPC[0].u.bytecode == interpreter->getBytecode(op_get_by_id_generic) || vPC[0].u.bytecode == interpreter->getBytecode(op_put_by_id_generic) || vPC[0].u.bytecode == interpreter->getBytecode(op_call) || vPC[0].u.bytecode == interpreter->getBytecode(op_call_eval) || vPC[0].u.bytecode == interpreter->getBytecode(op_construct)); 222 222 } 223 223 … … 229 229 size_t instructionCount = 0; 230 230 for (Vector<Instruction>::const_iterator it = begin; it != end; ++it) 231 if (exec->interpreter()->is Opcode(it->u.opcode))231 if (exec->interpreter()->isBytecode(it->u.bytecode)) 232 232 ++instructionCount; 233 233 … … 291 291 size_t i = 0; 292 292 do { 293 printStructureIDs(&instructions[propertyAccessInstructions[i]. opcodeIndex]);293 printStructureIDs(&instructions[propertyAccessInstructions[i].bytecodeIndex]); 294 294 ++i; 295 295 } while (i < propertyAccessInstructions.size()); … … 360 360 { 361 361 int location = it - begin; 362 switch (exec->interpreter()->get OpcodeID(it->u.opcode)) {362 switch (exec->interpreter()->getBytecodeID(it->u.bytecode)) { 363 363 case op_enter: { 364 364 printf("[%4d] enter\n", location); … … 946 946 } 947 947 948 #endif // !defined(NDEBUG) || ENABLE( OPCODE_SAMPLING)948 #endif // !defined(NDEBUG) || ENABLE(BYTECODE_SAMPLING) 949 949 950 950 CodeBlock::~CodeBlock() … … 955 955 956 956 for (size_t size = propertyAccessInstructions.size(), i = 0; i < size; ++i) { 957 derefStructureIDs(&instructions[propertyAccessInstructions[i]. opcodeIndex]);957 derefStructureIDs(&instructions[propertyAccessInstructions[i].bytecodeIndex]); 958 958 if (propertyAccessInstructions[i].stubRoutine) 959 959 WTF::fastFreeExecutable(propertyAccessInstructions[i].stubRoutine); … … 991 991 BytecodeInterpreter* interpreter = globalData->interpreter; 992 992 993 if (vPC[0].u. opcode == interpreter->getOpcode(op_get_by_id_self)) {993 if (vPC[0].u.bytecode == interpreter->getBytecode(op_get_by_id_self)) { 994 994 vPC[4].u.structureID->deref(); 995 995 return; 996 996 } 997 if (vPC[0].u. opcode == interpreter->getOpcode(op_get_by_id_proto)) {997 if (vPC[0].u.bytecode == interpreter->getBytecode(op_get_by_id_proto)) { 998 998 vPC[4].u.structureID->deref(); 999 999 vPC[5].u.structureID->deref(); 1000 1000 return; 1001 1001 } 1002 if (vPC[0].u. opcode == interpreter->getOpcode(op_get_by_id_chain)) {1002 if (vPC[0].u.bytecode == interpreter->getBytecode(op_get_by_id_chain)) { 1003 1003 vPC[4].u.structureID->deref(); 1004 1004 vPC[5].u.structureIDChain->deref(); 1005 1005 return; 1006 1006 } 1007 if (vPC[0].u. opcode == interpreter->getOpcode(op_put_by_id_transition)) {1007 if (vPC[0].u.bytecode == interpreter->getBytecode(op_put_by_id_transition)) { 1008 1008 vPC[4].u.structureID->deref(); 1009 1009 vPC[5].u.structureID->deref(); … … 1011 1011 return; 1012 1012 } 1013 if (vPC[0].u. opcode == interpreter->getOpcode(op_put_by_id_replace)) {1013 if (vPC[0].u.bytecode == interpreter->getBytecode(op_put_by_id_replace)) { 1014 1014 vPC[4].u.structureID->deref(); 1015 1015 return; 1016 1016 } 1017 if (vPC[0].u. opcode == interpreter->getOpcode(op_resolve_global)) {1017 if (vPC[0].u.bytecode == interpreter->getBytecode(op_resolve_global)) { 1018 1018 if(vPC[4].u.structureID) 1019 1019 vPC[4].u.structureID->deref(); … … 1022 1022 1023 1023 // These instructions don't ref their StructureIDs. 1024 ASSERT(vPC[0].u. opcode == interpreter->getOpcode(op_get_by_id) || vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_generic) || vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id_generic) || vPC[0].u.opcode == interpreter->getOpcode(op_get_array_length) || vPC[0].u.opcode == interpreter->getOpcode(op_get_string_length));1024 ASSERT(vPC[0].u.bytecode == interpreter->getBytecode(op_get_by_id) || vPC[0].u.bytecode == interpreter->getBytecode(op_put_by_id) || vPC[0].u.bytecode == interpreter->getBytecode(op_get_by_id_generic) || vPC[0].u.bytecode == interpreter->getBytecode(op_put_by_id_generic) || vPC[0].u.bytecode == interpreter->getBytecode(op_get_array_length) || vPC[0].u.bytecode == interpreter->getBytecode(op_get_string_length)); 1025 1025 } 1026 1026 … … 1029 1029 BytecodeInterpreter* interpreter = globalData->interpreter; 1030 1030 1031 if (vPC[0].u. opcode == interpreter->getOpcode(op_get_by_id_self)) {1031 if (vPC[0].u.bytecode == interpreter->getBytecode(op_get_by_id_self)) { 1032 1032 vPC[4].u.structureID->ref(); 1033 1033 return; 1034 1034 } 1035 if (vPC[0].u. opcode == interpreter->getOpcode(op_get_by_id_proto)) {1035 if (vPC[0].u.bytecode == interpreter->getBytecode(op_get_by_id_proto)) { 1036 1036 vPC[4].u.structureID->ref(); 1037 1037 vPC[5].u.structureID->ref(); 1038 1038 return; 1039 1039 } 1040 if (vPC[0].u. opcode == interpreter->getOpcode(op_get_by_id_chain)) {1040 if (vPC[0].u.bytecode == interpreter->getBytecode(op_get_by_id_chain)) { 1041 1041 vPC[4].u.structureID->ref(); 1042 1042 vPC[5].u.structureIDChain->ref(); 1043 1043 return; 1044 1044 } 1045 if (vPC[0].u. opcode == interpreter->getOpcode(op_put_by_id_transition)) {1045 if (vPC[0].u.bytecode == interpreter->getBytecode(op_put_by_id_transition)) { 1046 1046 vPC[4].u.structureID->ref(); 1047 1047 vPC[5].u.structureID->ref(); … … 1049 1049 return; 1050 1050 } 1051 if (vPC[0].u. opcode == interpreter->getOpcode(op_put_by_id_replace)) {1051 if (vPC[0].u.bytecode == interpreter->getBytecode(op_put_by_id_replace)) { 1052 1052 vPC[4].u.structureID->ref(); 1053 1053 return; … … 1055 1055 1056 1056 // These instructions don't ref their StructureIDs. 1057 ASSERT(vPC[0].u. opcode == interpreter->getOpcode(op_get_by_id) || vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_generic) || vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id_generic));1057 ASSERT(vPC[0].u.bytecode == interpreter->getBytecode(op_get_by_id) || vPC[0].u.bytecode == interpreter->getBytecode(op_put_by_id) || vPC[0].u.bytecode == interpreter->getBytecode(op_get_by_id_generic) || vPC[0].u.bytecode == interpreter->getBytecode(op_put_by_id_generic)); 1058 1058 } 1059 1059
Note:
See TracChangeset
for help on using the changeset viewer.