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/isolate.h" | 9 #include "src/isolate.h" |
10 #include "src/tracing/trace-event.h" | 10 #include "src/tracing/trace-event.h" |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
269 #ifdef DEBUG | 269 #ifdef DEBUG |
270 #define CLOBBER_DOUBLE_REGISTERS() ClobberDoubleRegisters(1, 2, 3, 4); | 270 #define CLOBBER_DOUBLE_REGISTERS() ClobberDoubleRegisters(1, 2, 3, 4); |
271 #else | 271 #else |
272 #define CLOBBER_DOUBLE_REGISTERS() | 272 #define CLOBBER_DOUBLE_REGISTERS() |
273 #endif | 273 #endif |
274 | 274 |
275 #define RUNTIME_FUNCTION_RETURNS_TYPE(Type, Name) \ | 275 #define RUNTIME_FUNCTION_RETURNS_TYPE(Type, Name) \ |
276 static INLINE(Type __RT_impl_##Name(Arguments args, Isolate* isolate)); \ | 276 static INLINE(Type __RT_impl_##Name(Arguments args, Isolate* isolate)); \ |
277 Type Name(int args_length, Object** args_object, Isolate* isolate) { \ | 277 Type Name(int args_length, Object** args_object, Isolate* isolate) { \ |
278 CLOBBER_DOUBLE_REGISTERS(); \ | 278 CLOBBER_DOUBLE_REGISTERS(); \ |
279 Arguments args(args_length, args_object); \ | |
280 Type value; \ | 279 Type value; \ |
281 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.runtime"), "V8." #Name); \ | 280 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.runtime"), "V8." #Name); \ |
281 Arguments args(args_length, args_object); \ | |
Camillo Bruni
2016/03/10 12:45:47
apparently this has some positive effects when mic
| |
282 if (FLAG_runtime_call_stats) { \ | 282 if (FLAG_runtime_call_stats) { \ |
283 RuntimeCallStats* stats = isolate->counters()->runtime_call_stats(); \ | 283 RuntimeCallStats* stats = isolate->counters()->runtime_call_stats(); \ |
284 RuntimeCallTimerScope timer(isolate, &stats->Name); \ | 284 RuntimeCallTimerScope timer(isolate, &stats->Name); \ |
285 value = __RT_impl_##Name(args, isolate); \ | 285 value = __RT_impl_##Name(args, isolate); \ |
286 } else { \ | 286 } else { \ |
287 value = __RT_impl_##Name(args, isolate); \ | 287 value = __RT_impl_##Name(args, isolate); \ |
288 } \ | 288 } \ |
289 return value; \ | 289 return value; \ |
290 } \ | 290 } \ |
291 static Type __RT_impl_##Name(Arguments args, Isolate* isolate) | 291 static Type __RT_impl_##Name(Arguments args, Isolate* isolate) |
292 | 292 |
293 #define RUNTIME_FUNCTION(Name) RUNTIME_FUNCTION_RETURNS_TYPE(Object*, Name) | 293 #define RUNTIME_FUNCTION(Name) RUNTIME_FUNCTION_RETURNS_TYPE(Object*, Name) |
294 #define RUNTIME_FUNCTION_RETURN_PAIR(Name) \ | 294 #define RUNTIME_FUNCTION_RETURN_PAIR(Name) \ |
295 RUNTIME_FUNCTION_RETURNS_TYPE(ObjectPair, Name) | 295 RUNTIME_FUNCTION_RETURNS_TYPE(ObjectPair, Name) |
296 #define RUNTIME_FUNCTION_RETURN_TRIPLE(Name) \ | 296 #define RUNTIME_FUNCTION_RETURN_TRIPLE(Name) \ |
297 RUNTIME_FUNCTION_RETURNS_TYPE(ObjectTriple, Name) | 297 RUNTIME_FUNCTION_RETURNS_TYPE(ObjectTriple, Name) |
298 | 298 |
299 } // namespace internal | 299 } // namespace internal |
300 } // namespace v8 | 300 } // namespace v8 |
301 | 301 |
302 #endif // V8_ARGUMENTS_H_ | 302 #endif // V8_ARGUMENTS_H_ |
OLD | NEW |