OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/arm/lithium-codegen-arm.h" | 7 #include "src/arm/lithium-codegen-arm.h" |
8 #include "src/arm/lithium-gap-resolver-arm.h" | 8 #include "src/arm/lithium-gap-resolver-arm.h" |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 4957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4968 __ bind(&check_bools); | 4968 __ bind(&check_bools); |
4969 __ LoadRoot(ip, Heap::kTrueValueRootIndex); | 4969 __ LoadRoot(ip, Heap::kTrueValueRootIndex); |
4970 __ cmp(scratch2, Operand(ip)); | 4970 __ cmp(scratch2, Operand(ip)); |
4971 __ b(ne, &check_false); | 4971 __ b(ne, &check_false); |
4972 __ mov(input_reg, Operand(1)); | 4972 __ mov(input_reg, Operand(1)); |
4973 __ b(&done); | 4973 __ b(&done); |
4974 | 4974 |
4975 __ bind(&check_false); | 4975 __ bind(&check_false); |
4976 __ LoadRoot(ip, Heap::kFalseValueRootIndex); | 4976 __ LoadRoot(ip, Heap::kFalseValueRootIndex); |
4977 __ cmp(scratch2, Operand(ip)); | 4977 __ cmp(scratch2, Operand(ip)); |
| 4978 __ RecordComment("Deferred TaggedToI: cannot truncate"); |
4978 DeoptimizeIf(ne, instr->environment()); | 4979 DeoptimizeIf(ne, instr->environment()); |
4979 __ mov(input_reg, Operand::Zero()); | 4980 __ mov(input_reg, Operand::Zero()); |
4980 __ b(&done); | |
4981 } else { | 4981 } else { |
4982 // Deoptimize if we don't have a heap number. | 4982 __ RecordComment("Deferred TaggedToI: not a heap number"); |
4983 DeoptimizeIf(ne, instr->environment()); | 4983 DeoptimizeIf(ne, instr->environment()); |
4984 | 4984 |
4985 __ sub(ip, scratch2, Operand(kHeapObjectTag)); | 4985 __ sub(ip, scratch2, Operand(kHeapObjectTag)); |
4986 __ vldr(double_scratch2, ip, HeapNumber::kValueOffset); | 4986 __ vldr(double_scratch2, ip, HeapNumber::kValueOffset); |
4987 __ TryDoubleToInt32Exact(input_reg, double_scratch2, double_scratch); | 4987 __ TryDoubleToInt32Exact(input_reg, double_scratch2, double_scratch); |
| 4988 __ RecordComment("Deferred TaggedToI: lost precision or NaN"); |
4988 DeoptimizeIf(ne, instr->environment()); | 4989 DeoptimizeIf(ne, instr->environment()); |
4989 | 4990 |
4990 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { | 4991 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { |
4991 __ cmp(input_reg, Operand::Zero()); | 4992 __ cmp(input_reg, Operand::Zero()); |
4992 __ b(ne, &done); | 4993 __ b(ne, &done); |
4993 __ VmovHigh(scratch1, double_scratch2); | 4994 __ VmovHigh(scratch1, double_scratch2); |
4994 __ tst(scratch1, Operand(HeapNumber::kSignMask)); | 4995 __ tst(scratch1, Operand(HeapNumber::kSignMask)); |
| 4996 __ RecordComment("Deferred TaggedToI: minus zero"); |
4995 DeoptimizeIf(ne, instr->environment()); | 4997 DeoptimizeIf(ne, instr->environment()); |
4996 } | 4998 } |
4997 } | 4999 } |
4998 __ bind(&done); | 5000 __ bind(&done); |
4999 } | 5001 } |
5000 | 5002 |
5001 | 5003 |
5002 void LCodeGen::DoTaggedToI(LTaggedToI* instr) { | 5004 void LCodeGen::DoTaggedToI(LTaggedToI* instr) { |
5003 class DeferredTaggedToI FINAL : public LDeferredCode { | 5005 class DeferredTaggedToI FINAL : public LDeferredCode { |
5004 public: | 5006 public: |
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5912 __ Push(scope_info); | 5914 __ Push(scope_info); |
5913 __ push(ToRegister(instr->function())); | 5915 __ push(ToRegister(instr->function())); |
5914 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5916 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5915 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5917 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5916 } | 5918 } |
5917 | 5919 |
5918 | 5920 |
5919 #undef __ | 5921 #undef __ |
5920 | 5922 |
5921 } } // namespace v8::internal | 5923 } } // namespace v8::internal |
OLD | NEW |