OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_ARGUMENTS_H_ | 5 #ifndef V8_ARGUMENTS_H_ |
6 #define V8_ARGUMENTS_H_ | 6 #define V8_ARGUMENTS_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/objects-inl.h" | 9 #include "src/objects-inl.h" |
10 #include "src/tracing/trace-event.h" | 10 #include "src/tracing/trace-event.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 V8_NOINLINE static Type Stats_##Name(int args_length, Object** args_object, \ | 87 V8_NOINLINE static Type Stats_##Name(int args_length, Object** args_object, \ |
88 Isolate* isolate) { \ | 88 Isolate* isolate) { \ |
89 RuntimeCallTimerScope timer(isolate, &RuntimeCallStats::Name); \ | 89 RuntimeCallTimerScope timer(isolate, &RuntimeCallStats::Name); \ |
90 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.runtime"), \ | 90 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.runtime"), \ |
91 "V8.Runtime_" #Name); \ | 91 "V8.Runtime_" #Name); \ |
92 Arguments args(args_length, args_object); \ | 92 Arguments args(args_length, args_object); \ |
93 return __RT_impl_##Name(args, isolate); \ | 93 return __RT_impl_##Name(args, isolate); \ |
94 } \ | 94 } \ |
95 \ | 95 \ |
96 Type Name(int args_length, Object** args_object, Isolate* isolate) { \ | 96 Type Name(int args_length, Object** args_object, Isolate* isolate) { \ |
| 97 DCHECK(isolate->context() == nullptr || isolate->context()->IsContext()); \ |
97 CLOBBER_DOUBLE_REGISTERS(); \ | 98 CLOBBER_DOUBLE_REGISTERS(); \ |
98 if (FLAG_runtime_call_stats) { \ | 99 if (FLAG_runtime_call_stats) { \ |
99 return Stats_##Name(args_length, args_object, isolate); \ | 100 return Stats_##Name(args_length, args_object, isolate); \ |
100 } \ | 101 } \ |
101 Arguments args(args_length, args_object); \ | 102 Arguments args(args_length, args_object); \ |
102 return __RT_impl_##Name(args, isolate); \ | 103 return __RT_impl_##Name(args, isolate); \ |
103 } \ | 104 } \ |
104 \ | 105 \ |
105 static Type __RT_impl_##Name(Arguments args, Isolate* isolate) | 106 static Type __RT_impl_##Name(Arguments args, Isolate* isolate) |
106 | 107 |
107 #define RUNTIME_FUNCTION(Name) RUNTIME_FUNCTION_RETURNS_TYPE(Object*, Name) | 108 #define RUNTIME_FUNCTION(Name) RUNTIME_FUNCTION_RETURNS_TYPE(Object*, Name) |
108 #define RUNTIME_FUNCTION_RETURN_PAIR(Name) \ | 109 #define RUNTIME_FUNCTION_RETURN_PAIR(Name) \ |
109 RUNTIME_FUNCTION_RETURNS_TYPE(ObjectPair, Name) | 110 RUNTIME_FUNCTION_RETURNS_TYPE(ObjectPair, Name) |
110 #define RUNTIME_FUNCTION_RETURN_TRIPLE(Name) \ | 111 #define RUNTIME_FUNCTION_RETURN_TRIPLE(Name) \ |
111 RUNTIME_FUNCTION_RETURNS_TYPE(ObjectTriple, Name) | 112 RUNTIME_FUNCTION_RETURNS_TYPE(ObjectTriple, Name) |
112 | 113 |
113 } // namespace internal | 114 } // namespace internal |
114 } // namespace v8 | 115 } // namespace v8 |
115 | 116 |
116 #endif // V8_ARGUMENTS_H_ | 117 #endif // V8_ARGUMENTS_H_ |
OLD | NEW |