| 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 1647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |