| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 | 306 |
| 307 int Disassembler::Decode(FILE* f, byte* begin, byte* end) { | 307 int Disassembler::Decode(FILE* f, byte* begin, byte* end) { |
| 308 V8NameConverter defaultConverter(NULL); | 308 V8NameConverter defaultConverter(NULL); |
| 309 return DecodeIt(f, defaultConverter, begin, end); | 309 return DecodeIt(f, defaultConverter, begin, end); |
| 310 } | 310 } |
| 311 | 311 |
| 312 | 312 |
| 313 // Called by Code::CodePrint. | 313 // Called by Code::CodePrint. |
| 314 void Disassembler::Decode(FILE* f, Code* code) { | 314 void Disassembler::Decode(FILE* f, Code* code) { |
| 315 int decode_size = (code->kind() == Code::OPTIMIZED_FUNCTION) | 315 int decode_size = (code->kind() == Code::OPTIMIZED_FUNCTION) |
| 316 ? static_cast<int>(code->safepoint_table_start()) | 316 ? static_cast<int>(code->safepoint_table_offset()) |
| 317 : code->instruction_size(); | 317 : code->instruction_size(); |
| 318 // If there might be a stack check table, stop before reaching it. | 318 // If there might be a stack check table, stop before reaching it. |
| 319 if (code->kind() == Code::FUNCTION) { | 319 if (code->kind() == Code::FUNCTION) { |
| 320 decode_size = | 320 decode_size = |
| 321 Min(decode_size, static_cast<int>(code->stack_check_table_start())); | 321 Min(decode_size, static_cast<int>(code->stack_check_table_offset())); |
| 322 } | 322 } |
| 323 | 323 |
| 324 byte* begin = code->instruction_start(); | 324 byte* begin = code->instruction_start(); |
| 325 byte* end = begin + decode_size; | 325 byte* end = begin + decode_size; |
| 326 V8NameConverter v8NameConverter(code); | 326 V8NameConverter v8NameConverter(code); |
| 327 DecodeIt(f, v8NameConverter, begin, end); | 327 DecodeIt(f, v8NameConverter, begin, end); |
| 328 } | 328 } |
| 329 | 329 |
| 330 #else // ENABLE_DISASSEMBLER | 330 #else // ENABLE_DISASSEMBLER |
| 331 | 331 |
| 332 void Disassembler::Dump(FILE* f, byte* begin, byte* end) {} | 332 void Disassembler::Dump(FILE* f, byte* begin, byte* end) {} |
| 333 int Disassembler::Decode(FILE* f, byte* begin, byte* end) { return 0; } | 333 int Disassembler::Decode(FILE* f, byte* begin, byte* end) { return 0; } |
| 334 void Disassembler::Decode(FILE* f, Code* code) {} | 334 void Disassembler::Decode(FILE* f, Code* code) {} |
| 335 | 335 |
| 336 #endif // ENABLE_DISASSEMBLER | 336 #endif // ENABLE_DISASSEMBLER |
| 337 | 337 |
| 338 } } // namespace v8::internal | 338 } } // namespace v8::internal |
| OLD | NEW |