| OLD | NEW |
| 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/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 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 | 385 |
| 386 | 386 |
| 387 intptr_t RawContextScope::VisitContextScopePointers( | 387 intptr_t RawContextScope::VisitContextScopePointers( |
| 388 RawContextScope* raw_obj, ObjectPointerVisitor* visitor) { | 388 RawContextScope* raw_obj, ObjectPointerVisitor* visitor) { |
| 389 intptr_t num_variables = raw_obj->ptr()->num_variables_; | 389 intptr_t num_variables = raw_obj->ptr()->num_variables_; |
| 390 visitor->VisitPointers(raw_obj->from(), raw_obj->to(num_variables)); | 390 visitor->VisitPointers(raw_obj->from(), raw_obj->to(num_variables)); |
| 391 return ContextScope::InstanceSize(num_variables); | 391 return ContextScope::InstanceSize(num_variables); |
| 392 } | 392 } |
| 393 | 393 |
| 394 | 394 |
| 395 intptr_t RawError::VisitErrorPointers(RawError* raw_obj, |
| 396 ObjectPointerVisitor* visitor) { |
| 397 // Error is an abstract class. |
| 398 UNREACHABLE(); |
| 399 return 0; |
| 400 } |
| 401 |
| 402 |
| 403 intptr_t RawApiError::VisitApiErrorPointers( |
| 404 RawApiError* raw_obj, ObjectPointerVisitor* visitor) { |
| 405 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); |
| 406 return ApiError::InstanceSize(); |
| 407 } |
| 408 |
| 409 |
| 410 intptr_t RawLanguageError::VisitLanguageErrorPointers( |
| 411 RawLanguageError* raw_obj, ObjectPointerVisitor* visitor) { |
| 412 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); |
| 413 return LanguageError::InstanceSize(); |
| 414 } |
| 415 |
| 416 |
| 395 intptr_t RawUnhandledException::VisitUnhandledExceptionPointers( | 417 intptr_t RawUnhandledException::VisitUnhandledExceptionPointers( |
| 396 RawUnhandledException* raw_obj, ObjectPointerVisitor* visitor) { | 418 RawUnhandledException* raw_obj, ObjectPointerVisitor* visitor) { |
| 397 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | 419 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); |
| 398 return UnhandledException::InstanceSize(); | 420 return UnhandledException::InstanceSize(); |
| 399 } | 421 } |
| 400 | 422 |
| 401 | 423 |
| 402 intptr_t RawApiError::VisitApiErrorPointers( | 424 intptr_t RawUnwindError::VisitUnwindErrorPointers( |
| 403 RawApiError* raw_obj, ObjectPointerVisitor* visitor) { | 425 RawUnwindError* raw_obj, ObjectPointerVisitor* visitor) { |
| 404 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | 426 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); |
| 405 return ApiError::InstanceSize(); | 427 return UnwindError::InstanceSize(); |
| 406 } | 428 } |
| 407 | 429 |
| 408 | 430 |
| 409 intptr_t RawInstance::VisitInstancePointers(RawInstance* raw_obj, | 431 intptr_t RawInstance::VisitInstancePointers(RawInstance* raw_obj, |
| 410 ObjectPointerVisitor* visitor) { | 432 ObjectPointerVisitor* visitor) { |
| 411 // Make sure that we got here with the tagged pointer as this. | 433 // Make sure that we got here with the tagged pointer as this. |
| 412 ASSERT(raw_obj->IsHeapObject()); | 434 ASSERT(raw_obj->IsHeapObject()); |
| 413 RawInstance* obj = raw_obj->ptr(); | 435 RawInstance* obj = raw_obj->ptr(); |
| 414 intptr_t instance_size = obj->class_->ptr()->instance_size_; | 436 intptr_t instance_size = obj->class_->ptr()->instance_size_; |
| 415 intptr_t num_native_fields = obj->class_->ptr()->num_native_fields_; | 437 intptr_t num_native_fields = obj->class_->ptr()->num_native_fields_; |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 intptr_t RawJSRegExp::VisitJSRegExpPointers(RawJSRegExp* raw_obj, | 606 intptr_t RawJSRegExp::VisitJSRegExpPointers(RawJSRegExp* raw_obj, |
| 585 ObjectPointerVisitor* visitor) { | 607 ObjectPointerVisitor* visitor) { |
| 586 // Make sure that we got here with the tagged pointer as this. | 608 // Make sure that we got here with the tagged pointer as this. |
| 587 ASSERT(raw_obj->IsHeapObject()); | 609 ASSERT(raw_obj->IsHeapObject()); |
| 588 intptr_t length = Smi::Value(raw_obj->ptr()->data_length_); | 610 intptr_t length = Smi::Value(raw_obj->ptr()->data_length_); |
| 589 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | 611 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); |
| 590 return JSRegExp::InstanceSize(length); | 612 return JSRegExp::InstanceSize(length); |
| 591 } | 613 } |
| 592 | 614 |
| 593 } // namespace dart | 615 } // namespace dart |
| OLD | NEW |