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/compiler.h" | 8 #include "src/compiler.h" |
9 #include "src/interpreter/bytecode-register-allocator.h" | 9 #include "src/interpreter/bytecode-register-allocator.h" |
10 #include "src/interpreter/control-flow-builders.h" | 10 #include "src/interpreter/control-flow-builders.h" |
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
617 VisitThisFunctionVariable(scope()->this_function_var()); | 617 VisitThisFunctionVariable(scope()->this_function_var()); |
618 | 618 |
619 // Build assignment to {new.target} variable if it is used. | 619 // Build assignment to {new.target} variable if it is used. |
620 VisitNewTargetVariable(scope()->new_target_var()); | 620 VisitNewTargetVariable(scope()->new_target_var()); |
621 | 621 |
622 // TODO(rmcilroy): Emit tracing call if requested to do so. | 622 // TODO(rmcilroy): Emit tracing call if requested to do so. |
623 if (FLAG_trace) { | 623 if (FLAG_trace) { |
624 UNIMPLEMENTED(); | 624 UNIMPLEMENTED(); |
625 } | 625 } |
626 | 626 |
627 // Visit illegal re-declaration and bail out if it exists. | |
628 if (scope()->HasIllegalRedeclaration()) { | |
629 Expression* illegal = scope()->GetIllegalRedeclaration(); | |
630 builder()->SetExpressionAsStatementPosition(illegal); | |
631 VisitForEffect(illegal); | |
632 return; | |
633 } | |
634 | |
635 // Visit declarations within the function scope. | 627 // Visit declarations within the function scope. |
636 VisitDeclarations(scope()->declarations()); | 628 VisitDeclarations(scope()->declarations()); |
637 | 629 |
638 // Perform a stack-check before the body. | 630 // Perform a stack-check before the body. |
639 builder()->StackCheck(); | 631 builder()->StackCheck(); |
640 | 632 |
641 // Visit statements in the function body. | 633 // Visit statements in the function body. |
642 VisitStatements(info()->literal()->body()); | 634 VisitStatements(info()->literal()->body()); |
643 } | 635 } |
644 | 636 |
(...skipping 2510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3155 } | 3147 } |
3156 | 3148 |
3157 | 3149 |
3158 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { | 3150 int BytecodeGenerator::feedback_index(FeedbackVectorSlot slot) const { |
3159 return info()->feedback_vector()->GetIndex(slot); | 3151 return info()->feedback_vector()->GetIndex(slot); |
3160 } | 3152 } |
3161 | 3153 |
3162 } // namespace interpreter | 3154 } // namespace interpreter |
3163 } // namespace internal | 3155 } // namespace internal |
3164 } // namespace v8 | 3156 } // namespace v8 |
OLD | NEW |