| 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" |
| 9 |
| 8 #include "vm/allocation.h" | 10 #include "vm/allocation.h" |
| 9 #include "vm/assembler.h" | 11 #include "vm/assembler.h" |
| 10 #include "vm/code_generator.h" | 12 #include "vm/code_generator.h" |
| 11 #include "vm/exceptions.h" | 13 #include "vm/exceptions.h" |
| 12 #include "vm/native_arguments.h" | 14 #include "vm/native_arguments.h" |
| 13 #include "vm/verifier.h" | 15 #include "vm/verifier.h" |
| 14 | 16 |
| 15 #include "include/dart_api.h" | 17 #include "include/dart_api.h" |
| 16 | 18 |
| 17 namespace dart { | 19 namespace dart { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 35 arguments->SetReturnUnsafe(value); | 37 arguments->SetReturnUnsafe(value); |
| 36 #endif | 38 #endif |
| 37 | 39 |
| 38 #define DEFINE_NATIVE_ENTRY(name, argument_count) \ | 40 #define DEFINE_NATIVE_ENTRY(name, argument_count) \ |
| 39 static RawObject* DN_Helper##name(Isolate* isolate, \ | 41 static RawObject* DN_Helper##name(Isolate* isolate, \ |
| 40 NativeArguments* arguments); \ | 42 NativeArguments* arguments); \ |
| 41 void NATIVE_ENTRY_FUNCTION(name)(Dart_NativeArguments args) { \ | 43 void NATIVE_ENTRY_FUNCTION(name)(Dart_NativeArguments args) { \ |
| 42 CHECK_STACK_ALIGNMENT; \ | 44 CHECK_STACK_ALIGNMENT; \ |
| 43 VERIFY_ON_TRANSITION; \ | 45 VERIFY_ON_TRANSITION; \ |
| 44 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); \ | 46 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); \ |
| 47 /* Tell MemorySanitizer 'arguments' is initialized by generated code. */ \ |
| 48 MSAN_UNPOISON(arguments, sizeof(*arguments)); \ |
| 45 ASSERT(arguments->NativeArgCount() == argument_count); \ | 49 ASSERT(arguments->NativeArgCount() == argument_count); \ |
| 46 TRACE_NATIVE_CALL("%s", ""#name); \ | 50 TRACE_NATIVE_CALL("%s", ""#name); \ |
| 47 { \ | 51 { \ |
| 48 StackZone zone(arguments->isolate()); \ | 52 StackZone zone(arguments->isolate()); \ |
| 49 SET_NATIVE_RETVAL(arguments, \ | 53 SET_NATIVE_RETVAL(arguments, \ |
| 50 DN_Helper##name(arguments->isolate(), arguments)); \ | 54 DN_Helper##name(arguments->isolate(), arguments)); \ |
| 51 DEOPTIMIZE_ALOT; \ | 55 DEOPTIMIZE_ALOT; \ |
| 52 } \ | 56 } \ |
| 53 VERIFY_ON_TRANSITION; \ | 57 VERIFY_ON_TRANSITION; \ |
| 54 } \ | 58 } \ |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 uword pc); | 103 uword pc); |
| 100 static const uint8_t* ResolveSymbol(uword pc); | 104 static const uint8_t* ResolveSymbol(uword pc); |
| 101 static void NativeCallWrapper(Dart_NativeArguments args, | 105 static void NativeCallWrapper(Dart_NativeArguments args, |
| 102 Dart_NativeFunction func); | 106 Dart_NativeFunction func); |
| 103 static const ExternalLabel& NativeCallWrapperLabel(); | 107 static const ExternalLabel& NativeCallWrapperLabel(); |
| 104 }; | 108 }; |
| 105 | 109 |
| 106 } // namespace dart | 110 } // namespace dart |
| 107 | 111 |
| 108 #endif // VM_NATIVE_ENTRY_H_ | 112 #endif // VM_NATIVE_ENTRY_H_ |
| OLD | NEW |