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

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: Fully displace external string metadata 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
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/object.h" 7 #include "vm/object.h"
8 #include "vm/visitor.h" 8 #include "vm/visitor.h"
9 9
10 10
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 447
448 448
449 intptr_t RawFourByteString::VisitFourByteStringPointers( 449 intptr_t RawFourByteString::VisitFourByteStringPointers(
450 RawFourByteString* raw_obj, ObjectPointerVisitor* visitor) { 450 RawFourByteString* raw_obj, ObjectPointerVisitor* visitor) {
451 intptr_t length = Smi::Value(raw_obj->ptr()->length_); 451 intptr_t length = Smi::Value(raw_obj->ptr()->length_);
452 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); 452 visitor->VisitPointers(raw_obj->from(), raw_obj->to());
453 return FourByteString::InstanceSize(length); 453 return FourByteString::InstanceSize(length);
454 } 454 }
455 455
456 456
457 intptr_t RawExternalOneByteString::VisitExternalOneByteStringPointers(
458 RawExternalOneByteString* raw_obj, ObjectPointerVisitor* visitor) {
459 // Make sure that we got here with the tagged pointer as this.
460 ASSERT(raw_obj->IsHeapObject());
461 visitor->VisitPointers(raw_obj->from(), raw_obj->to());
462 return ExternalOneByteString::InstanceSize();
463 }
464
465
466 intptr_t RawExternalTwoByteString::VisitExternalTwoByteStringPointers(
467 RawExternalTwoByteString* raw_obj, ObjectPointerVisitor* visitor) {
468 // Make sure that we got here with the tagged pointer as this.
469 ASSERT(raw_obj->IsHeapObject());
470 visitor->VisitPointers(raw_obj->from(), raw_obj->to());
471 return ExternalTwoByteString::InstanceSize();
472 }
473
474
475 intptr_t RawExternalFourByteString::VisitExternalFourByteStringPointers(
476 RawExternalFourByteString* raw_obj, ObjectPointerVisitor* visitor) {
477 // Make sure that we got here with the tagged pointer as this.
478 ASSERT(raw_obj->IsHeapObject());
479 visitor->VisitPointers(raw_obj->from(), raw_obj->to());
480 return ExternalFourByteString::InstanceSize();
481 }
482
483
457 intptr_t RawBool::VisitBoolPointers(RawBool* raw_obj, 484 intptr_t RawBool::VisitBoolPointers(RawBool* raw_obj,
458 ObjectPointerVisitor* visitor) { 485 ObjectPointerVisitor* visitor) {
459 // Make sure that we got here with the tagged pointer as this. 486 // Make sure that we got here with the tagged pointer as this.
460 ASSERT(raw_obj->IsHeapObject()); 487 ASSERT(raw_obj->IsHeapObject());
461 return Bool::InstanceSize(); 488 return Bool::InstanceSize();
462 } 489 }
463 490
464 491
465 intptr_t RawArray::VisitArrayPointers(RawArray* raw_obj, 492 intptr_t RawArray::VisitArrayPointers(RawArray* raw_obj,
466 ObjectPointerVisitor* visitor) { 493 ObjectPointerVisitor* visitor) {
(...skipping 30 matching lines...) Expand all
497 intptr_t RawJSRegExp::VisitJSRegExpPointers(RawJSRegExp* raw_obj, 524 intptr_t RawJSRegExp::VisitJSRegExpPointers(RawJSRegExp* raw_obj,
498 ObjectPointerVisitor* visitor) { 525 ObjectPointerVisitor* visitor) {
499 // Make sure that we got here with the tagged pointer as this. 526 // Make sure that we got here with the tagged pointer as this.
500 ASSERT(raw_obj->IsHeapObject()); 527 ASSERT(raw_obj->IsHeapObject());
501 intptr_t length = Smi::Value(raw_obj->ptr()->data_length_); 528 intptr_t length = Smi::Value(raw_obj->ptr()->data_length_);
502 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); 529 visitor->VisitPointers(raw_obj->from(), raw_obj->to());
503 return JSRegExp::InstanceSize(length); 530 return JSRegExp::InstanceSize(length);
504 } 531 }
505 532
506 } // namespace dart 533 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698