OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 <iomanip> | 5 #include <iomanip> |
6 #include <sstream> | 6 #include <sstream> |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/accessors.h" | 10 #include "src/accessors.h" |
(...skipping 11602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11613 if ((name != NULL) && (name[0] != '\0')) { | 11613 if ((name != NULL) && (name[0] != '\0')) { |
11614 os << "name = " << name << "\n"; | 11614 os << "name = " << name << "\n"; |
11615 } | 11615 } |
11616 if (kind() == OPTIMIZED_FUNCTION) { | 11616 if (kind() == OPTIMIZED_FUNCTION) { |
11617 os << "stack_slots = " << stack_slots() << "\n"; | 11617 os << "stack_slots = " << stack_slots() << "\n"; |
11618 } | 11618 } |
11619 | 11619 |
11620 os << "Instructions (size = " << instruction_size() << ")\n"; | 11620 os << "Instructions (size = " << instruction_size() << ")\n"; |
11621 { | 11621 { |
11622 Isolate* isolate = GetIsolate(); | 11622 Isolate* isolate = GetIsolate(); |
11623 int decode_size = is_crankshafted() | 11623 int size = instruction_size(); |
11624 ? static_cast<int>(safepoint_table_offset()) | 11624 int safepoint_offset = |
11625 : instruction_size(); | 11625 is_crankshafted() ? static_cast<int>(safepoint_table_offset()) : size; |
11626 // If there might be a back edge table, stop before reaching it. | 11626 int back_edge_offset = (kind() == Code::FUNCTION) |
11627 if (kind() == Code::FUNCTION) { | 11627 ? static_cast<int>(back_edge_table_offset()) |
11628 decode_size = | 11628 : size; |
11629 Min(decode_size, static_cast<int>(back_edge_table_offset())); | 11629 int constant_offset = |
| 11630 FLAG_enable_embedded_constant_pool ? constant_pool_offset() : size; |
| 11631 |
| 11632 // Stop before reaching any embedded tables |
| 11633 int code_size = Min(safepoint_offset, back_edge_offset); |
| 11634 byte* begin = instruction_start(); |
| 11635 byte* end = begin + Min(code_size, constant_offset); |
| 11636 Disassembler::Decode(isolate, &os, begin, end, this); |
| 11637 |
| 11638 if (constant_offset < code_size) { |
| 11639 int constant_size = code_size - constant_offset; |
| 11640 DCHECK((constant_size & kPointerAlignmentMask) == 0); |
| 11641 os << "\nConstant Pool (size = " << constant_size << ")\n"; |
| 11642 Vector<char> buf = Vector<char>::New(50); |
| 11643 intptr_t* ptr = reinterpret_cast<intptr_t*>(begin + constant_offset); |
| 11644 for (int i = 0; i < constant_size; i += kPointerSize, ptr++) { |
| 11645 SNPrintF(buf, "%4d %08" V8PRIxPTR, i, *ptr); |
| 11646 os << static_cast<const void*>(ptr) << " " << buf.start() << "\n"; |
| 11647 } |
11630 } | 11648 } |
11631 byte* begin = instruction_start(); | |
11632 byte* end = begin + decode_size; | |
11633 Disassembler::Decode(isolate, &os, begin, end, this); | |
11634 } | 11649 } |
11635 os << "\n"; | 11650 os << "\n"; |
11636 | 11651 |
11637 if (kind() == FUNCTION) { | 11652 if (kind() == FUNCTION) { |
11638 DeoptimizationOutputData* data = | 11653 DeoptimizationOutputData* data = |
11639 DeoptimizationOutputData::cast(this->deoptimization_data()); | 11654 DeoptimizationOutputData::cast(this->deoptimization_data()); |
11640 data->DeoptimizationOutputDataPrint(os); | 11655 data->DeoptimizationOutputDataPrint(os); |
11641 } else if (kind() == OPTIMIZED_FUNCTION) { | 11656 } else if (kind() == OPTIMIZED_FUNCTION) { |
11642 DeoptimizationInputData* data = | 11657 DeoptimizationInputData* data = |
11643 DeoptimizationInputData::cast(this->deoptimization_data()); | 11658 DeoptimizationInputData::cast(this->deoptimization_data()); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11705 } | 11720 } |
11706 | 11721 |
11707 os << "RelocInfo (size = " << relocation_size() << ")\n"; | 11722 os << "RelocInfo (size = " << relocation_size() << ")\n"; |
11708 for (RelocIterator it(this); !it.done(); it.next()) { | 11723 for (RelocIterator it(this); !it.done(); it.next()) { |
11709 it.rinfo()->Print(GetIsolate(), os); | 11724 it.rinfo()->Print(GetIsolate(), os); |
11710 } | 11725 } |
11711 os << "\n"; | 11726 os << "\n"; |
11712 | 11727 |
11713 #ifdef OBJECT_PRINT | 11728 #ifdef OBJECT_PRINT |
11714 if (FLAG_enable_ool_constant_pool) { | 11729 if (FLAG_enable_ool_constant_pool) { |
11715 ConstantPoolArray* pool = constant_pool(); | 11730 ConstantPoolArray* pool = |
| 11731 reinterpret_cast<ConstantPoolArray*>(constant_pool()); |
11716 if (pool->length()) { | 11732 if (pool->length()) { |
11717 os << "Constant Pool\n"; | 11733 os << "Constant Pool\n"; |
11718 pool->Print(os); | 11734 pool->Print(os); |
11719 os << "\n"; | 11735 os << "\n"; |
11720 } | 11736 } |
11721 } | 11737 } |
11722 #endif | 11738 #endif |
11723 } | 11739 } |
11724 #endif // ENABLE_DISASSEMBLER | 11740 #endif // ENABLE_DISASSEMBLER |
11725 | 11741 |
(...skipping 5443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
17169 CompilationInfo* info) { | 17185 CompilationInfo* info) { |
17170 Handle<DependentCode> codes = DependentCode::InsertCompilationInfo( | 17186 Handle<DependentCode> codes = DependentCode::InsertCompilationInfo( |
17171 handle(cell->dependent_code(), info->isolate()), | 17187 handle(cell->dependent_code(), info->isolate()), |
17172 DependentCode::kPropertyCellChangedGroup, info->object_wrapper()); | 17188 DependentCode::kPropertyCellChangedGroup, info->object_wrapper()); |
17173 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); | 17189 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); |
17174 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( | 17190 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( |
17175 cell, info->zone()); | 17191 cell, info->zone()); |
17176 } | 17192 } |
17177 | 17193 |
17178 } } // namespace v8::internal | 17194 } } // namespace v8::internal |
OLD | NEW |