Chromium Code Reviews

Side by Side Diff: src/x64/full-codegen-x64.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.
Jump to:
View unified diff |
« no previous file with comments | « src/runtime.cc ('k') | test/mjsunit/harmony/generators-iteration.js » ('j') | no next file with comments »
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 266 matching lines...)
277 { Comment cmnt(masm_, "[ Stack check"); 277 { Comment cmnt(masm_, "[ Stack check");
278 PrepareForBailoutForId(BailoutId::Declarations(), NO_REGISTERS); 278 PrepareForBailoutForId(BailoutId::Declarations(), NO_REGISTERS);
279 Label ok; 279 Label ok;
280 __ CompareRoot(rsp, Heap::kStackLimitRootIndex); 280 __ CompareRoot(rsp, Heap::kStackLimitRootIndex);
281 __ j(above_equal, &ok, Label::kNear); 281 __ j(above_equal, &ok, Label::kNear);
282 StackCheckStub stub; 282 StackCheckStub stub;
283 __ CallStub(&stub); 283 __ CallStub(&stub);
284 __ bind(&ok); 284 __ bind(&ok);
285 } 285 }
286 286
287 if (function()->is_generator()) {
wingo 2013/04/03 16:36:24 How to communicate this iterator object from its a
288 Comment cmnt(masm_, "[ Generator Iterator");
289 __ push(Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
290 __ CallRuntime(Runtime::kCreateJSGeneratorIterator, 1);
291 // TODO(wingo): Suspend the generator.
292 EmitReturnSequence();
293 }
294
287 { Comment cmnt(masm_, "[ Body"); 295 { Comment cmnt(masm_, "[ Body");
288 ASSERT(loop_depth() == 0); 296 ASSERT(loop_depth() == 0);
289 VisitStatements(function()->body()); 297 VisitStatements(function()->body());
290 ASSERT(loop_depth() == 0); 298 ASSERT(loop_depth() == 0);
291 } 299 }
292 } 300 }
293 301
294 // Always emit a 'return undefined' in case control fell off the end of 302 // Always emit a 'return undefined' in case control fell off the end of
295 // the body. 303 // the body.
296 { Comment cmnt(masm_, "[ return <undefined>;"); 304 { Comment cmnt(masm_, "[ return <undefined>;");
(...skipping 4257 matching lines...)
4554 *context_length = 0; 4562 *context_length = 0;
4555 return previous_; 4563 return previous_;
4556 } 4564 }
4557 4565
4558 4566
4559 #undef __ 4567 #undef __
4560 4568
4561 } } // namespace v8::internal 4569 } } // namespace v8::internal
4562 4570
4563 #endif // V8_TARGET_ARCH_X64 4571 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/runtime.cc ('k') | test/mjsunit/harmony/generators-iteration.js » ('j') | no next file with comments »

Powered by Google App Engine