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 #include "src/runtime/runtime-utils.h" | 4 #include "src/runtime/runtime-utils.h" |
5 | 5 |
6 #include "src/arguments.h" | 6 #include "src/arguments.h" |
7 #include "src/counters.h" | 7 #include "src/counters.h" |
8 #include "src/debug/debug.h" | 8 #include "src/debug/debug.h" |
9 #include "src/elements.h" | 9 #include "src/elements.h" |
10 #include "src/objects-inl.h" | 10 #include "src/objects-inl.h" |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
155 isolate->RunPromiseHook(PromiseHookType::kBefore, | 155 isolate->RunPromiseHook(PromiseHookType::kBefore, |
156 Handle<JSPromise>::cast(promise), | 156 Handle<JSPromise>::cast(promise), |
157 isolate->factory()->undefined_value()); | 157 isolate->factory()->undefined_value()); |
158 } | 158 } |
159 return isolate->heap()->undefined_value(); | 159 return isolate->heap()->undefined_value(); |
160 } | 160 } |
161 | 161 |
162 RUNTIME_FUNCTION(Runtime_PromiseHookAfter) { | 162 RUNTIME_FUNCTION(Runtime_PromiseHookAfter) { |
163 HandleScope scope(isolate); | 163 HandleScope scope(isolate); |
164 DCHECK_EQ(1, args.length()); | 164 DCHECK_EQ(1, args.length()); |
165 CONVERT_ARG_HANDLE_CHECKED(JSObject, promise, 0); | 165 CONVERT_ARG_HANDLE_CHECKED(JSObject, arg, 0); |
166 if (promise->IsJSPromise()) { | 166 if (arg->IsJSPromise()) { |
167 isolate->RunPromiseHook(PromiseHookType::kAfter, | 167 isolate->RunPromiseHook(PromiseHookType::kAfter, |
168 Handle<JSPromise>::cast(promise), | 168 Handle<JSPromise>::cast(arg), |
169 isolate->factory()->undefined_value()); | 169 isolate->factory()->undefined_value()); |
170 } | 170 } |
171 return isolate->heap()->undefined_value(); | 171 return isolate->heap()->undefined_value(); |
172 } | 172 } |
173 | 173 |
174 RUNTIME_FUNCTION(Runtime_IncrementWaitCount) { | |
gsathya
2017/03/16 17:39:04
Can you move these to runtime-test.cc?
| |
175 isolate->IncrementWaitCountForTesting(); | |
176 return isolate->heap()->undefined_value(); | |
177 } | |
178 | |
179 RUNTIME_FUNCTION(Runtime_DecrementWaitCount) { | |
180 isolate->DecrementWaitCountForTesting(); | |
181 return isolate->heap()->undefined_value(); | |
182 } | |
174 } // namespace internal | 183 } // namespace internal |
175 } // namespace v8 | 184 } // namespace v8 |
OLD | NEW |