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/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 Loading... |
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 Loading... |
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 |
OLD | NEW |