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 #ifndef VM_NATIVE_ENTRY_H_ | 5 #ifndef VM_NATIVE_ENTRY_H_ |
6 #define VM_NATIVE_ENTRY_H_ | 6 #define VM_NATIVE_ENTRY_H_ |
7 | 7 |
8 #include "platform/memory_sanitizer.h" | 8 #include "platform/memory_sanitizer.h" |
9 | 9 |
10 #include "vm/allocation.h" | 10 #include "vm/allocation.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 NativeArguments* arguments); \ | 44 NativeArguments* arguments); \ |
45 void NATIVE_ENTRY_FUNCTION(name)(Dart_NativeArguments args) { \ | 45 void NATIVE_ENTRY_FUNCTION(name)(Dart_NativeArguments args) { \ |
46 CHECK_STACK_ALIGNMENT; \ | 46 CHECK_STACK_ALIGNMENT; \ |
47 VERIFY_ON_TRANSITION; \ | 47 VERIFY_ON_TRANSITION; \ |
48 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); \ | 48 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); \ |
49 /* Tell MemorySanitizer 'arguments' is initialized by generated code. */ \ | 49 /* Tell MemorySanitizer 'arguments' is initialized by generated code. */ \ |
50 MSAN_UNPOISON(arguments, sizeof(*arguments)); \ | 50 MSAN_UNPOISON(arguments, sizeof(*arguments)); \ |
51 ASSERT(arguments->NativeArgCount() == argument_count); \ | 51 ASSERT(arguments->NativeArgCount() == argument_count); \ |
52 TRACE_NATIVE_CALL("%s", ""#name); \ | 52 TRACE_NATIVE_CALL("%s", ""#name); \ |
53 { \ | 53 { \ |
54 Isolate* isolate = arguments->isolate(); \ | 54 Thread* thread = arguments->thread(); \ |
55 /* TODO(koda): Pivot from Isolate to Thread in NativeArguments. */ \ | |
56 Thread* thread = isolate->mutator_thread(); \ | |
57 ASSERT(thread == Thread::Current()); \ | 55 ASSERT(thread == Thread::Current()); \ |
| 56 Isolate* isolate = thread->isolate(); \ |
58 StackZone zone(isolate); \ | 57 StackZone zone(isolate); \ |
59 SET_NATIVE_RETVAL(arguments, \ | 58 SET_NATIVE_RETVAL(arguments, \ |
60 DN_Helper##name(isolate, \ | 59 DN_Helper##name(isolate, \ |
61 thread, \ | 60 thread, \ |
62 zone.GetZone(), \ | 61 zone.GetZone(), \ |
63 arguments)); \ | 62 arguments)); \ |
64 DEOPTIMIZE_ALOT; \ | 63 DEOPTIMIZE_ALOT; \ |
65 } \ | 64 } \ |
66 VERIFY_ON_TRANSITION; \ | 65 VERIFY_ON_TRANSITION; \ |
67 } \ | 66 } \ |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 uword pc); | 113 uword pc); |
115 static const uint8_t* ResolveSymbol(uword pc); | 114 static const uint8_t* ResolveSymbol(uword pc); |
116 static void NativeCallWrapper(Dart_NativeArguments args, | 115 static void NativeCallWrapper(Dart_NativeArguments args, |
117 Dart_NativeFunction func); | 116 Dart_NativeFunction func); |
118 static const ExternalLabel& NativeCallWrapperLabel(); | 117 static const ExternalLabel& NativeCallWrapperLabel(); |
119 }; | 118 }; |
120 | 119 |
121 } // namespace dart | 120 } // namespace dart |
122 | 121 |
123 #endif // VM_NATIVE_ENTRY_H_ | 122 #endif // VM_NATIVE_ENTRY_H_ |
OLD | NEW |