| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 "include/dart_api.h" | 5 #include "include/dart_api.h" |
| 6 | 6 |
| 7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
| 8 #include "vm/bigint_operations.h" | 8 #include "vm/bigint_operations.h" |
| 9 #include "vm/class_finalizer.h" | 9 #include "vm/class_finalizer.h" |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 va_list args2; | 193 va_list args2; |
| 194 va_start(args2, format); | 194 va_start(args2, format); |
| 195 OS::VSNPrint(buffer, (len + 1), format, args2); | 195 OS::VSNPrint(buffer, (len + 1), format, args2); |
| 196 va_end(args2); | 196 va_end(args2); |
| 197 | 197 |
| 198 const String& message = String::Handle(isolate, String::New(buffer)); | 198 const String& message = String::Handle(isolate, String::New(buffer)); |
| 199 return Api::NewHandle(isolate, ApiError::New(message)); | 199 return Api::NewHandle(isolate, ApiError::New(message)); |
| 200 } | 200 } |
| 201 | 201 |
| 202 | 202 |
| 203 void Api::SetupCallbackError(Isolate* isolate) { | 203 void Api::SetupAcquiredError(Isolate* isolate) { |
| 204 ASSERT(isolate != NULL); | 204 ASSERT(isolate != NULL); |
| 205 ApiState* state = isolate->api_state(); | 205 ApiState* state = isolate->api_state(); |
| 206 ASSERT(state != NULL); | 206 ASSERT(state != NULL); |
| 207 state->SetupCallbackError(); | 207 state->SetupAcquiredError(); |
| 208 } | 208 } |
| 209 | 209 |
| 210 | 210 |
| 211 Dart_Handle Api::CallbackError(Isolate* isolate) { | 211 Dart_Handle Api::AcquiredError(Isolate* isolate) { |
| 212 ASSERT(isolate != NULL); | 212 ASSERT(isolate != NULL); |
| 213 ApiState* state = isolate->api_state(); | 213 ApiState* state = isolate->api_state(); |
| 214 ASSERT(state != NULL); | 214 ASSERT(state != NULL); |
| 215 PersistentHandle* callback_error_handle = state->CallbackError(); | 215 PersistentHandle* acquired_error_handle = state->AcquiredError(); |
| 216 return reinterpret_cast<Dart_Handle>(callback_error_handle); | 216 return reinterpret_cast<Dart_Handle>(acquired_error_handle); |
| 217 } | 217 } |
| 218 | 218 |
| 219 | 219 |
| 220 Dart_Handle Api::Null(Isolate* isolate) { | 220 Dart_Handle Api::Null(Isolate* isolate) { |
| 221 ASSERT(isolate != NULL); | 221 ASSERT(isolate != NULL); |
| 222 ApiState* state = isolate->api_state(); | 222 ApiState* state = isolate->api_state(); |
| 223 ASSERT(state != NULL); | 223 ASSERT(state != NULL); |
| 224 PersistentHandle* null_handle = state->Null(); | 224 PersistentHandle* null_handle = state->Null(); |
| 225 return reinterpret_cast<Dart_Handle>(null_handle); | 225 return reinterpret_cast<Dart_Handle>(null_handle); |
| 226 } | 226 } |
| (...skipping 4588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4815 } | 4815 } |
| 4816 { | 4816 { |
| 4817 NoGCScope no_gc; | 4817 NoGCScope no_gc; |
| 4818 RawObject* raw_obj = obj.raw(); | 4818 RawObject* raw_obj = obj.raw(); |
| 4819 isolate->heap()->SetPeer(raw_obj, peer); | 4819 isolate->heap()->SetPeer(raw_obj, peer); |
| 4820 } | 4820 } |
| 4821 return Api::Success(isolate); | 4821 return Api::Success(isolate); |
| 4822 } | 4822 } |
| 4823 | 4823 |
| 4824 } // namespace dart | 4824 } // namespace dart |
| OLD | NEW |