| OLD | NEW |
| 1 // Copyright 2017 the V8 project authors. All rights reserved. | 1 // Copyright 2017 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/builtins-async-gen.h" | 5 #include "src/builtins/builtins-async-gen.h" |
| 6 #include "src/builtins/builtins-utils-gen.h" | 6 #include "src/builtins/builtins-utils-gen.h" |
| 7 #include "src/builtins/builtins.h" | 7 #include "src/builtins/builtins.h" |
| 8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
| 9 #include "src/code-stub-assembler.h" | 9 #include "src/code-stub-assembler.h" |
| 10 #include "src/frames-inl.h" | 10 #include "src/frames-inl.h" |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 } | 196 } |
| 197 | 197 |
| 198 BIND(&merge); | 198 BIND(&merge); |
| 199 // Ensure `iterResult.done` is a Boolean. | 199 // Ensure `iterResult.done` is a Boolean. |
| 200 GotoIf(TaggedIsSmi(var_done.value()), &to_boolean); | 200 GotoIf(TaggedIsSmi(var_done.value()), &to_boolean); |
| 201 Branch(IsBoolean(var_done.value()), &done, &to_boolean); | 201 Branch(IsBoolean(var_done.value()), &done, &to_boolean); |
| 202 | 202 |
| 203 BIND(&to_boolean); | 203 BIND(&to_boolean); |
| 204 { | 204 { |
| 205 Node* const result = | 205 Node* const result = |
| 206 CallStub(CodeFactory::ToBoolean(isolate()), context, var_done.value()); | 206 CallBuiltin(Builtins::kToBoolean, context, var_done.value()); |
| 207 var_done.Bind(result); | 207 var_done.Bind(result); |
| 208 Goto(&done); | 208 Goto(&done); |
| 209 } | 209 } |
| 210 | 210 |
| 211 BIND(&done); | 211 BIND(&done); |
| 212 return std::make_pair(var_value.value(), var_done.value()); | 212 return std::make_pair(var_value.value(), var_done.value()); |
| 213 } | 213 } |
| 214 } // namespace | 214 } // namespace |
| 215 | 215 |
| 216 // https://tc39.github.io/proposal-async-iteration/ | 216 // https://tc39.github.io/proposal-async-iteration/ |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 Label* if_exception) { Goto(if_exception); }; | 265 Label* if_exception) { Goto(if_exception); }; |
| 266 | 266 |
| 267 Generate_AsyncFromSyncIteratorMethod( | 267 Generate_AsyncFromSyncIteratorMethod( |
| 268 context, iterator, reason, factory()->throw_string(), if_throw_undefined, | 268 context, iterator, reason, factory()->throw_string(), if_throw_undefined, |
| 269 "[Async-from-Sync Iterator].prototype.throw", Label::kNonDeferred, | 269 "[Async-from-Sync Iterator].prototype.throw", Label::kNonDeferred, |
| 270 reason); | 270 reason); |
| 271 } | 271 } |
| 272 | 272 |
| 273 } // namespace internal | 273 } // namespace internal |
| 274 } // namespace v8 | 274 } // namespace v8 |
| OLD | NEW |