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

Side by Side Diff: src/interpreter/bytecode-generator.cc

Issue 2251003003: Merged 7fe4d930c9772dfc5f8e506920ad435863ee3b1d (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@5.3
Patch Set: Created 4 years, 4 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 | test/cctest/interpreter/bytecode_expectations/Generators.golden » ('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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/interpreter/bytecode-generator.h" 5 #include "src/interpreter/bytecode-generator.h"
6 6
7 #include "src/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/compiler.h" 9 #include "src/compiler.h"
10 #include "src/interpreter/bytecode-register-allocator.h" 10 #include "src/interpreter/bytecode-register-allocator.h"
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 .JumpIfUndefined(&regular_call); 689 .JumpIfUndefined(&regular_call);
690 690
691 // This is a resume call. Restore registers and perform state dispatch. 691 // This is a resume call. Restore registers and perform state dispatch.
692 // (The current context has already been restored by the trampoline.) 692 // (The current context has already been restored by the trampoline.)
693 builder() 693 builder()
694 ->ResumeGenerator(generator_object) 694 ->ResumeGenerator(generator_object)
695 .StoreAccumulatorInRegister(generator_state_); 695 .StoreAccumulatorInRegister(generator_state_);
696 BuildIndexedJump(generator_state_, 0, generator_resume_points_.size(), 696 BuildIndexedJump(generator_state_, 0, generator_resume_points_.size(),
697 generator_resume_points_); 697 generator_resume_points_);
698 698
699 builder()->Bind(&regular_call); 699 builder()
700 ->Bind(&regular_call)
701 .LoadLiteral(Smi::FromInt(JSGeneratorObject::kGeneratorExecuting))
702 .StoreAccumulatorInRegister(generator_state_);
700 // This is a regular call. Fall through to the ordinary function prologue, 703 // This is a regular call. Fall through to the ordinary function prologue,
701 // after which we will run into the generator object creation and other extra 704 // after which we will run into the generator object creation and other extra
702 // code inserted by the parser. 705 // code inserted by the parser.
703 } 706 }
704 707
705 void BytecodeGenerator::VisitBlock(Block* stmt) { 708 void BytecodeGenerator::VisitBlock(Block* stmt) {
706 // Visit declarations and statements. 709 // Visit declarations and statements.
707 if (stmt->scope() != nullptr && stmt->scope()->NeedsContext()) { 710 if (stmt->scope() != nullptr && stmt->scope()->NeedsContext()) {
708 VisitNewLocalBlockContext(stmt->scope()); 711 VisitNewLocalBlockContext(stmt->scope());
709 ContextScope scope(this, stmt->scope()); 712 ContextScope scope(this, stmt->scope());
(...skipping 2468 matching lines...) Expand 10 before | Expand all | Expand 10 after
3178 return execution_context()->scope()->language_mode(); 3181 return execution_context()->scope()->language_mode();
3179 } 3182 }
3180 3183
3181 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { 3184 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const {
3182 return TypeFeedbackVector::GetIndex(slot); 3185 return TypeFeedbackVector::GetIndex(slot);
3183 } 3186 }
3184 3187
3185 } // namespace interpreter 3188 } // namespace interpreter
3186 } // namespace internal 3189 } // namespace internal
3187 } // namespace v8 3190 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/cctest/interpreter/bytecode_expectations/Generators.golden » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698