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 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 void RunCopyElement(int from_index, int to_index) { | 421 void RunCopyElement(int from_index, int to_index) { |
422 // TODO(titzer): test element and field accesses where the base is not | 422 // TODO(titzer): test element and field accesses where the base is not |
423 // a constant in the code. | 423 // a constant in the code. |
424 BoundsCheck(from_index); | 424 BoundsCheck(from_index); |
425 BoundsCheck(to_index); | 425 BoundsCheck(to_index); |
426 ElementAccess access = GetElementAccess(); | 426 ElementAccess access = GetElementAccess(); |
427 | 427 |
428 SimplifiedLoweringTester<Object*> t; | 428 SimplifiedLoweringTester<Object*> t; |
429 Node* ptr = GetBaseNode(&t); | 429 Node* ptr = GetBaseNode(&t); |
430 Node* load = t.LoadElement(access, ptr, t.Int32Constant(from_index), | 430 Node* load = t.LoadElement(access, ptr, t.Int32Constant(from_index), |
431 t.Int32Constant(num_elements)); | 431 t.Int32Constant(static_cast<int>(num_elements))); |
432 t.StoreElement(access, ptr, t.Int32Constant(to_index), | 432 t.StoreElement(access, ptr, t.Int32Constant(to_index), |
433 t.Int32Constant(num_elements), load); | 433 t.Int32Constant(static_cast<int>(num_elements)), load); |
434 t.Return(t.jsgraph.TrueConstant()); | 434 t.Return(t.jsgraph.TrueConstant()); |
435 t.LowerAllNodes(); | 435 t.LowerAllNodes(); |
436 t.GenerateCode(); | 436 t.GenerateCode(); |
437 | 437 |
438 if (Pipeline::SupportedTarget()) { | 438 if (Pipeline::SupportedTarget()) { |
439 Object* result = t.Call(); | 439 Object* result = t.Call(); |
440 CHECK_EQ(t.isolate()->heap()->true_value(), result); | 440 CHECK_EQ(t.isolate()->heap()->true_value(), result); |
441 } | 441 } |
442 } | 442 } |
443 | 443 |
(...skipping 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1551 | 1551 |
1552 Node* store = t.graph()->NewNode(t.simplified()->StoreField(access), t.p0, | 1552 Node* store = t.graph()->NewNode(t.simplified()->StoreField(access), t.p0, |
1553 t.p1, t.start, t.start); | 1553 t.p1, t.start, t.start); |
1554 t.Effect(store); | 1554 t.Effect(store); |
1555 t.Lower(); | 1555 t.Lower(); |
1556 | 1556 |
1557 CHECK_EQ(IrOpcode::kStore, store->opcode()); | 1557 CHECK_EQ(IrOpcode::kStore, store->opcode()); |
1558 CHECK_EQ(t.p0, store->InputAt(0)); | 1558 CHECK_EQ(t.p0, store->InputAt(0)); |
1559 CheckChangeOf(IrOpcode::kChangeTaggedToFloat64, t.p1, store->InputAt(2)); | 1559 CheckChangeOf(IrOpcode::kChangeTaggedToFloat64, t.p1, store->InputAt(2)); |
1560 } | 1560 } |
OLD | NEW |