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 11018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11029 for (intptr_t i = 0; i < Length(); i++) { | 11029 for (intptr_t i = 0; i < Length(); i++) { |
11030 switch (InfoAt(i)) { | 11030 switch (InfoAt(i)) { |
11031 case ObjectPool::kTaggedObject: | 11031 case ObjectPool::kTaggedObject: |
11032 obj = ObjectAt(i); | 11032 obj = ObjectAt(i); |
11033 jsarr.AddValue(obj); | 11033 jsarr.AddValue(obj); |
11034 break; | 11034 break; |
11035 case ObjectPool::kImmediate: | 11035 case ObjectPool::kImmediate: |
11036 imm = RawValueAt(i); | 11036 imm = RawValueAt(i); |
11037 jsarr.AddValue64(imm); | 11037 jsarr.AddValue64(imm); |
11038 break; | 11038 break; |
11039 case ObjectPool::kExternalLabel: | |
11040 case ObjectPool::kNativeEntry: | 11039 case ObjectPool::kNativeEntry: |
11041 imm = RawValueAt(i); | 11040 imm = RawValueAt(i); |
11042 jsarr.AddValueF("0x%" Px, imm); | 11041 jsarr.AddValueF("0x%" Px, imm); |
11043 break; | 11042 break; |
11044 default: | 11043 default: |
11045 UNREACHABLE(); | 11044 UNREACHABLE(); |
11046 } | 11045 } |
11047 } | 11046 } |
11048 } | 11047 } |
11049 } | 11048 } |
11050 | 11049 |
11051 | 11050 |
11052 static const char* DescribeExternalLabel(uword addr) { | |
11053 const char* stub_name = StubCode::NameOfStub(addr); | |
11054 if (stub_name != NULL) { | |
11055 return stub_name; | |
11056 } | |
11057 | |
11058 return "UNKNOWN"; | |
11059 } | |
11060 | |
11061 | |
11062 void ObjectPool::DebugPrint() const { | 11051 void ObjectPool::DebugPrint() const { |
11063 THR_Print("Object Pool: {\n"); | 11052 THR_Print("Object Pool: {\n"); |
11064 for (intptr_t i = 0; i < Length(); i++) { | 11053 for (intptr_t i = 0; i < Length(); i++) { |
11065 intptr_t offset = OffsetFromIndex(i); | 11054 intptr_t offset = OffsetFromIndex(i); |
11066 THR_Print(" %" Pd " PP+0x%" Px ": ", i, offset); | 11055 THR_Print(" %" Pd " PP+0x%" Px ": ", i, offset); |
11067 if (InfoAt(i) == kTaggedObject) { | 11056 if (InfoAt(i) == kTaggedObject) { |
11068 RawObject* obj = ObjectAt(i); | 11057 RawObject* obj = ObjectAt(i); |
11069 THR_Print("0x%" Px " %s (obj)\n", | 11058 THR_Print("0x%" Px " %s (obj)\n", |
11070 reinterpret_cast<uword>(obj), | 11059 reinterpret_cast<uword>(obj), |
11071 Object::Handle(obj).ToCString()); | 11060 Object::Handle(obj).ToCString()); |
11072 } else if (InfoAt(i) == kExternalLabel) { | |
11073 uword addr = RawValueAt(i); | |
11074 THR_Print("0x%" Px " (external label: %s)\n", | |
11075 addr, DescribeExternalLabel(addr)); | |
11076 } else if (InfoAt(i) == kNativeEntry) { | 11061 } else if (InfoAt(i) == kNativeEntry) { |
11077 THR_Print("0x%" Px " (native entry)\n", RawValueAt(i)); | 11062 THR_Print("0x%" Px " (native entry)\n", RawValueAt(i)); |
11078 } else { | 11063 } else { |
11079 THR_Print("0x%" Px " (raw)\n", RawValueAt(i)); | 11064 THR_Print("0x%" Px " (raw)\n", RawValueAt(i)); |
11080 } | 11065 } |
11081 } | 11066 } |
11082 THR_Print("}\n"); | 11067 THR_Print("}\n"); |
11083 } | 11068 } |
11084 | 11069 |
11085 | 11070 |
(...skipping 10331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
21417 return tag_label.ToCString(); | 21402 return tag_label.ToCString(); |
21418 } | 21403 } |
21419 | 21404 |
21420 | 21405 |
21421 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 21406 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
21422 Instance::PrintJSONImpl(stream, ref); | 21407 Instance::PrintJSONImpl(stream, ref); |
21423 } | 21408 } |
21424 | 21409 |
21425 | 21410 |
21426 } // namespace dart | 21411 } // namespace dart |
OLD | NEW |