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 10984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10995 jsarr.AddValueF("0x%" Px, imm); | 10995 jsarr.AddValueF("0x%" Px, imm); |
10996 break; | 10996 break; |
10997 default: | 10997 default: |
10998 UNREACHABLE(); | 10998 UNREACHABLE(); |
10999 } | 10999 } |
11000 } | 11000 } |
11001 } | 11001 } |
11002 } | 11002 } |
11003 | 11003 |
11004 | 11004 |
| 11005 static const char* DescribeExternalLabel(uword addr) { |
| 11006 const char* stub_name = StubCode::NameOfStub(addr); |
| 11007 if (stub_name != NULL) { |
| 11008 return stub_name; |
| 11009 } |
| 11010 |
| 11011 RuntimeFunctionId rt_id = RuntimeEntry::RuntimeFunctionIdFromAddress(addr); |
| 11012 if (rt_id != kNoRuntimeFunctionId) { |
| 11013 return "runtime entry"; |
| 11014 } |
| 11015 |
| 11016 if (addr == NativeEntry::LinkNativeCallLabel().address()) { |
| 11017 return "link native"; |
| 11018 } |
| 11019 |
| 11020 if (addr == reinterpret_cast<uword>(Symbols::PredefinedAddress())) { |
| 11021 return "predefined symbols"; |
| 11022 } |
| 11023 |
| 11024 return "UNKNOWN"; |
| 11025 } |
| 11026 |
| 11027 |
11005 void ObjectPool::DebugPrint() const { | 11028 void ObjectPool::DebugPrint() const { |
11006 ISL_Print("Object Pool: {\n"); | 11029 ISL_Print("Object Pool: {\n"); |
11007 for (intptr_t i = 0; i < Length(); i++) { | 11030 for (intptr_t i = 0; i < Length(); i++) { |
| 11031 intptr_t offset = OffsetFromIndex(i); |
| 11032 ISL_Print(" %" Pd " PP+0x%" Px ": ", i, offset); |
11008 if (InfoAt(i) == kTaggedObject) { | 11033 if (InfoAt(i) == kTaggedObject) { |
11009 ISL_Print(" %" Pd ": 0x%" Px " %s (obj)\n", i, | 11034 RawObject* obj = ObjectAt(i); |
11010 reinterpret_cast<uword>(ObjectAt(i)), | 11035 ISL_Print("0x%" Px " %s (obj)\n", |
11011 Object::Handle(ObjectAt(i)).ToCString()); | 11036 reinterpret_cast<uword>(obj), |
| 11037 Object::Handle(obj).ToCString()); |
11012 } else if (InfoAt(i) == kExternalLabel) { | 11038 } else if (InfoAt(i) == kExternalLabel) { |
11013 ISL_Print(" %" Pd ": 0x%" Px " (external label)\n", i, RawValueAt(i)); | 11039 uword addr = RawValueAt(i); |
| 11040 ISL_Print("0x%" Px " (external label: %s)\n", |
| 11041 addr, DescribeExternalLabel(addr)); |
11014 } else { | 11042 } else { |
11015 ISL_Print(" %" Pd ": 0x%" Px " (raw)\n", i, RawValueAt(i)); | 11043 ISL_Print("0x%" Px " (raw)\n", RawValueAt(i)); |
11016 } | 11044 } |
11017 } | 11045 } |
11018 ISL_Print("}\n"); | 11046 ISL_Print("}\n"); |
11019 } | 11047 } |
11020 | 11048 |
11021 | 11049 |
11022 intptr_t PcDescriptors::Length() const { | 11050 intptr_t PcDescriptors::Length() const { |
11023 return raw_ptr()->length_; | 11051 return raw_ptr()->length_; |
11024 } | 11052 } |
11025 | 11053 |
(...skipping 10407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
21433 return tag_label.ToCString(); | 21461 return tag_label.ToCString(); |
21434 } | 21462 } |
21435 | 21463 |
21436 | 21464 |
21437 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 21465 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
21438 Instance::PrintJSONImpl(stream, ref); | 21466 Instance::PrintJSONImpl(stream, ref); |
21439 } | 21467 } |
21440 | 21468 |
21441 | 21469 |
21442 } // namespace dart | 21470 } // namespace dart |
OLD | NEW |