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/code-assembler.h" | 5 #include "src/compiler/code-assembler.h" |
6 | 6 |
7 #include <ostream> | 7 #include <ostream> |
8 | 8 |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/compiler/graph.h" | 10 #include "src/compiler/graph.h" |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 | 141 |
142 return false; | 142 return false; |
143 } | 143 } |
144 | 144 |
145 bool CodeAssembler::ToInt64Constant(Node* node, int64_t& out_value) { | 145 bool CodeAssembler::ToInt64Constant(Node* node, int64_t& out_value) { |
146 Int64Matcher m(node); | 146 Int64Matcher m(node); |
147 if (m.HasValue()) out_value = m.Value(); | 147 if (m.HasValue()) out_value = m.Value(); |
148 return m.HasValue(); | 148 return m.HasValue(); |
149 } | 149 } |
150 | 150 |
| 151 bool CodeAssembler::ToSmiConstant(Node* node, Smi*& out_value) { |
| 152 if (node->opcode() == IrOpcode::kBitcastWordToTaggedSigned) { |
| 153 node = node->InputAt(0); |
| 154 } else { |
| 155 return false; |
| 156 } |
| 157 IntPtrMatcher m(node); |
| 158 if (m.HasValue()) { |
| 159 out_value = Smi::cast(bit_cast<Object*>(m.Value())); |
| 160 return true; |
| 161 } |
| 162 return false; |
| 163 } |
| 164 |
151 bool CodeAssembler::ToIntPtrConstant(Node* node, intptr_t& out_value) { | 165 bool CodeAssembler::ToIntPtrConstant(Node* node, intptr_t& out_value) { |
152 IntPtrMatcher m(node); | 166 IntPtrMatcher m(node); |
153 if (m.HasValue()) out_value = m.Value(); | 167 if (m.HasValue()) out_value = m.Value(); |
154 return m.HasValue(); | 168 return m.HasValue(); |
155 } | 169 } |
156 | 170 |
157 Node* CodeAssembler::Parameter(int value) { | 171 Node* CodeAssembler::Parameter(int value) { |
158 return raw_assembler_->Parameter(value); | 172 return raw_assembler_->Parameter(value); |
159 } | 173 } |
160 | 174 |
(...skipping 956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1117 } | 1131 } |
1118 } | 1132 } |
1119 } | 1133 } |
1120 | 1134 |
1121 bound_ = true; | 1135 bound_ = true; |
1122 } | 1136 } |
1123 | 1137 |
1124 } // namespace compiler | 1138 } // namespace compiler |
1125 } // namespace internal | 1139 } // namespace internal |
1126 } // namespace v8 | 1140 } // namespace v8 |
OLD | NEW |