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 <limits> | 5 #include <limits> |
6 | 6 |
7 #include "src/compiler/access-builder.h" | 7 #include "src/compiler/access-builder.h" |
8 #include "src/compiler/control-builders.h" | 8 #include "src/compiler/control-builders.h" |
9 #include "src/compiler/generic-node-inl.h" | 9 #include "src/compiler/generic-node-inl.h" |
10 #include "src/compiler/graph-visualizer.h" | 10 #include "src/compiler/graph-visualizer.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 void LowerAllNodes() { | 49 void LowerAllNodes() { |
50 this->End(); | 50 this->End(); |
51 lowering.LowerAllNodes(); | 51 lowering.LowerAllNodes(); |
52 } | 52 } |
53 | 53 |
54 Factory* factory() { return this->isolate()->factory(); } | 54 Factory* factory() { return this->isolate()->factory(); } |
55 Heap* heap() { return this->isolate()->heap(); } | 55 Heap* heap() { return this->isolate()->heap(); } |
56 }; | 56 }; |
57 | 57 |
58 | 58 |
59 #ifndef V8_TARGET_ARCH_ARM64 | |
60 // TODO(titzer): these result in a stub call that doesn't work on ARM64. | |
61 // TODO(titzer): factor these tests out to test-run-simplifiedops.cc. | 59 // TODO(titzer): factor these tests out to test-run-simplifiedops.cc. |
62 // TODO(titzer): test tagged representation for input to NumberToInt32. | 60 // TODO(titzer): test tagged representation for input to NumberToInt32. |
63 TEST(RunNumberToInt32_float64) { | 61 TEST(RunNumberToInt32_float64) { |
64 // TODO(titzer): explicit load/stores here are only because of representations | 62 // TODO(titzer): explicit load/stores here are only because of representations |
65 double input; | 63 double input; |
66 int32_t result; | 64 int32_t result; |
67 SimplifiedLoweringTester<Object*> t; | 65 SimplifiedLoweringTester<Object*> t; |
68 FieldAccess load = {kUntaggedBase, 0, Handle<Name>(), Type::Number(), | 66 FieldAccess load = {kUntaggedBase, 0, Handle<Name>(), Type::Number(), |
69 kMachFloat64}; | 67 kMachFloat64}; |
70 Node* loaded = t.LoadField(load, t.PointerConstant(&input)); | 68 Node* loaded = t.LoadField(load, t.PointerConstant(&input)); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 | 104 |
107 if (Pipeline::SupportedTarget()) { | 105 if (Pipeline::SupportedTarget()) { |
108 FOR_FLOAT64_INPUTS(i) { | 106 FOR_FLOAT64_INPUTS(i) { |
109 input = *i; | 107 input = *i; |
110 uint32_t expected = DoubleToUint32(*i); | 108 uint32_t expected = DoubleToUint32(*i); |
111 t.Call(); | 109 t.Call(); |
112 CHECK_EQ(static_cast<int32_t>(expected), static_cast<int32_t>(result)); | 110 CHECK_EQ(static_cast<int32_t>(expected), static_cast<int32_t>(result)); |
113 } | 111 } |
114 } | 112 } |
115 } | 113 } |
116 #endif | |
117 | 114 |
118 | 115 |
119 // Create a simple JSObject with a unique map. | 116 // Create a simple JSObject with a unique map. |
120 static Handle<JSObject> TestObject() { | 117 static Handle<JSObject> TestObject() { |
121 static int index = 0; | 118 static int index = 0; |
122 char buffer[50]; | 119 char buffer[50]; |
123 v8::base::OS::SNPrintF(buffer, 50, "({'a_%d':1})", index++); | 120 v8::base::OS::SNPrintF(buffer, 50, "({'a_%d':1})", index++); |
124 return Handle<JSObject>::cast(v8::Utils::OpenHandle(*CompileRun(buffer))); | 121 return Handle<JSObject>::cast(v8::Utils::OpenHandle(*CompileRun(buffer))); |
125 } | 122 } |
126 | 123 |
(...skipping 1389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1516 Node* phi = t.graph()->NewNode(t.common()->Phi(kMachAnyTagged, 2), load0, | 1513 Node* phi = t.graph()->NewNode(t.common()->Phi(kMachAnyTagged, 2), load0, |
1517 load1, t.start); | 1514 load1, t.start); |
1518 t.Return(t.Use(phi, kMachineTypes[i])); | 1515 t.Return(t.Use(phi, kMachineTypes[i])); |
1519 t.Lower(); | 1516 t.Lower(); |
1520 | 1517 |
1521 CHECK_EQ(IrOpcode::kPhi, phi->opcode()); | 1518 CHECK_EQ(IrOpcode::kPhi, phi->opcode()); |
1522 CHECK_EQ(RepresentationOf(kMachineTypes[i]), | 1519 CHECK_EQ(RepresentationOf(kMachineTypes[i]), |
1523 RepresentationOf(OpParameter<MachineType>(phi))); | 1520 RepresentationOf(OpParameter<MachineType>(phi))); |
1524 } | 1521 } |
1525 } | 1522 } |
OLD | NEW |