| 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 "include/dart_api.h" | 5 #include "include/dart_api.h" |
| 6 | 6 |
| 7 #include "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
| 8 #include "vm/class_finalizer.h" | 8 #include "vm/class_finalizer.h" |
| 9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
| 10 #include "vm/dart.h" | 10 #include "vm/dart.h" |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 SetupErrorResult(result); | 306 SetupErrorResult(result); |
| 307 } | 307 } |
| 308 isolate->set_long_jump_base(base); | 308 isolate->set_long_jump_base(base); |
| 309 } | 309 } |
| 310 } | 310 } |
| 311 | 311 |
| 312 | 312 |
| 313 // Return error if isolate is in an inconsistent state. | 313 // Return error if isolate is in an inconsistent state. |
| 314 // Return NULL when no error condition exists. | 314 // Return NULL when no error condition exists. |
| 315 static const char* CheckIsolateState() { | 315 static const char* CheckIsolateState() { |
| 316 if (!ClassFinalizer::FinalizeAllClasses()) { | 316 if (!ClassFinalizer::FinalizePendingClasses()) { |
| 317 // Make a copy of the error message as the original message string | 317 // Make a copy of the error message as the original message string |
| 318 // may get deallocated when we return back from the Dart API call. | 318 // may get deallocated when we return back from the Dart API call. |
| 319 const String& err = | 319 const String& err = |
| 320 String::Handle(Isolate::Current()->object_store()->sticky_error()); | 320 String::Handle(Isolate::Current()->object_store()->sticky_error()); |
| 321 const char* errmsg = err.ToCString(); | 321 const char* errmsg = err.ToCString(); |
| 322 intptr_t errlen = strlen(errmsg) + 1; | 322 intptr_t errlen = strlen(errmsg) + 1; |
| 323 char* msg = reinterpret_cast<char*>(Api::Allocate(errlen)); | 323 char* msg = reinterpret_cast<char*>(Api::Allocate(errlen)); |
| 324 OS::SNPrint(msg, errlen, "%s", errmsg); | 324 OS::SNPrint(msg, errlen, "%s", errmsg); |
| 325 return msg; | 325 return msg; |
| 326 } | 326 } |
| (...skipping 1767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2094 ASSERT(isolate != NULL); | 2094 ASSERT(isolate != NULL); |
| 2095 ApiState* state = isolate->api_state(); | 2095 ApiState* state = isolate->api_state(); |
| 2096 ASSERT(state != NULL); | 2096 ASSERT(state != NULL); |
| 2097 ApiLocalScope* scope = state->top_scope(); | 2097 ApiLocalScope* scope = state->top_scope(); |
| 2098 ASSERT(scope != NULL); | 2098 ASSERT(scope != NULL); |
| 2099 return scope->zone().Reallocate(ptr, old_size, new_size); | 2099 return scope->zone().Reallocate(ptr, old_size, new_size); |
| 2100 } | 2100 } |
| 2101 | 2101 |
| 2102 | 2102 |
| 2103 } // namespace dart | 2103 } // namespace dart |
| OLD | NEW |