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/control-builders.h" | 7 #include "src/compiler/control-builders.h" |
8 #include "src/compiler/generic-node-inl.h" | 8 #include "src/compiler/generic-node-inl.h" |
9 #include "src/compiler/graph-visualizer.h" | 9 #include "src/compiler/graph-visualizer.h" |
10 #include "src/compiler/node-properties-inl.h" | 10 #include "src/compiler/node-properties-inl.h" |
(...skipping 988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
999 Node* in = t.ExampleWithOutput(from); | 999 Node* in = t.ExampleWithOutput(from); |
1000 Node* use = t.Use(in, to); | 1000 Node* use = t.Use(in, to); |
1001 t.Return(use); | 1001 t.Return(use); |
1002 t.Lower(); | 1002 t.Lower(); |
1003 CHECK_EQ(expected, use->InputAt(0)->opcode()); | 1003 CHECK_EQ(expected, use->InputAt(0)->opcode()); |
1004 CHECK_EQ(in, use->InputAt(0)->InputAt(0)); | 1004 CHECK_EQ(in, use->InputAt(0)->InputAt(0)); |
1005 } | 1005 } |
1006 | 1006 |
1007 | 1007 |
1008 TEST(InsertBasicChanges) { | 1008 TEST(InsertBasicChanges) { |
1009 if (false) { | 1009 CheckChangeInsertion(IrOpcode::kChangeFloat64ToInt32, rFloat64, tInt32); |
1010 // TODO(titzer): these changes need the output to have the right type. | 1010 CheckChangeInsertion(IrOpcode::kChangeFloat64ToUint32, rFloat64, tUint32); |
1011 CheckChangeInsertion(IrOpcode::kChangeFloat64ToInt32, rFloat64, tInt32); | 1011 CheckChangeInsertion(IrOpcode::kChangeTaggedToInt32, rTagged, tInt32); |
1012 CheckChangeInsertion(IrOpcode::kChangeFloat64ToUint32, rFloat64, tUint32); | 1012 CheckChangeInsertion(IrOpcode::kChangeTaggedToUint32, rTagged, tUint32); |
1013 CheckChangeInsertion(IrOpcode::kChangeTaggedToInt32, rTagged, tInt32); | |
1014 CheckChangeInsertion(IrOpcode::kChangeTaggedToUint32, rTagged, tUint32); | |
1015 } | |
1016 | 1013 |
1017 CheckChangeInsertion(IrOpcode::kChangeFloat64ToTagged, rFloat64, rTagged); | 1014 CheckChangeInsertion(IrOpcode::kChangeFloat64ToTagged, rFloat64, rTagged); |
1018 CheckChangeInsertion(IrOpcode::kChangeTaggedToFloat64, rTagged, rFloat64); | 1015 CheckChangeInsertion(IrOpcode::kChangeTaggedToFloat64, rTagged, rFloat64); |
1019 | 1016 |
1020 CheckChangeInsertion(IrOpcode::kChangeInt32ToFloat64, tInt32, rFloat64); | 1017 CheckChangeInsertion(IrOpcode::kChangeInt32ToFloat64, tInt32, rFloat64); |
1021 CheckChangeInsertion(IrOpcode::kChangeInt32ToTagged, tInt32, rTagged); | 1018 CheckChangeInsertion(IrOpcode::kChangeInt32ToTagged, tInt32, rTagged); |
1022 | 1019 |
1023 CheckChangeInsertion(IrOpcode::kChangeUint32ToFloat64, tUint32, rFloat64); | 1020 CheckChangeInsertion(IrOpcode::kChangeUint32ToFloat64, tUint32, rFloat64); |
1024 CheckChangeInsertion(IrOpcode::kChangeUint32ToTagged, tUint32, rTagged); | 1021 CheckChangeInsertion(IrOpcode::kChangeUint32ToTagged, tUint32, rTagged); |
1025 } | 1022 } |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1363 | 1360 |
1364 Node* store = t.graph()->NewNode(t.simplified()->StoreField(access), t.p0, | 1361 Node* store = t.graph()->NewNode(t.simplified()->StoreField(access), t.p0, |
1365 t.p1, t.start, t.start); | 1362 t.p1, t.start, t.start); |
1366 t.Effect(store); | 1363 t.Effect(store); |
1367 t.Lower(); | 1364 t.Lower(); |
1368 | 1365 |
1369 CHECK_EQ(IrOpcode::kStore, store->opcode()); | 1366 CHECK_EQ(IrOpcode::kStore, store->opcode()); |
1370 CHECK_EQ(t.p0, store->InputAt(0)); | 1367 CHECK_EQ(t.p0, store->InputAt(0)); |
1371 CheckChangeOf(IrOpcode::kChangeTaggedToFloat64, t.p1, store->InputAt(2)); | 1368 CheckChangeOf(IrOpcode::kChangeTaggedToFloat64, t.p1, store->InputAt(2)); |
1372 } | 1369 } |
OLD | NEW |