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

Side by Side Diff: src/compiler/bytecode-graph-builder.cc

Issue 1634153002: [Interpreter] Adds support for const/let variables to interpreter. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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
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/compiler/bytecode-graph-builder.h" 5 #include "src/compiler/bytecode-graph-builder.h"
6 6
7 #include "src/compiler/bytecode-branch-analysis.h" 7 #include "src/compiler/bytecode-branch-analysis.h"
8 #include "src/compiler/linkage.h" 8 #include "src/compiler/linkage.h"
9 #include "src/compiler/operator-properties.h" 9 #include "src/compiler/operator-properties.h"
10 #include "src/interpreter/bytecodes.h" 10 #include "src/interpreter/bytecodes.h"
(...skipping 1746 matching lines...) Expand 10 before | Expand all | Expand 10 after
1757 const interpreter::BytecodeArrayIterator& iterator) { 1757 const interpreter::BytecodeArrayIterator& iterator) {
1758 BuildJumpIfEqual(jsgraph()->UndefinedConstant()); 1758 BuildJumpIfEqual(jsgraph()->UndefinedConstant());
1759 } 1759 }
1760 1760
1761 1761
1762 void BytecodeGraphBuilder::VisitJumpIfUndefinedConstantWide( 1762 void BytecodeGraphBuilder::VisitJumpIfUndefinedConstantWide(
1763 const interpreter::BytecodeArrayIterator& iterator) { 1763 const interpreter::BytecodeArrayIterator& iterator) {
1764 BuildJumpIfEqual(jsgraph()->UndefinedConstant()); 1764 BuildJumpIfEqual(jsgraph()->UndefinedConstant());
1765 } 1765 }
1766 1766
1767 void BytecodeGraphBuilder::VisitJumpIfHole(
1768 const interpreter::BytecodeArrayIterator& iterator) {
1769 BuildJumpIfEqual(jsgraph()->TheHoleConstant());
1770 }
1771
1772 void BytecodeGraphBuilder::VisitJumpIfNotHole(
1773 const interpreter::BytecodeArrayIterator& iterator) {
1774 Node* accumulator = environment()->LookupAccumulator();
1775 Node* condition = NewNode(javascript()->StrictEqual(), accumulator,
1776 jsgraph()->TheHoleConstant());
1777 Node* node =
1778 NewNode(common()->Select(MachineRepresentation::kTagged), condition,
1779 jsgraph()->FalseConstant(), jsgraph()->TrueConstant());
1780 BuildConditionalJump(node);
1781 }
1767 1782
1768 void BytecodeGraphBuilder::VisitReturn( 1783 void BytecodeGraphBuilder::VisitReturn(
1769 const interpreter::BytecodeArrayIterator& iterator) { 1784 const interpreter::BytecodeArrayIterator& iterator) {
1770 Node* control = 1785 Node* control =
1771 NewNode(common()->Return(), environment()->LookupAccumulator()); 1786 NewNode(common()->Return(), environment()->LookupAccumulator());
1772 UpdateControlDependencyToLeaveFunction(control); 1787 UpdateControlDependencyToLeaveFunction(control);
1773 set_environment(nullptr); 1788 set_environment(nullptr);
1774 } 1789 }
1775 1790
1776 1791
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
2101 2116
2102 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) { 2117 void BytecodeGraphBuilder::UpdateControlDependencyToLeaveFunction(Node* exit) {
2103 if (environment()->IsMarkedAsUnreachable()) return; 2118 if (environment()->IsMarkedAsUnreachable()) return;
2104 environment()->MarkAsUnreachable(); 2119 environment()->MarkAsUnreachable();
2105 exit_controls_.push_back(exit); 2120 exit_controls_.push_back(exit);
2106 } 2121 }
2107 2122
2108 } // namespace compiler 2123 } // namespace compiler
2109 } // namespace internal 2124 } // namespace internal
2110 } // namespace v8 2125 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/interpreter/bytecode-array-builder.h » ('j') | src/interpreter/bytecode-generator.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698