Chromium Code Reviews| 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/debug/debug.h" | 6 #include "src/debug/debug.h" |
| 7 #include "src/elements.h" | 7 #include "src/elements.h" |
| 8 #include "src/promise-utils.h" | 8 #include "src/promise-utils.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 272 if (reject_reactions->IsJSObject()) { | 272 if (reject_reactions->IsJSObject()) { |
| 273 return *reject_reactions; | 273 return *reject_reactions; |
| 274 } | 274 } |
| 275 | 275 |
| 276 DCHECK(reject_reactions->IsFixedArray()); | 276 DCHECK(reject_reactions->IsFixedArray()); |
| 277 return *isolate->factory()->NewJSArrayWithElements( | 277 return *isolate->factory()->NewJSArrayWithElements( |
| 278 Handle<FixedArray>::cast(reject_reactions)); | 278 Handle<FixedArray>::cast(reject_reactions)); |
| 279 } | 279 } |
| 280 | 280 |
| 281 RUNTIME_FUNCTION(Runtime_PromiseMarkAsHandled) { | 281 RUNTIME_FUNCTION(Runtime_PromiseMarkAsHandled) { |
| 282 HandleScope scope(isolate); | 282 SealHandleScope shs(isolate); |
| 283 DCHECK(args.length() == 1); | 283 DCHECK(args.length() == 1); |
| 284 CONVERT_ARG_HANDLE_CHECKED(JSPromise, promise, 0); | 284 CONVERT_ARG_HANDLE_CHECKED(JSPromise, promise, 0); |
|
adamk
2016/12/27 17:44:58
When using SealHandleScope you don't want to creat
| |
| 285 | 285 |
| 286 promise->set_has_handler(true); | 286 promise->set_has_handler(true); |
| 287 return isolate->heap()->undefined_value(); | 287 return isolate->heap()->undefined_value(); |
| 288 } | 288 } |
| 289 | 289 |
| 290 RUNTIME_FUNCTION(Runtime_PromiseMarkHandledHint) { | |
| 291 SealHandleScope shs(isolate); | |
| 292 DCHECK(args.length() == 1); | |
| 293 CONVERT_ARG_HANDLE_CHECKED(JSPromise, promise, 0); | |
|
adamk
2016/12/27 17:44:58
Same down here.
| |
| 294 | |
| 295 promise->set_handled_hint(true); | |
| 296 return isolate->heap()->undefined_value(); | |
| 297 } | |
| 298 | |
| 290 RUNTIME_FUNCTION(Runtime_PromiseHookInit) { | 299 RUNTIME_FUNCTION(Runtime_PromiseHookInit) { |
| 291 HandleScope scope(isolate); | 300 HandleScope scope(isolate); |
| 292 DCHECK_EQ(2, args.length()); | 301 DCHECK_EQ(2, args.length()); |
| 293 CONVERT_ARG_HANDLE_CHECKED(JSPromise, promise, 0); | 302 CONVERT_ARG_HANDLE_CHECKED(JSPromise, promise, 0); |
| 294 CONVERT_ARG_HANDLE_CHECKED(Object, parent, 1); | 303 CONVERT_ARG_HANDLE_CHECKED(Object, parent, 1); |
| 295 isolate->RunPromiseHook(PromiseHookType::kInit, promise, parent); | 304 isolate->RunPromiseHook(PromiseHookType::kInit, promise, parent); |
| 296 return isolate->heap()->undefined_value(); | 305 return isolate->heap()->undefined_value(); |
| 297 } | 306 } |
| 298 | 307 |
| 299 RUNTIME_FUNCTION(Runtime_PromiseHookResolve) { | 308 RUNTIME_FUNCTION(Runtime_PromiseHookResolve) { |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 318 HandleScope scope(isolate); | 327 HandleScope scope(isolate); |
| 319 DCHECK_EQ(1, args.length()); | 328 DCHECK_EQ(1, args.length()); |
| 320 CONVERT_ARG_HANDLE_CHECKED(JSPromise, promise, 0); | 329 CONVERT_ARG_HANDLE_CHECKED(JSPromise, promise, 0); |
| 321 isolate->RunPromiseHook(PromiseHookType::kAfter, promise, | 330 isolate->RunPromiseHook(PromiseHookType::kAfter, promise, |
| 322 isolate->factory()->undefined_value()); | 331 isolate->factory()->undefined_value()); |
| 323 return isolate->heap()->undefined_value(); | 332 return isolate->heap()->undefined_value(); |
| 324 } | 333 } |
| 325 | 334 |
| 326 } // namespace internal | 335 } // namespace internal |
| 327 } // namespace v8 | 336 } // namespace v8 |
| OLD | NEW |