OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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_BUILTINS_BUILTINS_UTILS_H_ | 5 #ifndef V8_BUILTINS_BUILTINS_UTILS_H_ |
6 #define V8_BUILTINS_BUILTINS_UTILS_H_ | 6 #define V8_BUILTINS_BUILTINS_UTILS_H_ |
7 | 7 |
8 #include "src/arguments.h" | 8 #include "src/arguments.h" |
9 #include "src/base/logging.h" | 9 #include "src/base/logging.h" |
10 #include "src/builtins/builtins.h" | 10 #include "src/builtins/builtins.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 BuiltinArguments args(args_length, args_object); \ | 84 BuiltinArguments args(args_length, args_object); \ |
85 RuntimeCallTimerScope timer(isolate, &RuntimeCallStats::Builtin_##name); \ | 85 RuntimeCallTimerScope timer(isolate, &RuntimeCallStats::Builtin_##name); \ |
86 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.runtime"), \ | 86 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.runtime"), \ |
87 "V8.Builtin_" #name); \ | 87 "V8.Builtin_" #name); \ |
88 return Builtin_Impl_##name(args, isolate); \ | 88 return Builtin_Impl_##name(args, isolate); \ |
89 } \ | 89 } \ |
90 \ | 90 \ |
91 MUST_USE_RESULT Object* Builtin_##name( \ | 91 MUST_USE_RESULT Object* Builtin_##name( \ |
92 int args_length, Object** args_object, Isolate* isolate) { \ | 92 int args_length, Object** args_object, Isolate* isolate) { \ |
93 DCHECK(isolate->context() == nullptr || isolate->context()->IsContext()); \ | 93 DCHECK(isolate->context() == nullptr || isolate->context()->IsContext()); \ |
94 if (V8_UNLIKELY(TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_ENABLED() || \ | 94 if (V8_UNLIKELY(FLAG_runtime_stats)) { \ |
95 FLAG_runtime_call_stats)) { \ | |
96 return Builtin_Impl_Stats_##name(args_length, args_object, isolate); \ | 95 return Builtin_Impl_Stats_##name(args_length, args_object, isolate); \ |
97 } \ | 96 } \ |
98 BuiltinArguments args(args_length, args_object); \ | 97 BuiltinArguments args(args_length, args_object); \ |
99 return Builtin_Impl_##name(args, isolate); \ | 98 return Builtin_Impl_##name(args, isolate); \ |
100 } \ | 99 } \ |
101 \ | 100 \ |
102 MUST_USE_RESULT static Object* Builtin_Impl_##name(BuiltinArguments args, \ | 101 MUST_USE_RESULT static Object* Builtin_Impl_##name(BuiltinArguments args, \ |
103 Isolate* isolate) | 102 Isolate* isolate) |
104 | 103 |
105 // ---------------------------------------------------------------------------- | 104 // ---------------------------------------------------------------------------- |
(...skipping 20 matching lines...) Expand all Loading... |
126 isolate->factory()->NewStringFromAsciiChecked(method))); \ | 125 isolate->factory()->NewStringFromAsciiChecked(method))); \ |
127 } \ | 126 } \ |
128 Handle<String> name; \ | 127 Handle<String> name; \ |
129 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( \ | 128 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( \ |
130 isolate, name, Object::ToString(isolate, args.receiver())) | 129 isolate, name, Object::ToString(isolate, args.receiver())) |
131 | 130 |
132 } // namespace internal | 131 } // namespace internal |
133 } // namespace v8 | 132 } // namespace v8 |
134 | 133 |
135 #endif // V8_BUILTINS_BUILTINS_UTILS_H_ | 134 #endif // V8_BUILTINS_BUILTINS_UTILS_H_ |
OLD | NEW |