| 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 951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 962 intptr_t external_size) { | 962 intptr_t external_size) { |
| 963 ApiState* state = isolate->api_state(); | 963 ApiState* state = isolate->api_state(); |
| 964 ASSERT(state != NULL); | 964 ASSERT(state != NULL); |
| 965 FinalizablePersistentHandle* ref = is_prologue ? | 965 FinalizablePersistentHandle* ref = is_prologue ? |
| 966 state->prologue_weak_persistent_handles().AllocateHandle() : | 966 state->prologue_weak_persistent_handles().AllocateHandle() : |
| 967 state->weak_persistent_handles().AllocateHandle(); | 967 state->weak_persistent_handles().AllocateHandle(); |
| 968 ref->SetPrologueWeakPersistent(is_prologue); | 968 ref->SetPrologueWeakPersistent(is_prologue); |
| 969 ref->set_raw(object); | 969 ref->set_raw(object); |
| 970 ref->set_peer(peer); | 970 ref->set_peer(peer); |
| 971 ref->set_callback(callback); | 971 ref->set_callback(callback); |
| 972 // This may trigger GC, so it must be called last. |
| 972 ref->SetExternalSize(external_size, isolate); | 973 ref->SetExternalSize(external_size, isolate); |
| 973 return ref; | 974 return ref; |
| 974 } | 975 } |
| 975 | 976 |
| 976 } // namespace dart | 977 } // namespace dart |
| 977 | 978 |
| 978 #endif // VM_DART_API_STATE_H_ | 979 #endif // VM_DART_API_STATE_H_ |
| OLD | NEW |