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 | 10 |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 | 264 |
265 double ClobberDoubleRegisters(double x1, double x2, double x3, double x4); | 265 double ClobberDoubleRegisters(double x1, double x2, double x3, double x4); |
266 | 266 |
267 | 267 |
268 #ifdef DEBUG | 268 #ifdef DEBUG |
269 #define CLOBBER_DOUBLE_REGISTERS() ClobberDoubleRegisters(1, 2, 3, 4); | 269 #define CLOBBER_DOUBLE_REGISTERS() ClobberDoubleRegisters(1, 2, 3, 4); |
270 #else | 270 #else |
271 #define CLOBBER_DOUBLE_REGISTERS() | 271 #define CLOBBER_DOUBLE_REGISTERS() |
272 #endif | 272 #endif |
273 | 273 |
274 #define RUNTIME_FUNCTION_RETURNS_TYPE(Type, Name) \ | 274 #define RUNTIME_FUNCTION_RETURNS_TYPE(Type, Name) \ |
275 static INLINE(Type __RT_impl_##Name(Arguments args, Isolate* isolate)); \ | 275 static INLINE(Type __RT_impl_##Name(Arguments args, Isolate* isolate)); \ |
276 Type Name(int args_length, Object** args_object, Isolate* isolate) { \ | 276 Type Name(int args_length, Object** args_object, Isolate* isolate) { \ |
277 CLOBBER_DOUBLE_REGISTERS(); \ | 277 CLOBBER_DOUBLE_REGISTERS(); \ |
278 RuntimeCallStats* stats = isolate->counters()->runtime_call_stats(); \ | 278 Arguments args(args_length, args_object); \ |
279 RuntimeCallTimerScope timer(isolate, &stats->Name); \ | 279 Type value; \ |
280 Arguments args(args_length, args_object); \ | 280 if (FLAG_runtime_call_stats) { \ |
281 Type value = __RT_impl_##Name(args, isolate); \ | 281 RuntimeCallStats* stats = isolate->counters()->runtime_call_stats(); \ |
282 return value; \ | 282 RuntimeCallTimerScope timer(isolate, &stats->Name); \ |
283 } \ | 283 value = __RT_impl_##Name(args, isolate); \ |
| 284 } else { \ |
| 285 value = __RT_impl_##Name(args, isolate); \ |
| 286 } \ |
| 287 return value; \ |
| 288 } \ |
284 static Type __RT_impl_##Name(Arguments args, Isolate* isolate) | 289 static Type __RT_impl_##Name(Arguments args, Isolate* isolate) |
285 | 290 |
286 #define RUNTIME_FUNCTION(Name) RUNTIME_FUNCTION_RETURNS_TYPE(Object*, Name) | 291 #define RUNTIME_FUNCTION(Name) RUNTIME_FUNCTION_RETURNS_TYPE(Object*, Name) |
287 #define RUNTIME_FUNCTION_RETURN_PAIR(Name) \ | 292 #define RUNTIME_FUNCTION_RETURN_PAIR(Name) \ |
288 RUNTIME_FUNCTION_RETURNS_TYPE(ObjectPair, Name) | 293 RUNTIME_FUNCTION_RETURNS_TYPE(ObjectPair, Name) |
289 #define RUNTIME_FUNCTION_RETURN_TRIPLE(Name) \ | 294 #define RUNTIME_FUNCTION_RETURN_TRIPLE(Name) \ |
290 RUNTIME_FUNCTION_RETURNS_TYPE(ObjectTriple, Name) | 295 RUNTIME_FUNCTION_RETURNS_TYPE(ObjectTriple, Name) |
291 | 296 |
292 } // namespace internal | 297 } // namespace internal |
293 } // namespace v8 | 298 } // namespace v8 |
294 | 299 |
295 #endif // V8_ARGUMENTS_H_ | 300 #endif // V8_ARGUMENTS_H_ |
OLD | NEW |