| 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 | 194 |
| 195 Node* CodeAssembler::TruncateFloat64ToInt32RoundToZero(Node* a) { | 195 Node* CodeAssembler::TruncateFloat64ToInt32RoundToZero(Node* a) { |
| 196 return raw_assembler_->TruncateFloat64ToInt32(TruncationMode::kRoundToZero, | 196 return raw_assembler_->TruncateFloat64ToInt32(TruncationMode::kRoundToZero, |
| 197 a); | 197 a); |
| 198 } | 198 } |
| 199 | 199 |
| 200 Node* CodeAssembler::TruncateFloat64ToInt32JavaScript(Node* a) { | 200 Node* CodeAssembler::TruncateFloat64ToInt32JavaScript(Node* a) { |
| 201 return raw_assembler_->TruncateFloat64ToInt32(TruncationMode::kJavaScript, a); | 201 return raw_assembler_->TruncateFloat64ToInt32(TruncationMode::kJavaScript, a); |
| 202 } | 202 } |
| 203 | 203 |
| 204 Node* CodeAssembler::ChangeUint32ToWord(Node* value) { |
| 205 if (raw_assembler_->machine()->Is64()) { |
| 206 value = raw_assembler_->ChangeUint32ToUint64(value); |
| 207 } |
| 208 return value; |
| 209 } |
| 210 |
| 204 #define DEFINE_CODE_ASSEMBLER_UNARY_OP(name) \ | 211 #define DEFINE_CODE_ASSEMBLER_UNARY_OP(name) \ |
| 205 Node* CodeAssembler::name(Node* a) { return raw_assembler_->name(a); } | 212 Node* CodeAssembler::name(Node* a) { return raw_assembler_->name(a); } |
| 206 CODE_ASSEMBLER_UNARY_OP_LIST(DEFINE_CODE_ASSEMBLER_UNARY_OP) | 213 CODE_ASSEMBLER_UNARY_OP_LIST(DEFINE_CODE_ASSEMBLER_UNARY_OP) |
| 207 #undef DEFINE_CODE_ASSEMBLER_UNARY_OP | 214 #undef DEFINE_CODE_ASSEMBLER_UNARY_OP |
| 208 | 215 |
| 209 Node* CodeAssembler::LoadRoot(Heap::RootListIndex root_index) { | 216 Node* CodeAssembler::LoadRoot(Heap::RootListIndex root_index) { |
| 210 if (isolate()->heap()->RootCanBeTreatedAsConstant(root_index)) { | 217 if (isolate()->heap()->RootCanBeTreatedAsConstant(root_index)) { |
| 211 Handle<Object> root = isolate()->heap()->root_handle(root_index); | 218 Handle<Object> root = isolate()->heap()->root_handle(root_index); |
| 212 if (root->IsSmi()) { | 219 if (root->IsSmi()) { |
| 213 return SmiConstant(Smi::cast(*root)); | 220 return SmiConstant(Smi::cast(*root)); |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 } | 355 } |
| 349 | 356 |
| 350 Node* CodeAssembler::Load(MachineType rep, Node* base) { | 357 Node* CodeAssembler::Load(MachineType rep, Node* base) { |
| 351 return raw_assembler_->Load(rep, base); | 358 return raw_assembler_->Load(rep, base); |
| 352 } | 359 } |
| 353 | 360 |
| 354 Node* CodeAssembler::Load(MachineType rep, Node* base, Node* index) { | 361 Node* CodeAssembler::Load(MachineType rep, Node* base, Node* index) { |
| 355 return raw_assembler_->Load(rep, base, index); | 362 return raw_assembler_->Load(rep, base, index); |
| 356 } | 363 } |
| 357 | 364 |
| 365 Node* CodeAssembler::AtomicLoad(MachineType rep, Node* base, Node* index) { |
| 366 return raw_assembler_->AtomicLoad(rep, base, index); |
| 367 } |
| 368 |
| 358 Node* CodeAssembler::Store(MachineRepresentation rep, Node* base, Node* value) { | 369 Node* CodeAssembler::Store(MachineRepresentation rep, Node* base, Node* value) { |
| 359 return raw_assembler_->Store(rep, base, value, kFullWriteBarrier); | 370 return raw_assembler_->Store(rep, base, value, kFullWriteBarrier); |
| 360 } | 371 } |
| 361 | 372 |
| 362 Node* CodeAssembler::Store(MachineRepresentation rep, Node* base, Node* index, | 373 Node* CodeAssembler::Store(MachineRepresentation rep, Node* base, Node* index, |
| 363 Node* value) { | 374 Node* value) { |
| 364 return raw_assembler_->Store(rep, base, index, value, kFullWriteBarrier); | 375 return raw_assembler_->Store(rep, base, index, value, kFullWriteBarrier); |
| 365 } | 376 } |
| 366 | 377 |
| 367 Node* CodeAssembler::StoreNoWriteBarrier(MachineRepresentation rep, Node* base, | 378 Node* CodeAssembler::StoreNoWriteBarrier(MachineRepresentation rep, Node* base, |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 805 } | 816 } |
| 806 } | 817 } |
| 807 } | 818 } |
| 808 | 819 |
| 809 bound_ = true; | 820 bound_ = true; |
| 810 } | 821 } |
| 811 | 822 |
| 812 } // namespace compiler | 823 } // namespace compiler |
| 813 } // namespace internal | 824 } // namespace internal |
| 814 } // namespace v8 | 825 } // namespace v8 |
| OLD | NEW |