Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Side by Side Diff: runtime/vm/object.cc

Issue 1316673005: Track which entries in the ObjectPool are native entries, and reset them when loading a precompiled… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 10996 matching lines...) Expand 10 before | Expand all | Expand 10 after
11007 switch (InfoAt(i)) { 11007 switch (InfoAt(i)) {
11008 case ObjectPool::kTaggedObject: 11008 case ObjectPool::kTaggedObject:
11009 obj = ObjectAt(i); 11009 obj = ObjectAt(i);
11010 jsarr.AddValue(obj); 11010 jsarr.AddValue(obj);
11011 break; 11011 break;
11012 case ObjectPool::kImmediate: 11012 case ObjectPool::kImmediate:
11013 imm = RawValueAt(i); 11013 imm = RawValueAt(i);
11014 jsarr.AddValue64(imm); 11014 jsarr.AddValue64(imm);
11015 break; 11015 break;
11016 case ObjectPool::kExternalLabel: 11016 case ObjectPool::kExternalLabel:
11017 case ObjectPool::kNativeEntry:
11017 imm = RawValueAt(i); 11018 imm = RawValueAt(i);
11018 jsarr.AddValueF("0x%" Px, imm); 11019 jsarr.AddValueF("0x%" Px, imm);
11019 break; 11020 break;
11020 default: 11021 default:
11021 UNREACHABLE(); 11022 UNREACHABLE();
11022 } 11023 }
11023 } 11024 }
11024 } 11025 }
11025 } 11026 }
11026 11027
11027 11028
11028 static const char* DescribeExternalLabel(uword addr) { 11029 static const char* DescribeExternalLabel(uword addr) {
11029 const char* stub_name = StubCode::NameOfStub(addr); 11030 const char* stub_name = StubCode::NameOfStub(addr);
11030 if (stub_name != NULL) { 11031 if (stub_name != NULL) {
11031 return stub_name; 11032 return stub_name;
11032 } 11033 }
11033 11034
11034 RuntimeFunctionId rt_id = RuntimeEntry::RuntimeFunctionIdFromAddress(addr);
11035 if (rt_id != kNoRuntimeFunctionId) {
11036 return "runtime entry";
11037 }
11038
11039 if (addr == NativeEntry::LinkNativeCallLabel().address()) {
11040 return "link native";
11041 }
11042
11043 if (addr == reinterpret_cast<uword>(Symbols::PredefinedAddress())) { 11035 if (addr == reinterpret_cast<uword>(Symbols::PredefinedAddress())) {
11044 return "predefined symbols"; 11036 return "predefined symbols";
11045 } 11037 }
11046 11038
11047 return "UNKNOWN"; 11039 return "UNKNOWN";
11048 } 11040 }
11049 11041
11050 11042
11051 void ObjectPool::DebugPrint() const { 11043 void ObjectPool::DebugPrint() const {
11052 ISL_Print("Object Pool: {\n"); 11044 ISL_Print("Object Pool: {\n");
11053 for (intptr_t i = 0; i < Length(); i++) { 11045 for (intptr_t i = 0; i < Length(); i++) {
11054 intptr_t offset = OffsetFromIndex(i); 11046 intptr_t offset = OffsetFromIndex(i);
11055 ISL_Print(" %" Pd " PP+0x%" Px ": ", i, offset); 11047 ISL_Print(" %" Pd " PP+0x%" Px ": ", i, offset);
11056 if (InfoAt(i) == kTaggedObject) { 11048 if (InfoAt(i) == kTaggedObject) {
11057 RawObject* obj = ObjectAt(i); 11049 RawObject* obj = ObjectAt(i);
11058 ISL_Print("0x%" Px " %s (obj)\n", 11050 ISL_Print("0x%" Px " %s (obj)\n",
11059 reinterpret_cast<uword>(obj), 11051 reinterpret_cast<uword>(obj),
11060 Object::Handle(obj).ToCString()); 11052 Object::Handle(obj).ToCString());
11061 } else if (InfoAt(i) == kExternalLabel) { 11053 } else if (InfoAt(i) == kExternalLabel) {
11062 uword addr = RawValueAt(i); 11054 uword addr = RawValueAt(i);
11063 ISL_Print("0x%" Px " (external label: %s)\n", 11055 ISL_Print("0x%" Px " (external label: %s)\n",
11064 addr, DescribeExternalLabel(addr)); 11056 addr, DescribeExternalLabel(addr));
11057 } else if (InfoAt(i) == kNativeEntry) {
11058 ISL_Print("0x%" Px " (native entry)\n", RawValueAt(i));
11065 } else { 11059 } else {
11066 ISL_Print("0x%" Px " (raw)\n", RawValueAt(i)); 11060 ISL_Print("0x%" Px " (raw)\n", RawValueAt(i));
11067 } 11061 }
11068 } 11062 }
11069 ISL_Print("}\n"); 11063 ISL_Print("}\n");
11070 } 11064 }
11071 11065
11072 11066
11073 intptr_t PcDescriptors::Length() const { 11067 intptr_t PcDescriptors::Length() const {
11074 return raw_ptr()->length_; 11068 return raw_ptr()->length_;
(...skipping 10433 matching lines...) Expand 10 before | Expand all | Expand 10 after
21508 return tag_label.ToCString(); 21502 return tag_label.ToCString();
21509 } 21503 }
21510 21504
21511 21505
21512 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 21506 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
21513 Instance::PrintJSONImpl(stream, ref); 21507 Instance::PrintJSONImpl(stream, ref);
21514 } 21508 }
21515 21509
21516 21510
21517 } // namespace dart 21511 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698