OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/arm64/lithium-arm64.h" | 7 #include "src/arm64/lithium-arm64.h" |
8 #include "src/arm64/lithium-codegen-arm64.h" | 8 #include "src/arm64/lithium-codegen-arm64.h" |
9 #include "src/hydrogen-osr.h" | 9 #include "src/hydrogen-osr.h" |
10 #include "src/lithium-allocator-inl.h" | 10 #include "src/lithium-allocator-inl.h" |
(...skipping 1256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1267 if (r.IsSmiOrInteger32()) { | 1267 if (r.IsSmiOrInteger32()) { |
1268 ASSERT(instr->left()->representation().Equals(r)); | 1268 ASSERT(instr->left()->representation().Equals(r)); |
1269 ASSERT(instr->right()->representation().Equals(r)); | 1269 ASSERT(instr->right()->representation().Equals(r)); |
1270 LOperand* left = UseRegisterOrConstantAtStart(instr->left()); | 1270 LOperand* left = UseRegisterOrConstantAtStart(instr->left()); |
1271 LOperand* right = UseRegisterOrConstantAtStart(instr->right()); | 1271 LOperand* right = UseRegisterOrConstantAtStart(instr->right()); |
1272 return new(zone()) LCompareNumericAndBranch(left, right); | 1272 return new(zone()) LCompareNumericAndBranch(left, right); |
1273 } else { | 1273 } else { |
1274 ASSERT(r.IsDouble()); | 1274 ASSERT(r.IsDouble()); |
1275 ASSERT(instr->left()->representation().IsDouble()); | 1275 ASSERT(instr->left()->representation().IsDouble()); |
1276 ASSERT(instr->right()->representation().IsDouble()); | 1276 ASSERT(instr->right()->representation().IsDouble()); |
1277 // TODO(all): In fact the only case that we can handle more efficiently is | 1277 if (instr->left()->IsConstant() && instr->right()->IsConstant()) { |
1278 // when one of the operand is the constant 0. Currently the MacroAssembler | 1278 LOperand* left = UseConstant(instr->left()); |
1279 // will be able to cope with any constant by loading it into an internal | 1279 LOperand* right = UseConstant(instr->right()); |
1280 // scratch register. This means that if the constant is used more that once, | 1280 return new(zone()) LCompareNumericAndBranch(left, right); |
1281 // it will be loaded multiple times. Unfortunatly crankshaft already | 1281 } |
1282 // duplicates constant loads, but we should modify the code below once this | 1282 LOperand* left = UseRegisterAtStart(instr->left()); |
1283 // issue has been addressed in crankshaft. | 1283 LOperand* right = UseRegisterAtStart(instr->right()); |
1284 LOperand* left = UseRegisterOrConstantAtStart(instr->left()); | |
1285 LOperand* right = UseRegisterOrConstantAtStart(instr->right()); | |
1286 return new(zone()) LCompareNumericAndBranch(left, right); | 1284 return new(zone()) LCompareNumericAndBranch(left, right); |
1287 } | 1285 } |
1288 } | 1286 } |
1289 | 1287 |
1290 | 1288 |
1291 LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) { | 1289 LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) { |
1292 ASSERT(instr->left()->representation().IsTagged()); | 1290 ASSERT(instr->left()->representation().IsTagged()); |
1293 ASSERT(instr->right()->representation().IsTagged()); | 1291 ASSERT(instr->right()->representation().IsTagged()); |
1294 LOperand* context = UseFixed(instr->context(), cp); | 1292 LOperand* context = UseFixed(instr->context(), cp); |
1295 LOperand* left = UseFixed(instr->left(), x1); | 1293 LOperand* left = UseFixed(instr->left(), x1); |
(...skipping 1421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2717 HAllocateBlockContext* instr) { | 2715 HAllocateBlockContext* instr) { |
2718 LOperand* context = UseFixed(instr->context(), cp); | 2716 LOperand* context = UseFixed(instr->context(), cp); |
2719 LOperand* function = UseRegisterAtStart(instr->function()); | 2717 LOperand* function = UseRegisterAtStart(instr->function()); |
2720 LAllocateBlockContext* result = | 2718 LAllocateBlockContext* result = |
2721 new(zone()) LAllocateBlockContext(context, function); | 2719 new(zone()) LAllocateBlockContext(context, function); |
2722 return MarkAsCall(DefineFixed(result, cp), instr); | 2720 return MarkAsCall(DefineFixed(result, cp), instr); |
2723 } | 2721 } |
2724 | 2722 |
2725 | 2723 |
2726 } } // namespace v8::internal | 2724 } } // namespace v8::internal |
OLD | NEW |