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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 | 276 |
277 #define DEFINE_CODE_ASSEMBLER_UNARY_OP(name) \ | 277 #define DEFINE_CODE_ASSEMBLER_UNARY_OP(name) \ |
278 Node* CodeAssembler::name(Node* a) { return raw_assembler()->name(a); } | 278 Node* CodeAssembler::name(Node* a) { return raw_assembler()->name(a); } |
279 CODE_ASSEMBLER_UNARY_OP_LIST(DEFINE_CODE_ASSEMBLER_UNARY_OP) | 279 CODE_ASSEMBLER_UNARY_OP_LIST(DEFINE_CODE_ASSEMBLER_UNARY_OP) |
280 #undef DEFINE_CODE_ASSEMBLER_UNARY_OP | 280 #undef DEFINE_CODE_ASSEMBLER_UNARY_OP |
281 | 281 |
282 Node* CodeAssembler::Load(MachineType rep, Node* base) { | 282 Node* CodeAssembler::Load(MachineType rep, Node* base) { |
283 return raw_assembler()->Load(rep, base); | 283 return raw_assembler()->Load(rep, base); |
284 } | 284 } |
285 | 285 |
286 Node* CodeAssembler::Load(MachineType rep, Node* base, Node* index) { | 286 Node* CodeAssembler::Load(MachineType rep, Node* base, Node* offset) { |
287 return raw_assembler()->Load(rep, base, index); | 287 return raw_assembler()->Load(rep, base, offset); |
288 } | 288 } |
289 | 289 |
290 Node* CodeAssembler::AtomicLoad(MachineType rep, Node* base, Node* index) { | 290 Node* CodeAssembler::AtomicLoad(MachineType rep, Node* base, Node* offset) { |
291 return raw_assembler()->AtomicLoad(rep, base, index); | 291 return raw_assembler()->AtomicLoad(rep, base, offset); |
292 } | 292 } |
293 | 293 |
294 Node* CodeAssembler::LoadRoot(Heap::RootListIndex root_index) { | 294 Node* CodeAssembler::LoadRoot(Heap::RootListIndex root_index) { |
295 if (isolate()->heap()->RootCanBeTreatedAsConstant(root_index)) { | 295 if (isolate()->heap()->RootCanBeTreatedAsConstant(root_index)) { |
296 Handle<Object> root = isolate()->heap()->root_handle(root_index); | 296 Handle<Object> root = isolate()->heap()->root_handle(root_index); |
297 if (root->IsSmi()) { | 297 if (root->IsSmi()) { |
298 return SmiConstant(Smi::cast(*root)); | 298 return SmiConstant(Smi::cast(*root)); |
299 } else { | 299 } else { |
300 return HeapConstant(Handle<HeapObject>::cast(root)); | 300 return HeapConstant(Handle<HeapObject>::cast(root)); |
301 } | 301 } |
302 } | 302 } |
303 | 303 |
304 Node* roots_array_start = | 304 Node* roots_array_start = |
305 ExternalConstant(ExternalReference::roots_array_start(isolate())); | 305 ExternalConstant(ExternalReference::roots_array_start(isolate())); |
306 return Load(MachineType::AnyTagged(), roots_array_start, | 306 return Load(MachineType::AnyTagged(), roots_array_start, |
307 IntPtrConstant(root_index * kPointerSize)); | 307 IntPtrConstant(root_index * kPointerSize)); |
308 } | 308 } |
309 | 309 |
310 Node* CodeAssembler::Store(MachineRepresentation rep, Node* base, Node* value) { | 310 Node* CodeAssembler::Store(MachineRepresentation rep, Node* base, Node* value) { |
311 return raw_assembler()->Store(rep, base, value, kFullWriteBarrier); | 311 return raw_assembler()->Store(rep, base, value, kFullWriteBarrier); |
312 } | 312 } |
313 | 313 |
314 Node* CodeAssembler::Store(MachineRepresentation rep, Node* base, Node* index, | 314 Node* CodeAssembler::Store(MachineRepresentation rep, Node* base, Node* offset, |
315 Node* value) { | 315 Node* value) { |
316 return raw_assembler()->Store(rep, base, index, value, kFullWriteBarrier); | 316 return raw_assembler()->Store(rep, base, offset, value, kFullWriteBarrier); |
317 } | 317 } |
318 | 318 |
319 Node* CodeAssembler::StoreNoWriteBarrier(MachineRepresentation rep, Node* base, | 319 Node* CodeAssembler::StoreNoWriteBarrier(MachineRepresentation rep, Node* base, |
320 Node* value) { | 320 Node* value) { |
321 return raw_assembler()->Store(rep, base, value, kNoWriteBarrier); | 321 return raw_assembler()->Store(rep, base, value, kNoWriteBarrier); |
322 } | 322 } |
323 | 323 |
324 Node* CodeAssembler::StoreNoWriteBarrier(MachineRepresentation rep, Node* base, | 324 Node* CodeAssembler::StoreNoWriteBarrier(MachineRepresentation rep, Node* base, |
325 Node* index, Node* value) { | 325 Node* offset, Node* value) { |
326 return raw_assembler()->Store(rep, base, index, value, kNoWriteBarrier); | 326 return raw_assembler()->Store(rep, base, offset, value, kNoWriteBarrier); |
327 } | 327 } |
328 | 328 |
329 Node* CodeAssembler::AtomicStore(MachineRepresentation rep, Node* base, | 329 Node* CodeAssembler::AtomicStore(MachineRepresentation rep, Node* base, |
330 Node* index, Node* value) { | 330 Node* offset, Node* value) { |
331 return raw_assembler()->AtomicStore(rep, base, index, value); | 331 return raw_assembler()->AtomicStore(rep, base, offset, value); |
332 } | 332 } |
333 | 333 |
334 Node* CodeAssembler::StoreRoot(Heap::RootListIndex root_index, Node* value) { | 334 Node* CodeAssembler::StoreRoot(Heap::RootListIndex root_index, Node* value) { |
335 DCHECK(Heap::RootCanBeWrittenAfterInitialization(root_index)); | 335 DCHECK(Heap::RootCanBeWrittenAfterInitialization(root_index)); |
336 Node* roots_array_start = | 336 Node* roots_array_start = |
337 ExternalConstant(ExternalReference::roots_array_start(isolate())); | 337 ExternalConstant(ExternalReference::roots_array_start(isolate())); |
338 return StoreNoWriteBarrier(MachineRepresentation::kTagged, roots_array_start, | 338 return StoreNoWriteBarrier(MachineRepresentation::kTagged, roots_array_start, |
339 IntPtrConstant(root_index * kPointerSize), value); | 339 IntPtrConstant(root_index * kPointerSize), value); |
340 } | 340 } |
341 | 341 |
(...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1205 } | 1205 } |
1206 } | 1206 } |
1207 } | 1207 } |
1208 | 1208 |
1209 bound_ = true; | 1209 bound_ = true; |
1210 } | 1210 } |
1211 | 1211 |
1212 } // namespace compiler | 1212 } // namespace compiler |
1213 } // namespace internal | 1213 } // namespace internal |
1214 } // namespace v8 | 1214 } // namespace v8 |
OLD | NEW |