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

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

Issue 8383029: Implement external strings. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address final review comments Created 9 years, 1 month 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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/isolate.h" 7 #include "vm/isolate.h"
8 #include "vm/object.h" 8 #include "vm/object.h"
9 #include "vm/visitor.h" 9 #include "vm/visitor.h"
10 10
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 448
449 449
450 intptr_t RawFourByteString::VisitFourByteStringPointers( 450 intptr_t RawFourByteString::VisitFourByteStringPointers(
451 RawFourByteString* raw_obj, ObjectPointerVisitor* visitor) { 451 RawFourByteString* raw_obj, ObjectPointerVisitor* visitor) {
452 intptr_t length = Smi::Value(raw_obj->ptr()->length_); 452 intptr_t length = Smi::Value(raw_obj->ptr()->length_);
453 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); 453 visitor->VisitPointers(raw_obj->from(), raw_obj->to());
454 return FourByteString::InstanceSize(length); 454 return FourByteString::InstanceSize(length);
455 } 455 }
456 456
457 457
458 intptr_t RawExternalOneByteString::VisitExternalOneByteStringPointers(
459 RawExternalOneByteString* raw_obj, ObjectPointerVisitor* visitor) {
460 // Make sure that we got here with the tagged pointer as this.
461 ASSERT(raw_obj->IsHeapObject());
462 visitor->VisitPointers(raw_obj->from(), raw_obj->to());
463 return ExternalOneByteString::InstanceSize();
464 }
465
466
467 intptr_t RawExternalTwoByteString::VisitExternalTwoByteStringPointers(
468 RawExternalTwoByteString* raw_obj, ObjectPointerVisitor* visitor) {
469 // Make sure that we got here with the tagged pointer as this.
470 ASSERT(raw_obj->IsHeapObject());
471 visitor->VisitPointers(raw_obj->from(), raw_obj->to());
472 return ExternalTwoByteString::InstanceSize();
473 }
474
475
476 intptr_t RawExternalFourByteString::VisitExternalFourByteStringPointers(
477 RawExternalFourByteString* raw_obj, ObjectPointerVisitor* visitor) {
478 // Make sure that we got here with the tagged pointer as this.
479 ASSERT(raw_obj->IsHeapObject());
480 visitor->VisitPointers(raw_obj->from(), raw_obj->to());
481 return ExternalFourByteString::InstanceSize();
482 }
483
484
458 intptr_t RawBool::VisitBoolPointers(RawBool* raw_obj, 485 intptr_t RawBool::VisitBoolPointers(RawBool* raw_obj,
459 ObjectPointerVisitor* visitor) { 486 ObjectPointerVisitor* visitor) {
460 // Make sure that we got here with the tagged pointer as this. 487 // Make sure that we got here with the tagged pointer as this.
461 ASSERT(raw_obj->IsHeapObject()); 488 ASSERT(raw_obj->IsHeapObject());
462 return Bool::InstanceSize(); 489 return Bool::InstanceSize();
463 } 490 }
464 491
465 492
466 intptr_t RawArray::VisitArrayPointers(RawArray* raw_obj, 493 intptr_t RawArray::VisitArrayPointers(RawArray* raw_obj,
467 ObjectPointerVisitor* visitor) { 494 ObjectPointerVisitor* visitor) {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 intptr_t RawJSRegExp::VisitJSRegExpPointers(RawJSRegExp* raw_obj, 534 intptr_t RawJSRegExp::VisitJSRegExpPointers(RawJSRegExp* raw_obj,
508 ObjectPointerVisitor* visitor) { 535 ObjectPointerVisitor* visitor) {
509 // Make sure that we got here with the tagged pointer as this. 536 // Make sure that we got here with the tagged pointer as this.
510 ASSERT(raw_obj->IsHeapObject()); 537 ASSERT(raw_obj->IsHeapObject());
511 intptr_t length = Smi::Value(raw_obj->ptr()->data_length_); 538 intptr_t length = Smi::Value(raw_obj->ptr()->data_length_);
512 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); 539 visitor->VisitPointers(raw_obj->from(), raw_obj->to());
513 return JSRegExp::InstanceSize(length); 540 return JSRegExp::InstanceSize(length);
514 } 541 }
515 542
516 } // namespace dart 543 } // 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