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

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

Issue 2554723004: [Interpreter] Transform StrictEquality with null/undefined to special bytecodes. (Closed)
Patch Set: "Fixed a DCHECK" 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
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 1633 matching lines...) Expand 10 before | Expand all | Expand 10 after
1644 BuildCompareOp(javascript()->InstanceOf()); 1644 BuildCompareOp(javascript()->InstanceOf());
1645 } 1645 }
1646 1646
1647 void BytecodeGraphBuilder::VisitTestUndetectable() { 1647 void BytecodeGraphBuilder::VisitTestUndetectable() {
1648 Node* object = 1648 Node* object =
1649 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0)); 1649 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0));
1650 Node* node = NewNode(jsgraph()->simplified()->ObjectIsUndetectable(), object); 1650 Node* node = NewNode(jsgraph()->simplified()->ObjectIsUndetectable(), object);
1651 environment()->BindAccumulator(node); 1651 environment()->BindAccumulator(node);
1652 } 1652 }
1653 1653
1654 void BytecodeGraphBuilder::VisitTestNull() {
1655 Node* object =
1656 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0));
1657 Node* result = NewNode(javascript()->StrictEqual(CompareOperationHint::kAny),
1658 object, jsgraph()->NullConstant());
1659 environment()->BindAccumulator(result);
1660 }
1661
1662 void BytecodeGraphBuilder::VisitTestUndefined() {
1663 Node* object =
1664 environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0));
1665 Node* result = NewNode(javascript()->StrictEqual(CompareOperationHint::kAny),
1666 object, jsgraph()->UndefinedConstant());
1667 environment()->BindAccumulator(result);
1668 }
1669
1654 void BytecodeGraphBuilder::BuildCastOperator(const Operator* js_op) { 1670 void BytecodeGraphBuilder::BuildCastOperator(const Operator* js_op) {
1655 PrepareEagerCheckpoint(); 1671 PrepareEagerCheckpoint();
1656 Node* value = NewNode(js_op, environment()->LookupAccumulator()); 1672 Node* value = NewNode(js_op, environment()->LookupAccumulator());
1657 environment()->BindRegister(bytecode_iterator().GetRegisterOperand(0), value, 1673 environment()->BindRegister(bytecode_iterator().GetRegisterOperand(0), value,
1658 Environment::kAttachFrameState); 1674 Environment::kAttachFrameState);
1659 } 1675 }
1660 1676
1661 void BytecodeGraphBuilder::VisitToName() { 1677 void BytecodeGraphBuilder::VisitToName() {
1662 BuildCastOperator(javascript()->ToName()); 1678 BuildCastOperator(javascript()->ToName());
1663 } 1679 }
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
2210 it->source_position().ScriptOffset(), start_position_.InliningId())); 2226 it->source_position().ScriptOffset(), start_position_.InliningId()));
2211 it->Advance(); 2227 it->Advance();
2212 } else { 2228 } else {
2213 DCHECK_GT(it->code_offset(), offset); 2229 DCHECK_GT(it->code_offset(), offset);
2214 } 2230 }
2215 } 2231 }
2216 2232
2217 } // namespace compiler 2233 } // namespace compiler
2218 } // namespace internal 2234 } // namespace internal
2219 } // namespace v8 2235 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/interpreter/bytecode-peephole-optimizer.cc » ('j') | src/interpreter/interpreter.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698