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

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

Issue 1367973002: VM: Initialize Instruction objects with break instructions instead of null. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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/assembler_x64.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 1700 matching lines...) Expand 10 before | Expand all | Expand 10 after
1711 1711
1712 RawString* Object::DictionaryName() const { 1712 RawString* Object::DictionaryName() const {
1713 return String::null(); 1713 return String::null();
1714 } 1714 }
1715 1715
1716 1716
1717 void Object::InitializeObject(uword address, 1717 void Object::InitializeObject(uword address,
1718 intptr_t class_id, 1718 intptr_t class_id,
1719 intptr_t size, 1719 intptr_t size,
1720 bool is_vm_object) { 1720 bool is_vm_object) {
1721 // TODO(iposva): Get a proper halt instruction from the assembler which 1721 uword initial_value = (class_id == kInstructionsCid)
1722 // would be needed here for code objects. 1722 ? Assembler::GetBreakInstructionFiller() : reinterpret_cast<uword>(null_);
1723 uword initial_value = reinterpret_cast<uword>(null_);
1724 uword cur = address; 1723 uword cur = address;
1725 uword end = address + size; 1724 uword end = address + size;
1726 while (cur < end) { 1725 while (cur < end) {
1727 *reinterpret_cast<uword*>(cur) = initial_value; 1726 *reinterpret_cast<uword*>(cur) = initial_value;
1728 cur += kWordSize; 1727 cur += kWordSize;
1729 } 1728 }
1730 uword tags = 0; 1729 uword tags = 0;
1731 ASSERT(class_id != kIllegalCid); 1730 ASSERT(class_id != kIllegalCid);
1732 tags = RawObject::ClassIdTag::update(class_id, tags); 1731 tags = RawObject::ClassIdTag::update(class_id, tags);
1733 tags = RawObject::SizeTag::update(size, tags); 1732 tags = RawObject::SizeTag::update(size, tags);
(...skipping 19668 matching lines...) Expand 10 before | Expand all | Expand 10 after
21402 return tag_label.ToCString(); 21401 return tag_label.ToCString();
21403 } 21402 }
21404 21403
21405 21404
21406 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 21405 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
21407 Instance::PrintJSONImpl(stream, ref); 21406 Instance::PrintJSONImpl(stream, ref);
21408 } 21407 }
21409 21408
21410 21409
21411 } // namespace dart 21410 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/assembler_x64.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698