Chromium Code Reviews

Unified Diff: src/ia32/full-codegen-ia32.cc

Issue 13542002: Calling a generator function returns a generator object (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Fix whitespace; more tests Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « src/heap.cc ('k') | src/objects.h » ('j') | src/x64/full-codegen-x64.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/full-codegen-ia32.cc
diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc
index 87aa9ece742e858fa3147c0e614789af9e7a6719..c3307c2b624122b3fa525988836e20a61cfc46ad 100644
--- a/src/ia32/full-codegen-ia32.cc
+++ b/src/ia32/full-codegen-ia32.cc
@@ -291,6 +291,14 @@ void FullCodeGenerator::Generate() {
__ bind(&ok);
}
+ if (function()->is_generator()) {
+ Comment cmnt(masm_, "[ Generator Iterator");
+ __ push(Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
+ __ CallRuntime(Runtime::kCreateJSGeneratorIterator, 1);
+ // TODO(wingo): Suspend the generator.
+ EmitReturnSequence();
+ }
+
{ Comment cmnt(masm_, "[ Body");
ASSERT(loop_depth() == 0);
VisitStatements(function()->body());
« no previous file with comments | « src/heap.cc ('k') | src/objects.h » ('j') | src/x64/full-codegen-x64.cc » ('J')

Powered by Google App Engine