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_RUNTIME_ENTRY_H_ | 5 #ifndef VM_RUNTIME_ENTRY_H_ |
6 #define VM_RUNTIME_ENTRY_H_ | 6 #define VM_RUNTIME_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/flags.h" | 10 #include "vm/flags.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 DISALLOW_COPY_AND_ASSIGN(RuntimeEntry); | 45 DISALLOW_COPY_AND_ASSIGN(RuntimeEntry); |
46 }; | 46 }; |
47 | 47 |
48 | 48 |
49 // Helper macros for declaring and defining runtime entries. | 49 // Helper macros for declaring and defining runtime entries. |
50 | 50 |
51 #define DEFINE_RUNTIME_ENTRY(name, argument_count) \ | 51 #define DEFINE_RUNTIME_ENTRY(name, argument_count) \ |
52 extern void DRT_##name(NativeArguments arguments); \ | 52 extern void DRT_##name(NativeArguments arguments); \ |
53 extern const RuntimeEntry k##name##RuntimeEntry( \ | 53 extern const RuntimeEntry k##name##RuntimeEntry( \ |
54 "DRT_"#name, &DRT_##name, argument_count); \ | 54 "DRT_"#name, &DRT_##name, argument_count); \ |
55 static void DRT_Helper##name(NativeArguments arguments); \ | 55 static void DRT_Helper##name(Isolate* isolate, NativeArguments arguments); \ |
56 void DRT_##name(NativeArguments arguments) { \ | 56 void DRT_##name(NativeArguments arguments) { \ |
57 CHECK_STACK_ALIGNMENT; \ | 57 CHECK_STACK_ALIGNMENT; \ |
58 VERIFY_ON_TRANSITION; \ | 58 VERIFY_ON_TRANSITION; \ |
59 if (FLAG_trace_runtime_calls) OS::Print("Runtime call: %s\n", ""#name); \ | 59 if (FLAG_trace_runtime_calls) OS::Print("Runtime call: %s\n", ""#name); \ |
60 { \ | 60 { \ |
61 Zone zone; \ | 61 Zone zone(arguments.isolate()); \ |
62 HANDLESCOPE(); \ | 62 HANDLESCOPE(arguments.isolate()); \ |
63 DRT_Helper##name(arguments); \ | 63 DRT_Helper##name(arguments.isolate(), arguments); \ |
64 } \ | 64 } \ |
65 VERIFY_ON_TRANSITION; \ | 65 VERIFY_ON_TRANSITION; \ |
66 } \ | 66 } \ |
67 static void DRT_Helper##name(NativeArguments arguments) | 67 static void DRT_Helper##name(Isolate* isolate, NativeArguments arguments) |
68 | 68 |
69 #define DECLARE_RUNTIME_ENTRY(name) \ | 69 #define DECLARE_RUNTIME_ENTRY(name) \ |
70 extern const RuntimeEntry k##name##RuntimeEntry | 70 extern const RuntimeEntry k##name##RuntimeEntry |
71 | 71 |
72 } // namespace dart | 72 } // namespace dart |
73 | 73 |
74 #endif // VM_RUNTIME_ENTRY_H_ | 74 #endif // VM_RUNTIME_ENTRY_H_ |
OLD | NEW |