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-flags.h" | 10 #include "src/interpreter/bytecode-flags.h" |
(...skipping 858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
869 .JumpIfUndefined(®ular_call); | 869 .JumpIfUndefined(®ular_call); |
870 | 870 |
871 // This is a resume call. Restore registers and perform state dispatch. | 871 // This is a resume call. Restore registers and perform state dispatch. |
872 // (The current context has already been restored by the trampoline.) | 872 // (The current context has already been restored by the trampoline.) |
873 builder() | 873 builder() |
874 ->ResumeGenerator(generator_object) | 874 ->ResumeGenerator(generator_object) |
875 .StoreAccumulatorInRegister(generator_state_); | 875 .StoreAccumulatorInRegister(generator_state_); |
876 BuildIndexedJump(generator_state_, 0, generator_resume_points_.size(), | 876 BuildIndexedJump(generator_state_, 0, generator_resume_points_.size(), |
877 generator_resume_points_); | 877 generator_resume_points_); |
878 | 878 |
879 builder()->Bind(®ular_call); | 879 builder() |
880 ->Bind(®ular_call) | |
881 .LoadLiteral(Smi::FromInt(JSGeneratorObject::kGeneratorExecuting)) | |
882 .StoreAccumulatorInRegister(generator_state_); | |
Dan Ehrenberg
2016/08/17 13:44:34
Looks like you're doing this extra load/store for
rmcilroy
2016/08/17 13:53:40
+1
| |
880 // This is a regular call. Fall through to the ordinary function prologue, | 883 // This is a regular call. Fall through to the ordinary function prologue, |
881 // after which we will run into the generator object creation and other extra | 884 // after which we will run into the generator object creation and other extra |
882 // code inserted by the parser. | 885 // code inserted by the parser. |
883 } | 886 } |
884 | 887 |
885 void BytecodeGenerator::VisitBlock(Block* stmt) { | 888 void BytecodeGenerator::VisitBlock(Block* stmt) { |
886 // Visit declarations and statements. | 889 // Visit declarations and statements. |
887 if (stmt->scope() != nullptr && stmt->scope()->NeedsContext()) { | 890 if (stmt->scope() != nullptr && stmt->scope()->NeedsContext()) { |
888 VisitNewLocalBlockContext(stmt->scope()); | 891 VisitNewLocalBlockContext(stmt->scope()); |
889 ContextScope scope(this, stmt->scope()); | 892 ContextScope scope(this, stmt->scope()); |
(...skipping 2532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3422 return execution_context()->scope()->language_mode(); | 3425 return execution_context()->scope()->language_mode(); |
3423 } | 3426 } |
3424 | 3427 |
3425 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { | 3428 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { |
3426 return TypeFeedbackVector::GetIndex(slot); | 3429 return TypeFeedbackVector::GetIndex(slot); |
3427 } | 3430 } |
3428 | 3431 |
3429 } // namespace interpreter | 3432 } // namespace interpreter |
3430 } // namespace internal | 3433 } // namespace internal |
3431 } // namespace v8 | 3434 } // namespace v8 |
OLD | NEW |