| 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 #ifdef USE_SIMULATOR | |
| 9 #define MACHINE_ASSEMBLER_SUPPORTS_CALL_C 0 | |
| 10 #else | |
| 11 #define MACHINE_ASSEMBLER_SUPPORTS_CALL_C 1 | |
| 12 #endif | |
| 13 | |
| 14 #include "src/v8.h" | 8 #include "src/v8.h" |
| 15 | 9 |
| 16 #include "src/compiler/common-operator.h" | 10 #include "src/compiler/common-operator.h" |
| 17 #include "src/compiler/graph-builder.h" | 11 #include "src/compiler/graph-builder.h" |
| 18 #include "src/compiler/linkage.h" | 12 #include "src/compiler/linkage.h" |
| 19 #include "src/compiler/machine-operator.h" | 13 #include "src/compiler/machine-operator.h" |
| 20 #include "src/compiler/node.h" | 14 #include "src/compiler/node.h" |
| 21 #include "src/compiler/operator.h" | 15 #include "src/compiler/operator.h" |
| 22 | 16 |
| 23 | 17 |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 Node* ChangeUint32ToUint64(Node* a) { | 362 Node* ChangeUint32ToUint64(Node* a) { |
| 369 return NewNode(machine()->ChangeUint32ToUint64(), a); | 363 return NewNode(machine()->ChangeUint32ToUint64(), a); |
| 370 } | 364 } |
| 371 Node* TruncateFloat64ToInt32(Node* a) { | 365 Node* TruncateFloat64ToInt32(Node* a) { |
| 372 return NewNode(machine()->TruncateFloat64ToInt32(), a); | 366 return NewNode(machine()->TruncateFloat64ToInt32(), a); |
| 373 } | 367 } |
| 374 Node* TruncateInt64ToInt32(Node* a) { | 368 Node* TruncateInt64ToInt32(Node* a) { |
| 375 return NewNode(machine()->TruncateInt64ToInt32(), a); | 369 return NewNode(machine()->TruncateInt64ToInt32(), a); |
| 376 } | 370 } |
| 377 | 371 |
| 378 #ifdef MACHINE_ASSEMBLER_SUPPORTS_CALL_C | |
| 379 // Call to C. | |
| 380 Node* CallC(Node* function_address, MachineType return_type, | |
| 381 MachineType* arg_types, Node** args, int n_args) { | |
| 382 CallDescriptor* descriptor = | |
| 383 Linkage::GetSimplifiedCDescriptor(zone(), machine_sig()); | |
| 384 Node** passed_args = zone()->NewArray<Node*>(n_args + 1); | |
| 385 passed_args[0] = function_address; | |
| 386 for (int i = 0; i < n_args; ++i) { | |
| 387 passed_args[i + 1] = args[i]; | |
| 388 } | |
| 389 return NewNode(common()->Call(descriptor), n_args + 1, passed_args); | |
| 390 } | |
| 391 #endif | |
| 392 | |
| 393 // Parameters. | 372 // Parameters. |
| 394 Node* Parameter(size_t index); | 373 Node* Parameter(size_t index); |
| 395 | 374 |
| 396 // Control flow. | 375 // Control flow. |
| 397 Label* Exit(); | 376 Label* Exit(); |
| 398 void Goto(Label* label); | 377 void Goto(Label* label); |
| 399 void Branch(Node* condition, Label* true_val, Label* false_val); | 378 void Branch(Node* condition, Label* true_val, Label* false_val); |
| 400 // Call through CallFunctionStub with lazy deopt and frame-state. | 379 // Call through CallFunctionStub with lazy deopt and frame-state. |
| 401 Node* CallFunctionStub0(Node* function, Node* receiver, Node* context, | 380 Node* CallFunctionStub0(Node* function, Node* receiver, Node* context, |
| 402 Node* frame_state, CallFunctionFlags flags); | 381 Node* frame_state, CallFunctionFlags flags); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 BasicBlock* current_block_; | 429 BasicBlock* current_block_; |
| 451 | 430 |
| 452 DISALLOW_COPY_AND_ASSIGN(RawMachineAssembler); | 431 DISALLOW_COPY_AND_ASSIGN(RawMachineAssembler); |
| 453 }; | 432 }; |
| 454 | 433 |
| 455 } // namespace compiler | 434 } // namespace compiler |
| 456 } // namespace internal | 435 } // namespace internal |
| 457 } // namespace v8 | 436 } // namespace v8 |
| 458 | 437 |
| 459 #endif // V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ | 438 #endif // V8_COMPILER_RAW_MACHINE_ASSEMBLER_H_ |
| OLD | NEW |