OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. Use of this | 1 // Copyright 2014 the V8 project authors. All rights reserved. Use of this |
2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
3 // LICENSE file. | 3 // 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/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/base/utils/random-number-generator.h" | 10 #include "src/base/utils/random-number-generator.h" |
(...skipping 6178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6189 c->CalleeSavedFPRegisters(), // callee saved FP | 6189 c->CalleeSavedFPRegisters(), // callee saved FP |
6190 CallDescriptor::kNoFlags, // flags | 6190 CallDescriptor::kNoFlags, // flags |
6191 "c-call-as-code"); | 6191 "c-call-as-code"); |
6192 Node* call = r.AddNode(r.common()->Call(desc), phi); | 6192 Node* call = r.AddNode(r.common()->Call(desc), phi); |
6193 r.Return(call); | 6193 r.Return(call); |
6194 | 6194 |
6195 CHECK_EQ(33, r.Call(1)); | 6195 CHECK_EQ(33, r.Call(1)); |
6196 CHECK_EQ(44, r.Call(0)); | 6196 CHECK_EQ(44, r.Call(0)); |
6197 } | 6197 } |
6198 | 6198 |
| 6199 TEST(ParentFramePointer) { |
| 6200 RawMachineAssemblerTester<int32_t> r(MachineType::Int32()); |
| 6201 RawMachineLabel tlabel; |
| 6202 RawMachineLabel flabel; |
| 6203 RawMachineLabel merge; |
| 6204 Node* frame = r.LoadFramePointer(); |
| 6205 Node* parent_frame = r.LoadParentFramePointer(); |
| 6206 frame = r.Load(MachineType::IntPtr(), frame); |
| 6207 r.Branch(r.WordEqual(frame, parent_frame), &tlabel, &flabel); |
| 6208 r.Bind(&tlabel); |
| 6209 Node* fa = r.Int32Constant(1); |
| 6210 r.Goto(&merge); |
| 6211 r.Bind(&flabel); |
| 6212 Node* fb = r.Int32Constant(0); |
| 6213 r.Goto(&merge); |
| 6214 r.Bind(&merge); |
| 6215 Node* phi = r.Phi(MachineRepresentation::kWord32, fa, fb); |
| 6216 r.Return(phi); |
| 6217 CHECK_EQ(1, r.Call(1)); |
| 6218 } |
| 6219 |
6199 } // namespace compiler | 6220 } // namespace compiler |
6200 } // namespace internal | 6221 } // namespace internal |
6201 } // namespace v8 | 6222 } // namespace v8 |
OLD | NEW |