OLD | NEW |
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/freelist.h" | 7 #include "vm/freelist.h" |
8 #include "vm/isolate.h" | 8 #include "vm/isolate.h" |
9 #include "vm/object.h" | 9 #include "vm/object.h" |
10 #include "vm/visitor.h" | 10 #include "vm/visitor.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 } | 77 } |
78 case kContextScope: { | 78 case kContextScope: { |
79 const RawContextScope* raw_context_scope = | 79 const RawContextScope* raw_context_scope = |
80 reinterpret_cast<const RawContextScope*>(this); | 80 reinterpret_cast<const RawContextScope*>(this); |
81 intptr_t num_variables = raw_context_scope->ptr()->num_variables_; | 81 intptr_t num_variables = raw_context_scope->ptr()->num_variables_; |
82 instance_size = ContextScope::InstanceSize(num_variables); | 82 instance_size = ContextScope::InstanceSize(num_variables); |
83 break; | 83 break; |
84 } | 84 } |
85 case kBigint: { | 85 case kBigint: { |
86 const RawBigint* raw_bgi = reinterpret_cast<const RawBigint*>(this); | 86 const RawBigint* raw_bgi = reinterpret_cast<const RawBigint*>(this); |
87 const BIGNUM* bn_ptr = &raw_bgi->ptr()->bn_; | 87 intptr_t length = raw_bgi->ptr()->allocated_length_; |
88 instance_size = Bigint::InstanceSize(bn_ptr); | 88 instance_size = Bigint::InstanceSize(length); |
89 break; | 89 break; |
90 } | 90 } |
91 case kOneByteString: { | 91 case kOneByteString: { |
92 const RawOneByteString* raw_string = | 92 const RawOneByteString* raw_string = |
93 reinterpret_cast<const RawOneByteString*>(this); | 93 reinterpret_cast<const RawOneByteString*>(this); |
94 intptr_t string_length = Smi::Value(raw_string->ptr()->length_); | 94 intptr_t string_length = Smi::Value(raw_string->ptr()->length_); |
95 instance_size = OneByteString::InstanceSize(string_length); | 95 instance_size = OneByteString::InstanceSize(string_length); |
96 break; | 96 break; |
97 } | 97 } |
98 case kTwoByteString: { | 98 case kTwoByteString: { |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 ASSERT(raw_obj->IsHeapObject()); | 483 ASSERT(raw_obj->IsHeapObject()); |
484 return Mint::InstanceSize(); | 484 return Mint::InstanceSize(); |
485 } | 485 } |
486 | 486 |
487 | 487 |
488 intptr_t RawBigint::VisitBigintPointers(RawBigint* raw_obj, | 488 intptr_t RawBigint::VisitBigintPointers(RawBigint* raw_obj, |
489 ObjectPointerVisitor* visitor) { | 489 ObjectPointerVisitor* visitor) { |
490 // Make sure that we got here with the tagged pointer as this. | 490 // Make sure that we got here with the tagged pointer as this. |
491 ASSERT(raw_obj->IsHeapObject()); | 491 ASSERT(raw_obj->IsHeapObject()); |
492 RawBigint* obj = raw_obj->ptr(); | 492 RawBigint* obj = raw_obj->ptr(); |
493 return Bigint::InstanceSize(&obj->bn_); | 493 intptr_t length = obj->allocated_length_; |
| 494 return Bigint::InstanceSize(length); |
494 } | 495 } |
495 | 496 |
496 | 497 |
497 intptr_t RawDouble::VisitDoublePointers(RawDouble* raw_obj, | 498 intptr_t RawDouble::VisitDoublePointers(RawDouble* raw_obj, |
498 ObjectPointerVisitor* visitor) { | 499 ObjectPointerVisitor* visitor) { |
499 // Make sure that we got here with the tagged pointer as this. | 500 // Make sure that we got here with the tagged pointer as this. |
500 ASSERT(raw_obj->IsHeapObject()); | 501 ASSERT(raw_obj->IsHeapObject()); |
501 return Double::InstanceSize(); | 502 return Double::InstanceSize(); |
502 } | 503 } |
503 | 504 |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
640 | 641 |
641 intptr_t RawICData::VisitICDataPointers(RawICData* raw_obj, | 642 intptr_t RawICData::VisitICDataPointers(RawICData* raw_obj, |
642 ObjectPointerVisitor* visitor) { | 643 ObjectPointerVisitor* visitor) { |
643 // Make sure that we got here with the tagged pointer as this. | 644 // Make sure that we got here with the tagged pointer as this. |
644 ASSERT(raw_obj->IsHeapObject()); | 645 ASSERT(raw_obj->IsHeapObject()); |
645 return ICData::InstanceSize(); | 646 return ICData::InstanceSize(); |
646 } | 647 } |
647 | 648 |
648 | 649 |
649 } // namespace dart | 650 } // namespace dart |
OLD | NEW |