Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
| 10 #include "src/ast/prettyprinter.h" | 10 #include "src/ast/prettyprinter.h" |
| (...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 504 RUNTIME_FUNCTION(Runtime_AllowDynamicFunction) { | 504 RUNTIME_FUNCTION(Runtime_AllowDynamicFunction) { |
| 505 HandleScope scope(isolate); | 505 HandleScope scope(isolate); |
| 506 DCHECK_EQ(1, args.length()); | 506 DCHECK_EQ(1, args.length()); |
| 507 CONVERT_ARG_HANDLE_CHECKED(JSFunction, target, 0); | 507 CONVERT_ARG_HANDLE_CHECKED(JSFunction, target, 0); |
| 508 Handle<JSObject> global_proxy(target->global_proxy(), isolate); | 508 Handle<JSObject> global_proxy(target->global_proxy(), isolate); |
| 509 return *isolate->factory()->ToBoolean( | 509 return *isolate->factory()->ToBoolean( |
| 510 Builtins::AllowDynamicFunction(isolate, target, global_proxy)); | 510 Builtins::AllowDynamicFunction(isolate, target, global_proxy)); |
| 511 } | 511 } |
| 512 | 512 |
| 513 RUNTIME_FUNCTION(Runtime_CreateAsyncFromSyncIterator) { | 513 RUNTIME_FUNCTION(Runtime_CreateAsyncFromSyncIterator) { |
| 514 // TODO(caitp): split AsyncFromSyncIterator functionality out of | 514 HandleScope scope(isolate); |
| 515 // https://codereview.chromium.org/2622833002 | 515 DCHECK_EQ(1, args.length()); |
| 516 UNREACHABLE(); | 516 |
| 517 return isolate->heap()->undefined_value(); | 517 CONVERT_ARG_HANDLE_CHECKED(Object, sync_iterator, 0); |
| 518 | |
| 519 if (!sync_iterator->IsJSReceiver()) { | |
| 520 THROW_NEW_ERROR_RETURN_FAILURE( | |
| 521 isolate, NewTypeError(MessageTemplate::kSymbolIteratorInvalid)); | |
| 522 } | |
| 523 | |
| 524 return *isolate->factory()->NewJSAsyncFromSyncIterator( | |
| 525 Handle<HeapObject>::cast(sync_iterator)); | |
|
jgruber
2017/02/17 12:28:23
We just asserted it's a JSReceiver - can we make t
caitp
2017/02/17 14:56:11
This _may_ be a problem for heap verifier, if veri
| |
| 518 } | 526 } |
| 519 | 527 |
| 520 } // namespace internal | 528 } // namespace internal |
| 521 } // namespace v8 | 529 } // namespace v8 |
| OLD | NEW |