| 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/change-lowering.h" | 7 #include "src/compiler/change-lowering.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/js-graph.h" | 10 #include "src/compiler/js-graph.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 | 92 |
| 93 Node* LoadFloat64(double* ptr) { | 93 Node* LoadFloat64(double* ptr) { |
| 94 Node* ptr_node = this->PointerConstant(ptr); | 94 Node* ptr_node = this->PointerConstant(ptr); |
| 95 return this->Load(kMachFloat64, ptr_node); | 95 return this->Load(kMachFloat64, ptr_node); |
| 96 } | 96 } |
| 97 | 97 |
| 98 void CheckNumber(double expected, Object* number) { | 98 void CheckNumber(double expected, Object* number) { |
| 99 CHECK(this->isolate()->factory()->NewNumber(expected)->SameValue(number)); | 99 CHECK(this->isolate()->factory()->NewNumber(expected)->SameValue(number)); |
| 100 } | 100 } |
| 101 | 101 |
| 102 void BuildAndLower(Operator* op) { | 102 void BuildAndLower(const Operator* op) { |
| 103 // We build a graph by hand here, because the raw machine assembler | 103 // We build a graph by hand here, because the raw machine assembler |
| 104 // does not add the correct control and effect nodes. | 104 // does not add the correct control and effect nodes. |
| 105 Node* p0 = this->Parameter(0); | 105 Node* p0 = this->Parameter(0); |
| 106 Node* change = this->graph()->NewNode(op, p0); | 106 Node* change = this->graph()->NewNode(op, p0); |
| 107 Node* ret = this->graph()->NewNode(this->common()->Return(), change, | 107 Node* ret = this->graph()->NewNode(this->common()->Return(), change, |
| 108 this->start(), this->start()); | 108 this->start(), this->start()); |
| 109 Node* end = this->graph()->NewNode(this->common()->End(), ret); | 109 Node* end = this->graph()->NewNode(this->common()->End(), ret); |
| 110 this->graph()->SetEnd(end); | 110 this->graph()->SetEnd(end); |
| 111 LowerChange(change); | 111 LowerChange(change); |
| 112 } | 112 } |
| 113 | 113 |
| 114 void BuildStoreAndLower(Operator* op, Operator* store_op, void* location) { | 114 void BuildStoreAndLower(const Operator* op, const Operator* store_op, |
| 115 void* location) { |
| 115 // We build a graph by hand here, because the raw machine assembler | 116 // We build a graph by hand here, because the raw machine assembler |
| 116 // does not add the correct control and effect nodes. | 117 // does not add the correct control and effect nodes. |
| 117 Node* p0 = this->Parameter(0); | 118 Node* p0 = this->Parameter(0); |
| 118 Node* change = this->graph()->NewNode(op, p0); | 119 Node* change = this->graph()->NewNode(op, p0); |
| 119 Node* store = this->graph()->NewNode( | 120 Node* store = this->graph()->NewNode( |
| 120 store_op, this->PointerConstant(location), this->Int32Constant(0), | 121 store_op, this->PointerConstant(location), this->Int32Constant(0), |
| 121 change, this->start(), this->start()); | 122 change, this->start(), this->start()); |
| 122 Node* ret = this->graph()->NewNode( | 123 Node* ret = this->graph()->NewNode( |
| 123 this->common()->Return(), this->Int32Constant(0), store, this->start()); | 124 this->common()->Return(), this->Int32Constant(0), store, this->start()); |
| 124 Node* end = this->graph()->NewNode(this->common()->End(), ret); | 125 Node* end = this->graph()->NewNode(this->common()->End(), ret); |
| 125 this->graph()->SetEnd(end); | 126 this->graph()->SetEnd(end); |
| 126 LowerChange(change); | 127 LowerChange(change); |
| 127 } | 128 } |
| 128 | 129 |
| 129 void BuildLoadAndLower(Operator* op, Operator* load_op, void* location) { | 130 void BuildLoadAndLower(const Operator* op, const Operator* load_op, |
| 131 void* location) { |
| 130 // We build a graph by hand here, because the raw machine assembler | 132 // We build a graph by hand here, because the raw machine assembler |
| 131 // does not add the correct control and effect nodes. | 133 // does not add the correct control and effect nodes. |
| 132 Node* load = | 134 Node* load = |
| 133 this->graph()->NewNode(load_op, this->PointerConstant(location), | 135 this->graph()->NewNode(load_op, this->PointerConstant(location), |
| 134 this->Int32Constant(0), this->start()); | 136 this->Int32Constant(0), this->start()); |
| 135 Node* change = this->graph()->NewNode(op, load); | 137 Node* change = this->graph()->NewNode(op, load); |
| 136 Node* ret = this->graph()->NewNode(this->common()->Return(), change, | 138 Node* ret = this->graph()->NewNode(this->common()->Return(), change, |
| 137 this->start(), this->start()); | 139 this->start(), this->start()); |
| 138 Node* end = this->graph()->NewNode(this->common()->End(), ret); | 140 Node* end = this->graph()->NewNode(this->common()->End(), ret); |
| 139 this->graph()->SetEnd(end); | 141 this->graph()->SetEnd(end); |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 | 402 |
| 401 input = *i; | 403 input = *i; |
| 402 Object* result = t.CallWithPotentialGC<Object>(); | 404 Object* result = t.CallWithPotentialGC<Object>(); |
| 403 t.CheckNumber(input, result); | 405 t.CheckNumber(input, result); |
| 404 } | 406 } |
| 405 } | 407 } |
| 406 } | 408 } |
| 407 } | 409 } |
| 408 | 410 |
| 409 #endif // V8_TURBOFAN_BACKEND | 411 #endif // V8_TURBOFAN_BACKEND |
| OLD | NEW |