OLD | NEW |
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 Loading... |
689 .JumpIfUndefined(®ular_call); | 689 .JumpIfUndefined(®ular_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(®ular_call); | 699 builder() |
| 700 ->Bind(®ular_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 Loading... |
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 |
OLD | NEW |