| 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/native_entry.h" | 5 #include "vm/native_entry.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 | 8 |
| 9 #include "vm/dart_api_impl.h" | 9 #include "vm/dart_api_impl.h" |
| 10 #include "vm/dart_api_state.h" | 10 #include "vm/dart_api_state.h" |
| 11 #include "vm/object_store.h" | 11 #include "vm/object_store.h" |
| 12 #include "vm/reusable_handles.h" | 12 #include "vm/reusable_handles.h" |
| 13 #include "vm/tags.h" | 13 #include "vm/tags.h" |
| 14 | 14 |
| 15 | 15 |
| 16 namespace dart { | 16 namespace dart { |
| 17 | 17 |
| 18 DEFINE_FLAG(bool, trace_natives, false, | 18 DEFINE_FLAG(bool, trace_natives, false, |
| 19 "Trace invocation of natives (debug mode only)"); | 19 "Trace invocation of natives (debug mode only)"); |
| 20 | 20 |
| 21 | 21 |
| 22 static ExternalLabel native_call_label( | 22 static ExternalLabel native_call_label( |
| 23 "native_function_call", | |
| 24 reinterpret_cast<uword>(&NativeEntry::NativeCallWrapper)); | 23 reinterpret_cast<uword>(&NativeEntry::NativeCallWrapper)); |
| 25 | 24 |
| 26 | 25 |
| 27 NativeFunction NativeEntry::ResolveNative(const Library& library, | 26 NativeFunction NativeEntry::ResolveNative(const Library& library, |
| 28 const String& function_name, | 27 const String& function_name, |
| 29 int number_of_arguments, | 28 int number_of_arguments, |
| 30 bool* auto_setup_scope) { | 29 bool* auto_setup_scope) { |
| 31 // Now resolve the native function to the corresponding native entrypoint. | 30 // Now resolve the native function to the corresponding native entrypoint. |
| 32 if (library.native_entry_resolver() == 0) { | 31 if (library.native_entry_resolver() == 0) { |
| 33 // Native methods are not allowed in the library to which this | 32 // Native methods are not allowed in the library to which this |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 state->set_reusable_scope(scope); | 114 state->set_reusable_scope(scope); |
| 116 } else { | 115 } else { |
| 117 ASSERT(state->reusable_scope() != scope); | 116 ASSERT(state->reusable_scope() != scope); |
| 118 delete scope; | 117 delete scope; |
| 119 } | 118 } |
| 120 DEOPTIMIZE_ALOT; | 119 DEOPTIMIZE_ALOT; |
| 121 VERIFY_ON_TRANSITION; | 120 VERIFY_ON_TRANSITION; |
| 122 } | 121 } |
| 123 | 122 |
| 124 } // namespace dart | 123 } // namespace dart |
| OLD | NEW |