| 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" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 const ExternalLabel& NativeEntry::NativeCallWrapperLabel() { | 79 const ExternalLabel& NativeEntry::NativeCallWrapperLabel() { |
| 80 return native_call_label; | 80 return native_call_label; |
| 81 } | 81 } |
| 82 | 82 |
| 83 | 83 |
| 84 void NativeEntry::NativeCallWrapper(Dart_NativeArguments args, | 84 void NativeEntry::NativeCallWrapper(Dart_NativeArguments args, |
| 85 Dart_NativeFunction func) { | 85 Dart_NativeFunction func) { |
| 86 CHECK_STACK_ALIGNMENT; | 86 CHECK_STACK_ALIGNMENT; |
| 87 VERIFY_ON_TRANSITION; | 87 VERIFY_ON_TRANSITION; |
| 88 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); | 88 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); |
| 89 /* Tell MemorySanitizer 'arguments' is initialized by generated code. */ |
| 90 MSAN_UNPOISON(arguments, sizeof(*arguments)); |
| 89 Isolate* isolate = arguments->isolate(); | 91 Isolate* isolate = arguments->isolate(); |
| 90 | 92 |
| 91 ApiState* state = isolate->api_state(); | 93 ApiState* state = isolate->api_state(); |
| 92 ASSERT(state != NULL); | 94 ASSERT(state != NULL); |
| 93 ApiLocalScope* current_top_scope = state->top_scope(); | 95 ApiLocalScope* current_top_scope = state->top_scope(); |
| 94 ApiLocalScope* scope = state->reusable_scope(); | 96 ApiLocalScope* scope = state->reusable_scope(); |
| 95 TRACE_NATIVE_CALL("0x%" Px "", reinterpret_cast<uintptr_t>(func)); | 97 TRACE_NATIVE_CALL("0x%" Px "", reinterpret_cast<uintptr_t>(func)); |
| 96 if (scope == NULL) { | 98 if (scope == NULL) { |
| 97 scope = new ApiLocalScope(current_top_scope, | 99 scope = new ApiLocalScope(current_top_scope, |
| 98 isolate->top_exit_frame_info()); | 100 isolate->top_exit_frame_info()); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 114 state->set_reusable_scope(scope); | 116 state->set_reusable_scope(scope); |
| 115 } else { | 117 } else { |
| 116 ASSERT(state->reusable_scope() != scope); | 118 ASSERT(state->reusable_scope() != scope); |
| 117 delete scope; | 119 delete scope; |
| 118 } | 120 } |
| 119 DEOPTIMIZE_ALOT; | 121 DEOPTIMIZE_ALOT; |
| 120 VERIFY_ON_TRANSITION; | 122 VERIFY_ON_TRANSITION; |
| 121 } | 123 } |
| 122 | 124 |
| 123 } // namespace dart | 125 } // namespace dart |
| OLD | NEW |