Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(191)

Side by Side Diff: src/builtins/builtins-array.cc

Issue 2622833002: WIP [esnext] implement async iteration proposal (Closed)
Patch Set: Make (most of) for-await-of work (no IteratorClose yet..) Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 4
5 #include "src/builtins/builtins.h" 5 #include "src/builtins/builtins.h"
6 #include "src/builtins/builtins-utils.h" 6 #include "src/builtins/builtins-utils.h"
7 7
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/contexts.h" 10 #include "src/contexts.h"
(...skipping 2264 matching lines...) Expand 10 before | Expand all | Expand 10 after
2275 typedef compiler::Node Node; 2275 typedef compiler::Node Node;
2276 typedef CodeStubAssembler::Label Label; 2276 typedef CodeStubAssembler::Label Label;
2277 typedef CodeStubAssembler::Variable Variable; 2277 typedef CodeStubAssembler::Variable Variable;
2278 CodeStubAssembler assembler(state); 2278 CodeStubAssembler assembler(state);
2279 2279
2280 Handle<String> operation = assembler.factory()->NewStringFromAsciiChecked( 2280 Handle<String> operation = assembler.factory()->NewStringFromAsciiChecked(
2281 "Array Iterator.prototype.next", TENURED); 2281 "Array Iterator.prototype.next", TENURED);
2282 2282
2283 Node* iterator = assembler.Parameter(0); 2283 Node* iterator = assembler.Parameter(0);
2284 Node* context = assembler.Parameter(3); 2284 Node* context = assembler.Parameter(3);
2285
2286 Variable var_value(&assembler, MachineRepresentation::kTagged); 2285 Variable var_value(&assembler, MachineRepresentation::kTagged);
2287 Variable var_done(&assembler, MachineRepresentation::kTagged); 2286 Variable var_done(&assembler, MachineRepresentation::kTagged);
2288 2287
2289 // Required, or else `throw_bad_receiver` fails a DCHECK due to these 2288 // Required, or else `throw_bad_receiver` fails a DCHECK due to these
2290 // variables not being bound along all paths, despite not being used. 2289 // variables not being bound along all paths, despite not being used.
2291 var_done.Bind(assembler.TrueConstant()); 2290 var_done.Bind(assembler.TrueConstant());
2292 var_value.Bind(assembler.UndefinedConstant()); 2291 var_value.Bind(assembler.UndefinedConstant());
2293 2292
2294 Label throw_bad_receiver(&assembler, Label::kDeferred); 2293 Label throw_bad_receiver(&assembler, Label::kDeferred);
2295 Label set_done(&assembler); 2294 Label set_done(&assembler);
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
2746 Node* message = assembler.SmiConstant(MessageTemplate::kDetachedOperation); 2745 Node* message = assembler.SmiConstant(MessageTemplate::kDetachedOperation);
2747 Node* result = 2746 Node* result =
2748 assembler.CallRuntime(Runtime::kThrowTypeError, context, message, 2747 assembler.CallRuntime(Runtime::kThrowTypeError, context, message,
2749 assembler.HeapConstant(operation)); 2748 assembler.HeapConstant(operation));
2750 assembler.Return(result); 2749 assembler.Return(result);
2751 } 2750 }
2752 } 2751 }
2753 2752
2754 } // namespace internal 2753 } // namespace internal
2755 } // namespace v8 2754 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698