| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/object.h" | 5 #include "vm/object.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
| 10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
| (...skipping 11035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11046 switch (InfoAt(i)) { | 11046 switch (InfoAt(i)) { |
| 11047 case ObjectPool::kTaggedObject: | 11047 case ObjectPool::kTaggedObject: |
| 11048 obj = ObjectAt(i); | 11048 obj = ObjectAt(i); |
| 11049 jsarr.AddValue(obj); | 11049 jsarr.AddValue(obj); |
| 11050 break; | 11050 break; |
| 11051 case ObjectPool::kImmediate: | 11051 case ObjectPool::kImmediate: |
| 11052 imm = RawValueAt(i); | 11052 imm = RawValueAt(i); |
| 11053 jsarr.AddValue64(imm); | 11053 jsarr.AddValue64(imm); |
| 11054 break; | 11054 break; |
| 11055 case ObjectPool::kExternalLabel: | 11055 case ObjectPool::kExternalLabel: |
| 11056 case ObjectPool::kNativeEntry: |
| 11056 imm = RawValueAt(i); | 11057 imm = RawValueAt(i); |
| 11057 jsarr.AddValueF("0x%" Px, imm); | 11058 jsarr.AddValueF("0x%" Px, imm); |
| 11058 break; | 11059 break; |
| 11059 default: | 11060 default: |
| 11060 UNREACHABLE(); | 11061 UNREACHABLE(); |
| 11061 } | 11062 } |
| 11062 } | 11063 } |
| 11063 } | 11064 } |
| 11064 } | 11065 } |
| 11065 | 11066 |
| 11066 | 11067 |
| 11067 static const char* DescribeExternalLabel(uword addr) { | 11068 static const char* DescribeExternalLabel(uword addr) { |
| 11068 const char* stub_name = StubCode::NameOfStub(addr); | 11069 const char* stub_name = StubCode::NameOfStub(addr); |
| 11069 if (stub_name != NULL) { | 11070 if (stub_name != NULL) { |
| 11070 return stub_name; | 11071 return stub_name; |
| 11071 } | 11072 } |
| 11072 | 11073 |
| 11073 RuntimeFunctionId rt_id = RuntimeEntry::RuntimeFunctionIdFromAddress(addr); | |
| 11074 if (rt_id != kNoRuntimeFunctionId) { | |
| 11075 return "runtime entry"; | |
| 11076 } | |
| 11077 | |
| 11078 if (addr == NativeEntry::LinkNativeCallLabel().address()) { | |
| 11079 return "link native"; | |
| 11080 } | |
| 11081 | |
| 11082 return "UNKNOWN"; | 11074 return "UNKNOWN"; |
| 11083 } | 11075 } |
| 11084 | 11076 |
| 11085 | 11077 |
| 11086 void ObjectPool::DebugPrint() const { | 11078 void ObjectPool::DebugPrint() const { |
| 11087 ISL_Print("Object Pool: {\n"); | 11079 ISL_Print("Object Pool: {\n"); |
| 11088 for (intptr_t i = 0; i < Length(); i++) { | 11080 for (intptr_t i = 0; i < Length(); i++) { |
| 11089 intptr_t offset = OffsetFromIndex(i); | 11081 intptr_t offset = OffsetFromIndex(i); |
| 11090 ISL_Print(" %" Pd " PP+0x%" Px ": ", i, offset); | 11082 ISL_Print(" %" Pd " PP+0x%" Px ": ", i, offset); |
| 11091 if (InfoAt(i) == kTaggedObject) { | 11083 if (InfoAt(i) == kTaggedObject) { |
| 11092 RawObject* obj = ObjectAt(i); | 11084 RawObject* obj = ObjectAt(i); |
| 11093 ISL_Print("0x%" Px " %s (obj)\n", | 11085 ISL_Print("0x%" Px " %s (obj)\n", |
| 11094 reinterpret_cast<uword>(obj), | 11086 reinterpret_cast<uword>(obj), |
| 11095 Object::Handle(obj).ToCString()); | 11087 Object::Handle(obj).ToCString()); |
| 11096 } else if (InfoAt(i) == kExternalLabel) { | 11088 } else if (InfoAt(i) == kExternalLabel) { |
| 11097 uword addr = RawValueAt(i); | 11089 uword addr = RawValueAt(i); |
| 11098 ISL_Print("0x%" Px " (external label: %s)\n", | 11090 ISL_Print("0x%" Px " (external label: %s)\n", |
| 11099 addr, DescribeExternalLabel(addr)); | 11091 addr, DescribeExternalLabel(addr)); |
| 11092 } else if (InfoAt(i) == kNativeEntry) { |
| 11093 ISL_Print("0x%" Px " (native entry)\n", RawValueAt(i)); |
| 11100 } else { | 11094 } else { |
| 11101 ISL_Print("0x%" Px " (raw)\n", RawValueAt(i)); | 11095 ISL_Print("0x%" Px " (raw)\n", RawValueAt(i)); |
| 11102 } | 11096 } |
| 11103 } | 11097 } |
| 11104 ISL_Print("}\n"); | 11098 ISL_Print("}\n"); |
| 11105 } | 11099 } |
| 11106 | 11100 |
| 11107 | 11101 |
| 11108 intptr_t PcDescriptors::Length() const { | 11102 intptr_t PcDescriptors::Length() const { |
| 11109 return raw_ptr()->length_; | 11103 return raw_ptr()->length_; |
| (...skipping 10435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 21545 return tag_label.ToCString(); | 21539 return tag_label.ToCString(); |
| 21546 } | 21540 } |
| 21547 | 21541 |
| 21548 | 21542 |
| 21549 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 21543 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
| 21550 Instance::PrintJSONImpl(stream, ref); | 21544 Instance::PrintJSONImpl(stream, ref); |
| 21551 } | 21545 } |
| 21552 | 21546 |
| 21553 | 21547 |
| 21554 } // namespace dart | 21548 } // namespace dart |
| OLD | NEW |