Chromium Code Reviews

Side by Side Diff: src/objects.cc

Issue 2023503002: Reland Implement .eh_frame writer and disassembler. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@eh-frame-base
Patch Set: SaveRegisterToStack => RegisterSavedToStack. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/objects.h" 5 #include "src/objects.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <iomanip> 8 #include <iomanip>
9 #include <sstream> 9 #include <sstream>
10 10
(...skipping 43 matching lines...)
54 #include "src/source-position-table.h" 54 #include "src/source-position-table.h"
55 #include "src/string-builder.h" 55 #include "src/string-builder.h"
56 #include "src/string-search.h" 56 #include "src/string-search.h"
57 #include "src/string-stream.h" 57 #include "src/string-stream.h"
58 #include "src/utils.h" 58 #include "src/utils.h"
59 #include "src/zone.h" 59 #include "src/zone.h"
60 60
61 #ifdef ENABLE_DISASSEMBLER 61 #ifdef ENABLE_DISASSEMBLER
62 #include "src/disasm.h" 62 #include "src/disasm.h"
63 #include "src/disassembler.h" 63 #include "src/disassembler.h"
64 #include "src/eh-frame.h"
64 #endif 65 #endif
65 66
66 namespace v8 { 67 namespace v8 {
67 namespace internal { 68 namespace internal {
68 69
69 std::ostream& operator<<(std::ostream& os, InstanceType instance_type) { 70 std::ostream& operator<<(std::ostream& os, InstanceType instance_type) {
70 switch (instance_type) { 71 switch (instance_type) {
71 #define WRITE_TYPE(TYPE) \ 72 #define WRITE_TYPE(TYPE) \
72 case TYPE: \ 73 case TYPE: \
73 return os << #TYPE; 74 return os << #TYPE;
(...skipping 14337 matching lines...)
14411 HandlerTable::cast(handler_table())->HandlerTableReturnPrint(os); 14412 HandlerTable::cast(handler_table())->HandlerTableReturnPrint(os);
14412 } 14413 }
14413 os << "\n"; 14414 os << "\n";
14414 } 14415 }
14415 14416
14416 os << "RelocInfo (size = " << relocation_size() << ")\n"; 14417 os << "RelocInfo (size = " << relocation_size() << ")\n";
14417 for (RelocIterator it(this); !it.done(); it.next()) { 14418 for (RelocIterator it(this); !it.done(); it.next()) {
14418 it.rinfo()->Print(GetIsolate(), os); 14419 it.rinfo()->Print(GetIsolate(), os);
14419 } 14420 }
14420 os << "\n"; 14421 os << "\n";
14422
14423 if (has_unwinding_info()) {
14424 os << "UnwindingInfo (size = " << unwinding_info_size() << ")\n";
14425 EhFrameWriter::DisassembleToStream(os, unwinding_info_start(),
14426 unwinding_info_end());
14427 os << "\n";
14428 }
14421 } 14429 }
14422 #endif // ENABLE_DISASSEMBLER 14430 #endif // ENABLE_DISASSEMBLER
14423 14431
14424 14432
14425 void BytecodeArray::Disassemble(std::ostream& os) { 14433 void BytecodeArray::Disassemble(std::ostream& os) {
14426 os << "Parameter count " << parameter_count() << "\n"; 14434 os << "Parameter count " << parameter_count() << "\n";
14427 os << "Frame size " << frame_size() << "\n"; 14435 os << "Frame size " << frame_size() << "\n";
14428 14436
14429 const uint8_t* base_address = GetFirstBytecodeAddress(); 14437 const uint8_t* base_address = GetFirstBytecodeAddress();
14430 SourcePositionTableIterator source_positions(source_position_table()); 14438 SourcePositionTableIterator source_positions(source_position_table());
(...skipping 4547 matching lines...)
18978 18986
18979 Object* data_obj = 18987 Object* data_obj =
18980 constructor->shared()->get_api_func_data()->access_check_info(); 18988 constructor->shared()->get_api_func_data()->access_check_info();
18981 if (data_obj->IsUndefined(isolate)) return nullptr; 18989 if (data_obj->IsUndefined(isolate)) return nullptr;
18982 18990
18983 return AccessCheckInfo::cast(data_obj); 18991 return AccessCheckInfo::cast(data_obj);
18984 } 18992 }
18985 18993
18986 } // namespace internal 18994 } // namespace internal
18987 } // namespace v8 18995 } // namespace v8
OLDNEW

Powered by Google App Engine