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

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

Issue 333773006: Removes open arrays (e.g. data[0]) from raw objects. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/raw_object.h ('k') | runtime/vm/raw_object_snapshot.cc » ('j') | 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/raw_object.h" 5 #include "vm/raw_object.h"
6 6
7 #include "vm/class_table.h" 7 #include "vm/class_table.h"
8 #include "vm/dart.h" 8 #include "vm/dart.h"
9 #include "vm/freelist.h" 9 #include "vm/freelist.h"
10 #include "vm/isolate.h" 10 #include "vm/isolate.h"
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 ObjectPointerVisitor* visitor) { 454 ObjectPointerVisitor* visitor) {
455 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); 455 visitor->VisitPointers(raw_obj->from(), raw_obj->to());
456 456
457 RawCode* obj = raw_obj->ptr(); 457 RawCode* obj = raw_obj->ptr();
458 intptr_t length = obj->pointer_offsets_length_; 458 intptr_t length = obj->pointer_offsets_length_;
459 if (Code::AliveBit::decode(obj->state_bits_)) { 459 if (Code::AliveBit::decode(obj->state_bits_)) {
460 // Also visit all the embedded pointers in the corresponding instructions. 460 // Also visit all the embedded pointers in the corresponding instructions.
461 uword entry_point = reinterpret_cast<uword>(obj->instructions_->ptr()) + 461 uword entry_point = reinterpret_cast<uword>(obj->instructions_->ptr()) +
462 Instructions::HeaderSize(); 462 Instructions::HeaderSize();
463 for (intptr_t i = 0; i < length; i++) { 463 for (intptr_t i = 0; i < length; i++) {
464 int32_t offset = obj->data_[i]; 464 int32_t offset = obj->data()[i];
465 visitor->VisitPointer( 465 visitor->VisitPointer(
466 reinterpret_cast<RawObject**>(entry_point + offset)); 466 reinterpret_cast<RawObject**>(entry_point + offset));
467 } 467 }
468 } 468 }
469 return Code::InstanceSize(length); 469 return Code::InstanceSize(length);
470 } 470 }
471 471
472 472
473 intptr_t RawInstructions::VisitInstructionsPointers( 473 intptr_t RawInstructions::VisitInstructionsPointers(
474 RawInstructions* raw_obj, ObjectPointerVisitor* visitor) { 474 RawInstructions* raw_obj, ObjectPointerVisitor* visitor) {
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
864 intptr_t RawUserTag::VisitUserTagPointers( 864 intptr_t RawUserTag::VisitUserTagPointers(
865 RawUserTag* raw_obj, ObjectPointerVisitor* visitor) { 865 RawUserTag* raw_obj, ObjectPointerVisitor* visitor) {
866 // Make sure that we got here with the tagged pointer as this. 866 // Make sure that we got here with the tagged pointer as this.
867 ASSERT(raw_obj->IsHeapObject()); 867 ASSERT(raw_obj->IsHeapObject());
868 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); 868 visitor->VisitPointers(raw_obj->from(), raw_obj->to());
869 return UserTag::InstanceSize(); 869 return UserTag::InstanceSize();
870 } 870 }
871 871
872 872
873 } // namespace dart 873 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/raw_object.h ('k') | runtime/vm/raw_object_snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698