| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ | 5 #ifndef V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ |
| 6 #define V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ | 6 #define V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ |
| 7 | 7 |
| 8 #include "src/compiler/common-operator.h" | 8 #include "src/compiler/common-operator.h" |
| 9 #include "src/compiler/graph-builder.h" | 9 #include "src/compiler/graph-builder.h" |
| 10 #include "src/compiler/linkage.h" | 10 #include "src/compiler/linkage.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 Node* Float32Constant(float value) { | 83 Node* Float32Constant(float value) { |
| 84 return NewNode(common()->Float32Constant(value)); | 84 return NewNode(common()->Float32Constant(value)); |
| 85 } | 85 } |
| 86 Node* Float64Constant(double value) { | 86 Node* Float64Constant(double value) { |
| 87 return NewNode(common()->Float64Constant(value)); | 87 return NewNode(common()->Float64Constant(value)); |
| 88 } | 88 } |
| 89 Node* HeapConstant(Handle<HeapObject> object) { | 89 Node* HeapConstant(Handle<HeapObject> object) { |
| 90 Unique<HeapObject> val = Unique<HeapObject>::CreateUninitialized(object); | 90 Unique<HeapObject> val = Unique<HeapObject>::CreateUninitialized(object); |
| 91 return NewNode(common()->HeapConstant(val)); | 91 return NewNode(common()->HeapConstant(val)); |
| 92 } | 92 } |
| 93 Node* ExternalConstant(ExternalReference address) { |
| 94 return NewNode(common()->ExternalConstant(address)); |
| 95 } |
| 93 | 96 |
| 94 Node* Projection(int index, Node* a) { | 97 Node* Projection(int index, Node* a) { |
| 95 return NewNode(common()->Projection(index), a); | 98 return NewNode(common()->Projection(index), a); |
| 96 } | 99 } |
| 97 | 100 |
| 98 // Memory Operations. | 101 // Memory Operations. |
| 99 Node* Load(MachineType rep, Node* base) { | 102 Node* Load(MachineType rep, Node* base) { |
| 100 return Load(rep, base, Int32Constant(0)); | 103 return Load(rep, base, IntPtrConstant(0)); |
| 101 } | 104 } |
| 102 Node* Load(MachineType rep, Node* base, Node* index) { | 105 Node* Load(MachineType rep, Node* base, Node* index) { |
| 103 return NewNode(machine()->Load(rep), base, index, graph()->start(), | 106 return NewNode(machine()->Load(rep), base, index, graph()->start(), |
| 104 graph()->start()); | 107 graph()->start()); |
| 105 } | 108 } |
| 106 void Store(MachineType rep, Node* base, Node* value) { | 109 void Store(MachineType rep, Node* base, Node* value) { |
| 107 Store(rep, base, Int32Constant(0), value); | 110 Store(rep, base, IntPtrConstant(0), value); |
| 108 } | 111 } |
| 109 void Store(MachineType rep, Node* base, Node* index, Node* value) { | 112 void Store(MachineType rep, Node* base, Node* index, Node* value) { |
| 110 NewNode(machine()->Store(StoreRepresentation(rep, kNoWriteBarrier)), base, | 113 NewNode(machine()->Store(StoreRepresentation(rep, kNoWriteBarrier)), base, |
| 111 index, value, graph()->start(), graph()->start()); | 114 index, value, graph()->start(), graph()->start()); |
| 112 } | 115 } |
| 113 // Arithmetic Operations. | 116 // Arithmetic Operations. |
| 114 Node* WordAnd(Node* a, Node* b) { | 117 Node* WordAnd(Node* a, Node* b) { |
| 115 return NewNode(machine()->WordAnd(), a, b); | 118 return NewNode(machine()->WordAnd(), a, b); |
| 116 } | 119 } |
| 117 Node* WordOr(Node* a, Node* b) { return NewNode(machine()->WordOr(), a, b); } | 120 Node* WordOr(Node* a, Node* b) { return NewNode(machine()->WordOr(), a, b); } |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 Node* Int64Div(Node* a, Node* b) { | 277 Node* Int64Div(Node* a, Node* b) { |
| 275 return NewNode(machine()->Int64Div(), a, b); | 278 return NewNode(machine()->Int64Div(), a, b); |
| 276 } | 279 } |
| 277 Node* Int64Mod(Node* a, Node* b) { | 280 Node* Int64Mod(Node* a, Node* b) { |
| 278 return NewNode(machine()->Int64Mod(), a, b); | 281 return NewNode(machine()->Int64Mod(), a, b); |
| 279 } | 282 } |
| 280 Node* Int64Neg(Node* a) { return Int64Sub(Int64Constant(0), a); } | 283 Node* Int64Neg(Node* a) { return Int64Sub(Int64Constant(0), a); } |
| 281 Node* Int64LessThan(Node* a, Node* b) { | 284 Node* Int64LessThan(Node* a, Node* b) { |
| 282 return NewNode(machine()->Int64LessThan(), a, b); | 285 return NewNode(machine()->Int64LessThan(), a, b); |
| 283 } | 286 } |
| 287 Node* Uint64LessThan(Node* a, Node* b) { |
| 288 return NewNode(machine()->Uint64LessThan(), a, b); |
| 289 } |
| 284 Node* Int64LessThanOrEqual(Node* a, Node* b) { | 290 Node* Int64LessThanOrEqual(Node* a, Node* b) { |
| 285 return NewNode(machine()->Int64LessThanOrEqual(), a, b); | 291 return NewNode(machine()->Int64LessThanOrEqual(), a, b); |
| 286 } | 292 } |
| 287 Node* Int64GreaterThan(Node* a, Node* b) { return Int64LessThan(b, a); } | 293 Node* Int64GreaterThan(Node* a, Node* b) { return Int64LessThan(b, a); } |
| 288 Node* Int64GreaterThanOrEqual(Node* a, Node* b) { | 294 Node* Int64GreaterThanOrEqual(Node* a, Node* b) { |
| 289 return Int64LessThanOrEqual(b, a); | 295 return Int64LessThanOrEqual(b, a); |
| 290 } | 296 } |
| 291 Node* Uint64Div(Node* a, Node* b) { | 297 Node* Uint64Div(Node* a, Node* b) { |
| 292 return NewNode(machine()->Uint64Div(), a, b); | 298 return NewNode(machine()->Uint64Div(), a, b); |
| 293 } | 299 } |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 Node* Float64ExtractHighWord32(Node* a) { | 406 Node* Float64ExtractHighWord32(Node* a) { |
| 401 return NewNode(machine()->Float64ExtractHighWord32(), a); | 407 return NewNode(machine()->Float64ExtractHighWord32(), a); |
| 402 } | 408 } |
| 403 Node* Float64InsertLowWord32(Node* a, Node* b) { | 409 Node* Float64InsertLowWord32(Node* a, Node* b) { |
| 404 return NewNode(machine()->Float64InsertLowWord32(), a, b); | 410 return NewNode(machine()->Float64InsertLowWord32(), a, b); |
| 405 } | 411 } |
| 406 Node* Float64InsertHighWord32(Node* a, Node* b) { | 412 Node* Float64InsertHighWord32(Node* a, Node* b) { |
| 407 return NewNode(machine()->Float64InsertHighWord32(), a, b); | 413 return NewNode(machine()->Float64InsertHighWord32(), a, b); |
| 408 } | 414 } |
| 409 | 415 |
| 416 // Stack operations. |
| 417 Node* LoadStackPointer() { return NewNode(machine()->LoadStackPointer()); } |
| 418 |
| 410 // Parameters. | 419 // Parameters. |
| 411 Node* Parameter(size_t index); | 420 Node* Parameter(size_t index); |
| 412 | 421 |
| 413 // Control flow. | 422 // Control flow. |
| 414 Label* Exit(); | 423 Label* Exit(); |
| 415 void Goto(Label* label); | 424 void Goto(Label* label); |
| 416 void Branch(Node* condition, Label* true_val, Label* false_val); | 425 void Branch(Node* condition, Label* true_val, Label* false_val); |
| 417 void Switch(Node* index, Label* default_label, int32_t* case_values, | 426 void Switch(Node* index, Label* default_label, int32_t* case_values, |
| 418 Label** case_labels, size_t case_count); | 427 Label** case_labels, size_t case_count); |
| 419 // Call through CallFunctionStub with lazy deopt and frame-state. | 428 // Call through CallFunctionStub with lazy deopt and frame-state. |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 BasicBlock* current_block_; | 478 BasicBlock* current_block_; |
| 470 | 479 |
| 471 DISALLOW_COPY_AND_ASSIGN(RawMachineAssembler); | 480 DISALLOW_COPY_AND_ASSIGN(RawMachineAssembler); |
| 472 }; | 481 }; |
| 473 | 482 |
| 474 } // namespace compiler | 483 } // namespace compiler |
| 475 } // namespace internal | 484 } // namespace internal |
| 476 } // namespace v8 | 485 } // namespace v8 |
| 477 | 486 |
| 478 #endif // V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ | 487 #endif // V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ |
| OLD | NEW |