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

Side by Side Diff: src/arm/full-codegen-arm.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, 8 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
« no previous file with comments | « no previous file | src/factory.h » ('j') | src/x64/full-codegen-x64.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 Label ok; 293 Label ok;
294 __ LoadRoot(ip, Heap::kStackLimitRootIndex); 294 __ LoadRoot(ip, Heap::kStackLimitRootIndex);
295 __ cmp(sp, Operand(ip)); 295 __ cmp(sp, Operand(ip));
296 __ b(hs, &ok); 296 __ b(hs, &ok);
297 PredictableCodeSizeScope predictable(masm_, 2 * Assembler::kInstrSize); 297 PredictableCodeSizeScope predictable(masm_, 2 * Assembler::kInstrSize);
298 StackCheckStub stub; 298 StackCheckStub stub;
299 __ CallStub(&stub); 299 __ CallStub(&stub);
300 __ bind(&ok); 300 __ bind(&ok);
301 } 301 }
302 302
303 if (function()->is_generator()) {
304 Comment cmnt(masm_, "[ Generator Iterator");
305 __ ldr(r2, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
306 __ push(r2);
307 __ CallRuntime(Runtime::kCreateJSGeneratorIterator, 1);
308 // TODO(wingo): Suspend the generator.
309 EmitReturnSequence();
310 }
311
303 { Comment cmnt(masm_, "[ Body"); 312 { Comment cmnt(masm_, "[ Body");
304 ASSERT(loop_depth() == 0); 313 ASSERT(loop_depth() == 0);
305 VisitStatements(function()->body()); 314 VisitStatements(function()->body());
306 ASSERT(loop_depth() == 0); 315 ASSERT(loop_depth() == 0);
307 } 316 }
308 } 317 }
309 318
310 // Always emit a 'return undefined' in case control fell off the end of 319 // Always emit a 'return undefined' in case control fell off the end of
311 // the body. 320 // the body.
312 { Comment cmnt(masm_, "[ return <undefined>;"); 321 { Comment cmnt(masm_, "[ return <undefined>;");
(...skipping 4270 matching lines...) Expand 10 before | Expand all | Expand 10 after
4583 *context_length = 0; 4592 *context_length = 0;
4584 return previous_; 4593 return previous_;
4585 } 4594 }
4586 4595
4587 4596
4588 #undef __ 4597 #undef __
4589 4598
4590 } } // namespace v8::internal 4599 } } // namespace v8::internal
4591 4600
4592 #endif // V8_TARGET_ARCH_ARM 4601 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/factory.h » ('j') | src/x64/full-codegen-x64.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698