| 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 #include <cmath> | 5 #include <cmath> |
| 6 #include <functional> | 6 #include <functional> |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "src/assembler.h" | 9 #include "src/assembler.h" |
| 10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 compiler::Operator::kNoProperties, // properties | 62 compiler::Operator::kNoProperties, // properties |
| 63 kCalleeSaveRegisters, // callee-saved registers | 63 kCalleeSaveRegisters, // callee-saved registers |
| 64 kCalleeSaveFPRegisters, // callee-saved fp regs | 64 kCalleeSaveFPRegisters, // callee-saved fp regs |
| 65 CallDescriptor::kNoFlags, // flags | 65 CallDescriptor::kNoFlags, // flags |
| 66 "c-call"); | 66 "c-call"); |
| 67 } | 67 } |
| 68 } // namespace | 68 } // namespace |
| 69 | 69 |
| 70 | 70 |
| 71 TEST(ReturnThreeValues) { | 71 TEST(ReturnThreeValues) { |
| 72 Zone zone; | 72 base::AccountingAllocator allocator; |
| 73 Zone zone(&allocator); |
| 73 CallDescriptor* desc = GetCallDescriptor(&zone, 3, 2); | 74 CallDescriptor* desc = GetCallDescriptor(&zone, 3, 2); |
| 74 HandleAndZoneScope handles; | 75 HandleAndZoneScope handles; |
| 75 RawMachineAssembler m(handles.main_isolate(), | 76 RawMachineAssembler m(handles.main_isolate(), |
| 76 new (handles.main_zone()) Graph(handles.main_zone()), | 77 new (handles.main_zone()) Graph(handles.main_zone()), |
| 77 desc, MachineType::PointerRepresentation(), | 78 desc, MachineType::PointerRepresentation(), |
| 78 InstructionSelector::SupportedMachineOperatorFlags()); | 79 InstructionSelector::SupportedMachineOperatorFlags()); |
| 79 | 80 |
| 80 Node* p0 = m.Parameter(0); | 81 Node* p0 = m.Parameter(0); |
| 81 Node* p1 = m.Parameter(1); | 82 Node* p1 = m.Parameter(1); |
| 82 Node* add = m.Int32Add(p0, p1); | 83 Node* add = m.Int32Add(p0, p1); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 109 OFStream os(stdout); | 110 OFStream os(stdout); |
| 110 code2->Disassemble("three_value_call", os); | 111 code2->Disassemble("three_value_call", os); |
| 111 } | 112 } |
| 112 #endif | 113 #endif |
| 113 CHECK_EQ((123 + 456) + (123 - 456) + (123 * 456), mt.Call()); | 114 CHECK_EQ((123 + 456) + (123 - 456) + (123 * 456), mt.Call()); |
| 114 } | 115 } |
| 115 | 116 |
| 116 } // namespace compiler | 117 } // namespace compiler |
| 117 } // namespace internal | 118 } // namespace internal |
| 118 } // namespace v8 | 119 } // namespace v8 |
| OLD | NEW |