| 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 #ifndef VM_DART_API_STATE_H_ | 5 #ifndef VM_DART_API_STATE_H_ |
| 6 #define VM_DART_API_STATE_H_ | 6 #define VM_DART_API_STATE_H_ |
| 7 | 7 |
| 8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
| 9 | 9 |
| 10 #include "platform/thread.h" | 10 #include "platform/thread.h" |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 previous_(previous), stack_marker_(stack_marker) { } | 355 previous_(previous), stack_marker_(stack_marker) { } |
| 356 ~ApiLocalScope() { | 356 ~ApiLocalScope() { |
| 357 previous_ = NULL; | 357 previous_ = NULL; |
| 358 } | 358 } |
| 359 | 359 |
| 360 // Accessors. | 360 // Accessors. |
| 361 ApiLocalScope* previous() const { return previous_; } | 361 ApiLocalScope* previous() const { return previous_; } |
| 362 uword stack_marker() const { return stack_marker_; } | 362 uword stack_marker() const { return stack_marker_; } |
| 363 void set_previous(ApiLocalScope* value) { previous_ = value; } | 363 void set_previous(ApiLocalScope* value) { previous_ = value; } |
| 364 LocalHandles* local_handles() { return &local_handles_; } | 364 LocalHandles* local_handles() { return &local_handles_; } |
| 365 ApiZone& zone() { return zone_; } | 365 ApiZone* zone() { return &zone_; } |
| 366 | 366 |
| 367 private: | 367 private: |
| 368 ApiLocalScope* previous_; | 368 ApiLocalScope* previous_; |
| 369 uword stack_marker_; | 369 uword stack_marker_; |
| 370 LocalHandles local_handles_; | 370 LocalHandles local_handles_; |
| 371 ApiZone zone_; | 371 ApiZone zone_; |
| 372 | 372 |
| 373 DISALLOW_COPY_AND_ASSIGN(ApiLocalScope); | 373 DISALLOW_COPY_AND_ASSIGN(ApiLocalScope); |
| 374 }; | 374 }; |
| 375 | 375 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 } | 462 } |
| 463 return total; | 463 return total; |
| 464 } | 464 } |
| 465 int CountPersistentHandles() const { | 465 int CountPersistentHandles() const { |
| 466 return persistent_handles_.CountHandles(); | 466 return persistent_handles_.CountHandles(); |
| 467 } | 467 } |
| 468 int ZoneSizeInBytes() const { | 468 int ZoneSizeInBytes() const { |
| 469 int total = 0; | 469 int total = 0; |
| 470 ApiLocalScope* scope = top_scope_; | 470 ApiLocalScope* scope = top_scope_; |
| 471 while (scope != NULL) { | 471 while (scope != NULL) { |
| 472 total += scope->zone().SizeInBytes(); | 472 total += scope->zone()->SizeInBytes(); |
| 473 scope = scope->previous(); | 473 scope = scope->previous(); |
| 474 } | 474 } |
| 475 return total; | 475 return total; |
| 476 } | 476 } |
| 477 PersistentHandle* Null() { | 477 PersistentHandle* Null() { |
| 478 if (null_ == NULL) { | 478 if (null_ == NULL) { |
| 479 DARTSCOPE(Isolate::Current()); | 479 DARTSCOPE(Isolate::Current()); |
| 480 | 480 |
| 481 Object& null_object = Object::Handle(); | 481 Object& null_object = Object::Handle(); |
| 482 null_ = persistent_handles().AllocateHandle(); | 482 null_ = persistent_handles().AllocateHandle(); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 ApiNativeScope::Current()->zone()->GetBaseZone()) {} | 558 ApiNativeScope::Current()->zone()->GetBaseZone()) {} |
| 559 ApiGrowableArray() | 559 ApiGrowableArray() |
| 560 : BaseGrowableArray<T, ValueObject>( | 560 : BaseGrowableArray<T, ValueObject>( |
| 561 ApiNativeScope::Current()->zone()->GetBaseZone()) {} | 561 ApiNativeScope::Current()->zone()->GetBaseZone()) {} |
| 562 }; | 562 }; |
| 563 | 563 |
| 564 | 564 |
| 565 } // namespace dart | 565 } // namespace dart |
| 566 | 566 |
| 567 #endif // VM_DART_API_STATE_H_ | 567 #endif // VM_DART_API_STATE_H_ |
| OLD | NEW |