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 "vm/allocation.h" | 8 #include "vm/allocation.h" |
9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
10 #include "vm/code_generator.h" | 10 #include "vm/code_generator.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 #else | 33 #else |
34 #define SET_NATIVE_RETVAL(arguments, value) \ | 34 #define SET_NATIVE_RETVAL(arguments, value) \ |
35 arguments->SetReturnUnsafe(value); | 35 arguments->SetReturnUnsafe(value); |
36 #endif | 36 #endif |
37 | 37 |
38 #define DEFINE_NATIVE_ENTRY(name, argument_count) \ | 38 #define DEFINE_NATIVE_ENTRY(name, argument_count) \ |
39 static RawObject* DN_Helper##name(Isolate* isolate, \ | 39 static RawObject* DN_Helper##name(Isolate* isolate, \ |
40 NativeArguments* arguments); \ | 40 NativeArguments* arguments); \ |
41 void NATIVE_ENTRY_FUNCTION(name)(Dart_NativeArguments args) { \ | 41 void NATIVE_ENTRY_FUNCTION(name)(Dart_NativeArguments args) { \ |
42 CHECK_STACK_ALIGNMENT; \ | 42 CHECK_STACK_ALIGNMENT; \ |
| 43 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); \ |
| 44 DartToVmTimerScope timer(arguments->isolate()); \ |
43 VERIFY_ON_TRANSITION; \ | 45 VERIFY_ON_TRANSITION; \ |
44 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); \ | |
45 ASSERT(arguments->NativeArgCount() == argument_count); \ | 46 ASSERT(arguments->NativeArgCount() == argument_count); \ |
46 TRACE_NATIVE_CALL("%s", ""#name); \ | 47 TRACE_NATIVE_CALL("%s", ""#name); \ |
47 { \ | 48 { \ |
48 StackZone zone(arguments->isolate()); \ | 49 StackZone zone(arguments->isolate()); \ |
49 SET_NATIVE_RETVAL(arguments, \ | 50 SET_NATIVE_RETVAL(arguments, \ |
50 DN_Helper##name(arguments->isolate(), arguments)); \ | 51 DN_Helper##name(arguments->isolate(), arguments)); \ |
51 DEOPTIMIZE_ALOT; \ | 52 DEOPTIMIZE_ALOT; \ |
52 } \ | 53 } \ |
53 VERIFY_ON_TRANSITION; \ | 54 VERIFY_ON_TRANSITION; \ |
54 } \ | 55 } \ |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 int number_of_arguments, | 97 int number_of_arguments, |
97 bool* auto_setup_scope); | 98 bool* auto_setup_scope); |
98 static void NativeCallWrapper(Dart_NativeArguments args, | 99 static void NativeCallWrapper(Dart_NativeArguments args, |
99 Dart_NativeFunction func); | 100 Dart_NativeFunction func); |
100 static const ExternalLabel& NativeCallWrapperLabel(); | 101 static const ExternalLabel& NativeCallWrapperLabel(); |
101 }; | 102 }; |
102 | 103 |
103 } // namespace dart | 104 } // namespace dart |
104 | 105 |
105 #endif // VM_NATIVE_ENTRY_H_ | 106 #endif // VM_NATIVE_ENTRY_H_ |
OLD | NEW |