| 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 1686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1697 void BytecodeGraphBuilder::VisitJumpIfToBooleanFalseConstant() { | 1697 void BytecodeGraphBuilder::VisitJumpIfToBooleanFalseConstant() { |
| 1698 BuildJumpIfToBooleanFalse(); | 1698 BuildJumpIfToBooleanFalse(); |
| 1699 } | 1699 } |
| 1700 | 1700 |
| 1701 void BytecodeGraphBuilder::VisitJumpIfNotHole() { BuildJumpIfNotHole(); } | 1701 void BytecodeGraphBuilder::VisitJumpIfNotHole() { BuildJumpIfNotHole(); } |
| 1702 | 1702 |
| 1703 void BytecodeGraphBuilder::VisitJumpIfNotHoleConstant() { | 1703 void BytecodeGraphBuilder::VisitJumpIfNotHoleConstant() { |
| 1704 BuildJumpIfNotHole(); | 1704 BuildJumpIfNotHole(); |
| 1705 } | 1705 } |
| 1706 | 1706 |
| 1707 void BytecodeGraphBuilder::VisitJumpIfJSReceiver() { BuildJumpIfJSReceiver(); } |
| 1708 |
| 1709 void BytecodeGraphBuilder::VisitJumpIfJSReceiverConstant() { |
| 1710 BuildJumpIfJSReceiver(); |
| 1711 } |
| 1712 |
| 1707 void BytecodeGraphBuilder::VisitJumpIfNull() { | 1713 void BytecodeGraphBuilder::VisitJumpIfNull() { |
| 1708 BuildJumpIfEqual(jsgraph()->NullConstant()); | 1714 BuildJumpIfEqual(jsgraph()->NullConstant()); |
| 1709 } | 1715 } |
| 1710 | 1716 |
| 1711 void BytecodeGraphBuilder::VisitJumpIfNullConstant() { | 1717 void BytecodeGraphBuilder::VisitJumpIfNullConstant() { |
| 1712 BuildJumpIfEqual(jsgraph()->NullConstant()); | 1718 BuildJumpIfEqual(jsgraph()->NullConstant()); |
| 1713 } | 1719 } |
| 1714 | 1720 |
| 1715 void BytecodeGraphBuilder::VisitJumpIfUndefined() { | 1721 void BytecodeGraphBuilder::VisitJumpIfUndefined() { |
| 1716 BuildJumpIfEqual(jsgraph()->UndefinedConstant()); | 1722 BuildJumpIfEqual(jsgraph()->UndefinedConstant()); |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2008 } | 2014 } |
| 2009 | 2015 |
| 2010 void BytecodeGraphBuilder::BuildJumpIfNotHole() { | 2016 void BytecodeGraphBuilder::BuildJumpIfNotHole() { |
| 2011 Node* accumulator = environment()->LookupAccumulator(); | 2017 Node* accumulator = environment()->LookupAccumulator(); |
| 2012 Node* condition = | 2018 Node* condition = |
| 2013 NewNode(javascript()->StrictEqual(CompareOperationHint::kAny), | 2019 NewNode(javascript()->StrictEqual(CompareOperationHint::kAny), |
| 2014 accumulator, jsgraph()->TheHoleConstant()); | 2020 accumulator, jsgraph()->TheHoleConstant()); |
| 2015 BuildJumpIfNot(condition); | 2021 BuildJumpIfNot(condition); |
| 2016 } | 2022 } |
| 2017 | 2023 |
| 2024 void BytecodeGraphBuilder::BuildJumpIfJSReceiver() { |
| 2025 Node* accumulator = environment()->LookupAccumulator(); |
| 2026 Node* condition = NewNode(simplified()->ObjectIsReceiver(), accumulator); |
| 2027 BuildJumpIf(condition); |
| 2028 } |
| 2029 |
| 2018 Node** BytecodeGraphBuilder::EnsureInputBufferSize(int size) { | 2030 Node** BytecodeGraphBuilder::EnsureInputBufferSize(int size) { |
| 2019 if (size > input_buffer_size_) { | 2031 if (size > input_buffer_size_) { |
| 2020 size = size + kInputBufferSizeIncrement + input_buffer_size_; | 2032 size = size + kInputBufferSizeIncrement + input_buffer_size_; |
| 2021 input_buffer_ = local_zone()->NewArray<Node*>(size); | 2033 input_buffer_ = local_zone()->NewArray<Node*>(size); |
| 2022 input_buffer_size_ = size; | 2034 input_buffer_size_ = size; |
| 2023 } | 2035 } |
| 2024 return input_buffer_; | 2036 return input_buffer_; |
| 2025 } | 2037 } |
| 2026 | 2038 |
| 2027 void BytecodeGraphBuilder::EnterAndExitExceptionHandlers(int current_offset) { | 2039 void BytecodeGraphBuilder::EnterAndExitExceptionHandlers(int current_offset) { |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2210 it->source_position().ScriptOffset(), start_position_.InliningId())); | 2222 it->source_position().ScriptOffset(), start_position_.InliningId())); |
| 2211 it->Advance(); | 2223 it->Advance(); |
| 2212 } else { | 2224 } else { |
| 2213 DCHECK_GT(it->code_offset(), offset); | 2225 DCHECK_GT(it->code_offset(), offset); |
| 2214 } | 2226 } |
| 2215 } | 2227 } |
| 2216 | 2228 |
| 2217 } // namespace compiler | 2229 } // namespace compiler |
| 2218 } // namespace internal | 2230 } // namespace internal |
| 2219 } // namespace v8 | 2231 } // namespace v8 |
| OLD | NEW |