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 4960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4971 __ bind(&check_bools); | 4971 __ bind(&check_bools); |
4972 __ LoadRoot(ip, Heap::kTrueValueRootIndex); | 4972 __ LoadRoot(ip, Heap::kTrueValueRootIndex); |
4973 __ cmp(scratch2, Operand(ip)); | 4973 __ cmp(scratch2, Operand(ip)); |
4974 __ b(ne, &check_false); | 4974 __ b(ne, &check_false); |
4975 __ mov(input_reg, Operand(1)); | 4975 __ mov(input_reg, Operand(1)); |
4976 __ b(&done); | 4976 __ b(&done); |
4977 | 4977 |
4978 __ bind(&check_false); | 4978 __ bind(&check_false); |
4979 __ LoadRoot(ip, Heap::kFalseValueRootIndex); | 4979 __ LoadRoot(ip, Heap::kFalseValueRootIndex); |
4980 __ cmp(scratch2, Operand(ip)); | 4980 __ cmp(scratch2, Operand(ip)); |
4981 __ RecordComment("Deferred TaggedToI: cannot truncate"); | 4981 DeoptimizeIf(ne, instr, "cannot truncate"); |
4982 DeoptimizeIf(ne, instr); | |
4983 __ mov(input_reg, Operand::Zero()); | 4982 __ mov(input_reg, Operand::Zero()); |
4984 } else { | 4983 } else { |
4985 __ RecordComment("Deferred TaggedToI: not a heap number"); | 4984 DeoptimizeIf(ne, instr, "not a heap number"); |
4986 DeoptimizeIf(ne, instr); | |
4987 | 4985 |
4988 __ sub(ip, scratch2, Operand(kHeapObjectTag)); | 4986 __ sub(ip, scratch2, Operand(kHeapObjectTag)); |
4989 __ vldr(double_scratch2, ip, HeapNumber::kValueOffset); | 4987 __ vldr(double_scratch2, ip, HeapNumber::kValueOffset); |
4990 __ TryDoubleToInt32Exact(input_reg, double_scratch2, double_scratch); | 4988 __ TryDoubleToInt32Exact(input_reg, double_scratch2, double_scratch); |
4991 __ RecordComment("Deferred TaggedToI: lost precision or NaN"); | 4989 DeoptimizeIf(ne, instr, "lost precision or NaN"); |
4992 DeoptimizeIf(ne, instr); | |
4993 | 4990 |
4994 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { | 4991 if (instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero)) { |
4995 __ cmp(input_reg, Operand::Zero()); | 4992 __ cmp(input_reg, Operand::Zero()); |
4996 __ b(ne, &done); | 4993 __ b(ne, &done); |
4997 __ VmovHigh(scratch1, double_scratch2); | 4994 __ VmovHigh(scratch1, double_scratch2); |
4998 __ tst(scratch1, Operand(HeapNumber::kSignMask)); | 4995 __ tst(scratch1, Operand(HeapNumber::kSignMask)); |
4999 __ RecordComment("Deferred TaggedToI: minus zero"); | 4996 DeoptimizeIf(ne, instr, "minus zero"); |
5000 DeoptimizeIf(ne, instr); | |
5001 } | 4997 } |
5002 } | 4998 } |
5003 __ bind(&done); | 4999 __ bind(&done); |
5004 } | 5000 } |
5005 | 5001 |
5006 | 5002 |
5007 void LCodeGen::DoTaggedToI(LTaggedToI* instr) { | 5003 void LCodeGen::DoTaggedToI(LTaggedToI* instr) { |
5008 class DeferredTaggedToI FINAL : public LDeferredCode { | 5004 class DeferredTaggedToI FINAL : public LDeferredCode { |
5009 public: | 5005 public: |
5010 DeferredTaggedToI(LCodeGen* codegen, LTaggedToI* instr) | 5006 DeferredTaggedToI(LCodeGen* codegen, LTaggedToI* instr) |
(...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5912 __ Push(scope_info); | 5908 __ Push(scope_info); |
5913 __ push(ToRegister(instr->function())); | 5909 __ push(ToRegister(instr->function())); |
5914 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5910 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5915 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5911 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5916 } | 5912 } |
5917 | 5913 |
5918 | 5914 |
5919 #undef __ | 5915 #undef __ |
5920 | 5916 |
5921 } } // namespace v8::internal | 5917 } } // namespace v8::internal |
OLD | NEW |