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 #include "src/builtins.h" | 5 #include "src/builtins.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/api-natives.h" | 8 #include "src/api-natives.h" |
9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
10 #include "src/base/once.h" | 10 #include "src/base/once.h" |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 // | 136 // |
137 // In the body of the builtin function the arguments can be accessed | 137 // In the body of the builtin function the arguments can be accessed |
138 // through the BuiltinArguments object args. | 138 // through the BuiltinArguments object args. |
139 | 139 |
140 #define BUILTIN(name) \ | 140 #define BUILTIN(name) \ |
141 MUST_USE_RESULT static Object* Builtin_Impl_##name(name##ArgumentsType args, \ | 141 MUST_USE_RESULT static Object* Builtin_Impl_##name(name##ArgumentsType args, \ |
142 Isolate* isolate); \ | 142 Isolate* isolate); \ |
143 MUST_USE_RESULT static Object* Builtin_##name( \ | 143 MUST_USE_RESULT static Object* Builtin_##name( \ |
144 int args_length, Object** args_object, Isolate* isolate) { \ | 144 int args_length, Object** args_object, Isolate* isolate) { \ |
145 isolate->counters()->runtime_calls()->Increment(); \ | 145 isolate->counters()->runtime_calls()->Increment(); \ |
146 base::ElapsedTimer timer; \ | |
147 if (FLAG_runtime_call_stats) { \ | 146 if (FLAG_runtime_call_stats) { \ |
148 RuntimeCallStats* stats = isolate->counters()->runtime_call_stats(); \ | 147 RuntimeCallStats* stats = isolate->counters()->runtime_call_stats(); \ |
149 stats->Enter(&stats->Builtin_##name); \ | 148 stats->Enter(&stats->Builtin_##name); \ |
150 timer.Start(); \ | |
151 } \ | 149 } \ |
152 name##ArgumentsType args(args_length, args_object); \ | 150 name##ArgumentsType args(args_length, args_object); \ |
153 Object* value = Builtin_Impl_##name(args, isolate); \ | 151 Object* value = Builtin_Impl_##name(args, isolate); \ |
154 if (FLAG_runtime_call_stats) { \ | 152 if (FLAG_runtime_call_stats) { \ |
155 isolate->counters()->runtime_call_stats()->Leave(timer.Elapsed()); \ | 153 isolate->counters()->runtime_call_stats()->Leave(); \ |
156 } \ | 154 } \ |
157 return value; \ | 155 return value; \ |
158 } \ | 156 } \ |
159 \ | 157 \ |
160 MUST_USE_RESULT static Object* Builtin_Impl_##name(name##ArgumentsType args, \ | 158 MUST_USE_RESULT static Object* Builtin_Impl_##name(name##ArgumentsType args, \ |
161 Isolate* isolate) | 159 Isolate* isolate) |
162 | 160 |
163 // ---------------------------------------------------------------------------- | 161 // ---------------------------------------------------------------------------- |
164 | 162 |
165 | 163 |
(...skipping 4216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4382 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) | 4380 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) |
4383 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) | 4381 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) |
4384 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) | 4382 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) |
4385 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 4383 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
4386 #undef DEFINE_BUILTIN_ACCESSOR_C | 4384 #undef DEFINE_BUILTIN_ACCESSOR_C |
4387 #undef DEFINE_BUILTIN_ACCESSOR_A | 4385 #undef DEFINE_BUILTIN_ACCESSOR_A |
4388 | 4386 |
4389 | 4387 |
4390 } // namespace internal | 4388 } // namespace internal |
4391 } // namespace v8 | 4389 } // namespace v8 |
OLD | NEW |