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

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

Issue 1295693002: Add ObjectPool tag for external labels. Use LoadExternalLabel for native calls... (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « runtime/vm/object.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 10946 matching lines...) Expand 10 before | Expand all | Expand 10 after
10957 JSONArray jsarr(&jsobj, "_entries"); 10957 JSONArray jsarr(&jsobj, "_entries");
10958 uword imm; 10958 uword imm;
10959 Object& obj = Object::Handle(); 10959 Object& obj = Object::Handle();
10960 for (intptr_t i = 0; i < Length(); i++) { 10960 for (intptr_t i = 0; i < Length(); i++) {
10961 switch (InfoAt(i)) { 10961 switch (InfoAt(i)) {
10962 case ObjectPool::kTaggedObject: 10962 case ObjectPool::kTaggedObject:
10963 obj = ObjectAt(i); 10963 obj = ObjectAt(i);
10964 jsarr.AddValue(obj); 10964 jsarr.AddValue(obj);
10965 break; 10965 break;
10966 case ObjectPool::kImmediate: 10966 case ObjectPool::kImmediate:
10967 // We might want to distingiush between immediates and addresses
10968 // in the future.
10969 imm = RawValueAt(i); 10967 imm = RawValueAt(i);
10970 jsarr.AddValue64(imm); 10968 jsarr.AddValue64(imm);
10971 break; 10969 break;
10970 case ObjectPool::kExternalLabel:
10971 imm = RawValueAt(i);
10972 jsarr.AddValueF("0x%" Px, imm);
10973 break;
10972 default: 10974 default:
10973 UNREACHABLE(); 10975 UNREACHABLE();
10974 } 10976 }
10975 } 10977 }
10976 } 10978 }
10977 } 10979 }
10978 10980
10979 10981
10980 void ObjectPool::DebugPrint() const { 10982 void ObjectPool::DebugPrint() const {
10981 ISL_Print("Object Pool: {\n"); 10983 ISL_Print("Object Pool: {\n");
10982 for (intptr_t i = 0; i < Length(); i++) { 10984 for (intptr_t i = 0; i < Length(); i++) {
10983 if (InfoAt(i) == kTaggedObject) { 10985 if (InfoAt(i) == kTaggedObject) {
10984 ISL_Print(" %" Pd ": 0x%" Px " %s (obj)\n", i, 10986 ISL_Print(" %" Pd ": 0x%" Px " %s (obj)\n", i,
10985 reinterpret_cast<uword>(ObjectAt(i)), 10987 reinterpret_cast<uword>(ObjectAt(i)),
10986 Object::Handle(ObjectAt(i)).ToCString()); 10988 Object::Handle(ObjectAt(i)).ToCString());
10989 } else if (InfoAt(i) == kExternalLabel) {
10990 ISL_Print(" %" Pd ": 0x%" Px " (external label)\n", i, RawValueAt(i));
10987 } else { 10991 } else {
10988 ISL_Print(" %" Pd ": 0x%" Px " (raw)\n", i, RawValueAt(i)); 10992 ISL_Print(" %" Pd ": 0x%" Px " (raw)\n", i, RawValueAt(i));
10989 } 10993 }
10990 } 10994 }
10991 ISL_Print("}\n"); 10995 ISL_Print("}\n");
10992 } 10996 }
10993 10997
10994 10998
10995 intptr_t PcDescriptors::Length() const { 10999 intptr_t PcDescriptors::Length() const {
10996 return raw_ptr()->length_; 11000 return raw_ptr()->length_;
(...skipping 10374 matching lines...) Expand 10 before | Expand all | Expand 10 after
21371 return tag_label.ToCString(); 21375 return tag_label.ToCString();
21372 } 21376 }
21373 21377
21374 21378
21375 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 21379 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
21376 Instance::PrintJSONImpl(stream, ref); 21380 Instance::PrintJSONImpl(stream, ref);
21377 } 21381 }
21378 21382
21379 21383
21380 } // namespace dart 21384 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698