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

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

Issue 2554723004: [Interpreter] Transform StrictEquality with null/undefined to special bytecodes. (Closed)
Patch Set: rebased the patch. Created 4 years 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 | src/interpreter/bytecode-peephole-optimizer.cc » ('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/compiler/bytecode-graph-builder.h" 5 #include "src/compiler/bytecode-graph-builder.h"
6 6
7 #include "src/ast/ast.h" 7 #include "src/ast/ast.h"
8 #include "src/ast/scopes.h" 8 #include "src/ast/scopes.h"
9 #include "src/compilation-info.h" 9 #include "src/compilation-info.h"
10 #include "src/compiler/compiler-source-position-table.h" 10 #include "src/compiler/compiler-source-position-table.h"
(...skipping 1647 matching lines...) Expand 10 before | Expand all | Expand 10 after
1658 BuildCompareOp(javascript()->InstanceOf()); 1658 BuildCompareOp(javascript()->InstanceOf());
1659 } 1659 }
1660 1660
1661 void BytecodeGraphBuilder::VisitTestUndetectable() { 1661 void BytecodeGraphBuilder::VisitTestUndetectable() {
1662 Node* object = 1662 Node* object =
1663 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); 1663 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0));
1664 Node* node = NewNode(jsgraph()->simplified()->ObjectIsUndetectable(), object); 1664 Node* node = NewNode(jsgraph()->simplified()->ObjectIsUndetectable(), object);
1665 environment()->BindAccumulator(node); 1665 environment()->BindAccumulator(node);
1666 } 1666 }
1667 1667
1668 void BytecodeGraphBuilder::VisitTestNull() {
1669 Node* object =
1670 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0));
1671 Node* result = NewNode(javascript()->StrictEqual(CompareOperationHint::kAny),
1672 object, jsgraph()->NullConstant());
1673 environment()->BindAccumulator(result);
1674 }
1675
1676 void BytecodeGraphBuilder::VisitTestUndefined() {
1677 Node* object =
1678 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0));
1679 Node* result = NewNode(javascript()->StrictEqual(CompareOperationHint::kAny),
1680 object, jsgraph()->UndefinedConstant());
1681 environment()->BindAccumulator(result);
1682 }
1683
1668 void BytecodeGraphBuilder::BuildCastOperator(const Operator* js_op) { 1684 void BytecodeGraphBuilder::BuildCastOperator(const Operator* js_op) {
1669 PrepareEagerCheckpoint(); 1685 PrepareEagerCheckpoint();
1670 Node* value = NewNode(js_op, environment()->LookupAccumulator()); 1686 Node* value = NewNode(js_op, environment()->LookupAccumulator());
1671 environment()->BindRegister(bytecode_iterator().GetRegisterOperand(0), value, 1687 environment()->BindRegister(bytecode_iterator().GetRegisterOperand(0), value,
1672 Environment::kAttachFrameState); 1688 Environment::kAttachFrameState);
1673 } 1689 }
1674 1690
1675 void BytecodeGraphBuilder::VisitToName() { 1691 void BytecodeGraphBuilder::VisitToName() {
1676 BuildCastOperator(javascript()->ToName()); 1692 BuildCastOperator(javascript()->ToName());
1677 } 1693 }
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after
2236 it->source_position().ScriptOffset(), start_position_.InliningId())); 2252 it->source_position().ScriptOffset(), start_position_.InliningId()));
2237 it->Advance(); 2253 it->Advance();
2238 } else { 2254 } else {
2239 DCHECK_GT(it->code_offset(), offset); 2255 DCHECK_GT(it->code_offset(), offset);
2240 } 2256 }
2241 } 2257 }
2242 2258
2243 } // namespace compiler 2259 } // namespace compiler
2244 } // namespace internal 2260 } // namespace internal
2245 } // namespace v8 2261 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/interpreter/bytecode-peephole-optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698