| 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 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1044 | 1044 |
| 1045 | 1045 |
| 1046 TEST(LowerReferenceEqual_to_wordeq) { | 1046 TEST(LowerReferenceEqual_to_wordeq) { |
| 1047 TestingGraph t(Type::Any(), Type::Any()); | 1047 TestingGraph t(Type::Any(), Type::Any()); |
| 1048 IrOpcode::Value opcode = | 1048 IrOpcode::Value opcode = |
| 1049 static_cast<IrOpcode::Value>(t.machine()->WordEqual()->opcode()); | 1049 static_cast<IrOpcode::Value>(t.machine()->WordEqual()->opcode()); |
| 1050 t.CheckLoweringBinop(opcode, t.simplified()->ReferenceEqual(Type::Any())); | 1050 t.CheckLoweringBinop(opcode, t.simplified()->ReferenceEqual(Type::Any())); |
| 1051 } | 1051 } |
| 1052 | 1052 |
| 1053 | 1053 |
| 1054 TEST(LowerStringOps_to_rtcalls) { | 1054 TEST(LowerStringOps_to_calls) { |
| 1055 if (false) { // TODO(titzer): lower StringOps to runtime calls | 1055 TestingGraph t(Type::String(), Type::String()); |
| 1056 TestingGraph t(Type::String(), Type::String()); | 1056 if (false) { // TODO(titzer): lower StringOps to stub/runtime calls |
| 1057 t.CheckLoweringBinop(IrOpcode::kCall, t.simplified()->StringEqual()); | 1057 t.CheckLoweringBinop(IrOpcode::kCall, t.simplified()->StringEqual()); |
| 1058 t.CheckLoweringBinop(IrOpcode::kCall, t.simplified()->StringLessThan()); | 1058 t.CheckLoweringBinop(IrOpcode::kCall, t.simplified()->StringLessThan()); |
| 1059 t.CheckLoweringBinop(IrOpcode::kCall, | 1059 t.CheckLoweringBinop(IrOpcode::kCall, |
| 1060 t.simplified()->StringLessThanOrEqual()); | 1060 t.simplified()->StringLessThanOrEqual()); |
| 1061 t.CheckLoweringBinop(IrOpcode::kCall, t.simplified()->StringAdd()); | |
| 1062 } | 1061 } |
| 1062 t.CheckLoweringBinop(IrOpcode::kCall, t.simplified()->StringAdd()); |
| 1063 } | 1063 } |
| 1064 | 1064 |
| 1065 | 1065 |
| 1066 void CheckChangeInsertion(IrOpcode::Value expected, MachineType from, | 1066 void CheckChangeInsertion(IrOpcode::Value expected, MachineType from, |
| 1067 MachineType to) { | 1067 MachineType to) { |
| 1068 TestingGraph t(Type::Any()); | 1068 TestingGraph t(Type::Any()); |
| 1069 Node* in = t.ExampleWithOutput(from); | 1069 Node* in = t.ExampleWithOutput(from); |
| 1070 Node* use = t.Use(in, to); | 1070 Node* use = t.Use(in, to); |
| 1071 t.Return(use); | 1071 t.Return(use); |
| 1072 t.Lower(); | 1072 t.Lower(); |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1408 | 1408 |
| 1409 Node* store = t.graph()->NewNode(t.simplified()->StoreField(access), t.p0, | 1409 Node* store = t.graph()->NewNode(t.simplified()->StoreField(access), t.p0, |
| 1410 t.p1, t.start, t.start); | 1410 t.p1, t.start, t.start); |
| 1411 t.Effect(store); | 1411 t.Effect(store); |
| 1412 t.Lower(); | 1412 t.Lower(); |
| 1413 | 1413 |
| 1414 CHECK_EQ(IrOpcode::kStore, store->opcode()); | 1414 CHECK_EQ(IrOpcode::kStore, store->opcode()); |
| 1415 CHECK_EQ(t.p0, store->InputAt(0)); | 1415 CHECK_EQ(t.p0, store->InputAt(0)); |
| 1416 CheckChangeOf(IrOpcode::kChangeTaggedToFloat64, t.p1, store->InputAt(2)); | 1416 CheckChangeOf(IrOpcode::kChangeTaggedToFloat64, t.p1, store->InputAt(2)); |
| 1417 } | 1417 } |
| OLD | NEW |