OLD | NEW |
1 // Copyright 2007-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2009 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1082 | 1082 |
1083 | 1083 |
1084 //------------------------------------------------------------------------------ | 1084 //------------------------------------------------------------------------------ |
1085 | 1085 |
1086 namespace disasm { | 1086 namespace disasm { |
1087 | 1087 |
1088 namespace v8i = v8::internal; | 1088 namespace v8i = v8::internal; |
1089 | 1089 |
1090 | 1090 |
1091 const char* NameConverter::NameOfAddress(byte* addr) const { | 1091 const char* NameConverter::NameOfAddress(byte* addr) const { |
1092 static v8::internal::EmbeddedVector<char, 32> tmp_buffer; | 1092 v8i::EmbeddedVector<char, 32>& tmp_buffer = |
| 1093 v8::v8_context()->disassembler_data_->tmp_buffer_; |
1093 v8::internal::OS::SNPrintF(tmp_buffer, "%p", addr); | 1094 v8::internal::OS::SNPrintF(tmp_buffer, "%p", addr); |
1094 return tmp_buffer.start(); | 1095 return tmp_buffer.start(); |
1095 } | 1096 } |
1096 | 1097 |
1097 | 1098 |
1098 const char* NameConverter::NameOfConstant(byte* addr) const { | 1099 const char* NameConverter::NameOfConstant(byte* addr) const { |
1099 return NameOfAddress(addr); | 1100 return NameOfAddress(addr); |
1100 } | 1101 } |
1101 | 1102 |
1102 | 1103 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1158 buffer[0] = '\0'; | 1159 buffer[0] = '\0'; |
1159 byte* prev_pc = pc; | 1160 byte* prev_pc = pc; |
1160 pc += d.InstructionDecode(buffer, pc); | 1161 pc += d.InstructionDecode(buffer, pc); |
1161 fprintf(f, "%p %08x %s\n", | 1162 fprintf(f, "%p %08x %s\n", |
1162 prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); | 1163 prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); |
1163 } | 1164 } |
1164 } | 1165 } |
1165 | 1166 |
1166 | 1167 |
1167 } // namespace disasm | 1168 } // namespace disasm |
OLD | NEW |