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 "v8.h" | 5 #include "v8.h" |
6 | 6 |
7 #include "arm64/lithium-codegen-arm64.h" | 7 #include "arm64/lithium-codegen-arm64.h" |
8 #include "arm64/lithium-gap-resolver-arm64.h" | 8 #include "arm64/lithium-gap-resolver-arm64.h" |
9 #include "code-stubs.h" | 9 #include "code-stubs.h" |
10 #include "stub-cache.h" | 10 #include "stub-cache.h" |
(...skipping 2168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2179 __ B(ne, deferred->entry()); | 2179 __ B(ne, deferred->entry()); |
2180 } else { | 2180 } else { |
2181 DeoptimizeIf(ne, instr->environment()); | 2181 DeoptimizeIf(ne, instr->environment()); |
2182 } | 2182 } |
2183 | 2183 |
2184 __ Bind(&success); | 2184 __ Bind(&success); |
2185 } | 2185 } |
2186 | 2186 |
2187 | 2187 |
2188 void LCodeGen::DoCheckNonSmi(LCheckNonSmi* instr) { | 2188 void LCodeGen::DoCheckNonSmi(LCheckNonSmi* instr) { |
2189 if (!instr->hydrogen()->value()->IsHeapObject()) { | 2189 if (!instr->hydrogen()->value()->type().IsHeapObject()) { |
2190 DeoptimizeIfSmi(ToRegister(instr->value()), instr->environment()); | 2190 DeoptimizeIfSmi(ToRegister(instr->value()), instr->environment()); |
2191 } | 2191 } |
2192 } | 2192 } |
2193 | 2193 |
2194 | 2194 |
2195 void LCodeGen::DoCheckSmi(LCheckSmi* instr) { | 2195 void LCodeGen::DoCheckSmi(LCheckSmi* instr) { |
2196 Register value = ToRegister(instr->value()); | 2196 Register value = ToRegister(instr->value()); |
2197 ASSERT(!instr->result() || ToRegister(instr->result()).Is(value)); | 2197 ASSERT(!instr->result() || ToRegister(instr->result()).Is(value)); |
2198 DeoptimizeIfNotSmi(value, instr->environment()); | 2198 DeoptimizeIfNotSmi(value, instr->environment()); |
2199 } | 2199 } |
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2982 if (from == FIRST_TYPE) return ls; | 2982 if (from == FIRST_TYPE) return ls; |
2983 UNREACHABLE(); | 2983 UNREACHABLE(); |
2984 return eq; | 2984 return eq; |
2985 } | 2985 } |
2986 | 2986 |
2987 | 2987 |
2988 void LCodeGen::DoHasInstanceTypeAndBranch(LHasInstanceTypeAndBranch* instr) { | 2988 void LCodeGen::DoHasInstanceTypeAndBranch(LHasInstanceTypeAndBranch* instr) { |
2989 Register input = ToRegister(instr->value()); | 2989 Register input = ToRegister(instr->value()); |
2990 Register scratch = ToRegister(instr->temp()); | 2990 Register scratch = ToRegister(instr->temp()); |
2991 | 2991 |
2992 if (!instr->hydrogen()->value()->IsHeapObject()) { | 2992 if (!instr->hydrogen()->value()->type().IsHeapObject()) { |
2993 __ JumpIfSmi(input, instr->FalseLabel(chunk_)); | 2993 __ JumpIfSmi(input, instr->FalseLabel(chunk_)); |
2994 } | 2994 } |
2995 __ CompareObjectType(input, scratch, scratch, TestType(instr->hydrogen())); | 2995 __ CompareObjectType(input, scratch, scratch, TestType(instr->hydrogen())); |
2996 EmitBranch(instr, BranchCondition(instr->hydrogen())); | 2996 EmitBranch(instr, BranchCondition(instr->hydrogen())); |
2997 } | 2997 } |
2998 | 2998 |
2999 | 2999 |
3000 void LCodeGen::DoInnerAllocatedObject(LInnerAllocatedObject* instr) { | 3000 void LCodeGen::DoInnerAllocatedObject(LInnerAllocatedObject* instr) { |
3001 Register result = ToRegister(instr->result()); | 3001 Register result = ToRegister(instr->result()); |
3002 Register base = ToRegister(instr->base_object()); | 3002 Register base = ToRegister(instr->base_object()); |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3236 | 3236 |
3237 return lt; | 3237 return lt; |
3238 } | 3238 } |
3239 | 3239 |
3240 | 3240 |
3241 void LCodeGen::DoIsStringAndBranch(LIsStringAndBranch* instr) { | 3241 void LCodeGen::DoIsStringAndBranch(LIsStringAndBranch* instr) { |
3242 Register val = ToRegister(instr->value()); | 3242 Register val = ToRegister(instr->value()); |
3243 Register scratch = ToRegister(instr->temp()); | 3243 Register scratch = ToRegister(instr->temp()); |
3244 | 3244 |
3245 SmiCheck check_needed = | 3245 SmiCheck check_needed = |
3246 instr->hydrogen()->value()->IsHeapObject() | 3246 instr->hydrogen()->value()->type().IsHeapObject() |
3247 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | 3247 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
3248 Condition true_cond = | 3248 Condition true_cond = |
3249 EmitIsString(val, scratch, instr->FalseLabel(chunk_), check_needed); | 3249 EmitIsString(val, scratch, instr->FalseLabel(chunk_), check_needed); |
3250 | 3250 |
3251 EmitBranch(instr, true_cond); | 3251 EmitBranch(instr, true_cond); |
3252 } | 3252 } |
3253 | 3253 |
3254 | 3254 |
3255 void LCodeGen::DoIsSmiAndBranch(LIsSmiAndBranch* instr) { | 3255 void LCodeGen::DoIsSmiAndBranch(LIsSmiAndBranch* instr) { |
3256 Register value = ToRegister(instr->value()); | 3256 Register value = ToRegister(instr->value()); |
3257 STATIC_ASSERT(kSmiTag == 0); | 3257 STATIC_ASSERT(kSmiTag == 0); |
3258 EmitTestAndBranch(instr, eq, value, kSmiTagMask); | 3258 EmitTestAndBranch(instr, eq, value, kSmiTagMask); |
3259 } | 3259 } |
3260 | 3260 |
3261 | 3261 |
3262 void LCodeGen::DoIsUndetectableAndBranch(LIsUndetectableAndBranch* instr) { | 3262 void LCodeGen::DoIsUndetectableAndBranch(LIsUndetectableAndBranch* instr) { |
3263 Register input = ToRegister(instr->value()); | 3263 Register input = ToRegister(instr->value()); |
3264 Register temp = ToRegister(instr->temp()); | 3264 Register temp = ToRegister(instr->temp()); |
3265 | 3265 |
3266 if (!instr->hydrogen()->value()->IsHeapObject()) { | 3266 if (!instr->hydrogen()->value()->type().IsHeapObject()) { |
3267 __ JumpIfSmi(input, instr->FalseLabel(chunk_)); | 3267 __ JumpIfSmi(input, instr->FalseLabel(chunk_)); |
3268 } | 3268 } |
3269 __ Ldr(temp, FieldMemOperand(input, HeapObject::kMapOffset)); | 3269 __ Ldr(temp, FieldMemOperand(input, HeapObject::kMapOffset)); |
3270 __ Ldrb(temp, FieldMemOperand(temp, Map::kBitFieldOffset)); | 3270 __ Ldrb(temp, FieldMemOperand(temp, Map::kBitFieldOffset)); |
3271 | 3271 |
3272 EmitTestAndBranch(instr, ne, temp, 1 << Map::kIsUndetectable); | 3272 EmitTestAndBranch(instr, ne, temp, 1 << Map::kIsUndetectable); |
3273 } | 3273 } |
3274 | 3274 |
3275 | 3275 |
3276 static const char* LabelType(LLabel* label) { | 3276 static const char* LabelType(LLabel* label) { |
(...skipping 1806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5083 DeoptimizeIfRoot(scratch, Heap::kTheHoleValueRootIndex, | 5083 DeoptimizeIfRoot(scratch, Heap::kTheHoleValueRootIndex, |
5084 instr->environment()); | 5084 instr->environment()); |
5085 } else { | 5085 } else { |
5086 __ JumpIfNotRoot(scratch, Heap::kTheHoleValueRootIndex, &skip_assignment); | 5086 __ JumpIfNotRoot(scratch, Heap::kTheHoleValueRootIndex, &skip_assignment); |
5087 } | 5087 } |
5088 } | 5088 } |
5089 | 5089 |
5090 __ Str(value, target); | 5090 __ Str(value, target); |
5091 if (instr->hydrogen()->NeedsWriteBarrier()) { | 5091 if (instr->hydrogen()->NeedsWriteBarrier()) { |
5092 SmiCheck check_needed = | 5092 SmiCheck check_needed = |
5093 instr->hydrogen()->value()->IsHeapObject() | 5093 instr->hydrogen()->value()->type().IsHeapObject() |
5094 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | 5094 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
5095 __ RecordWriteContextSlot(context, | 5095 __ RecordWriteContextSlot(context, |
5096 target.offset(), | 5096 target.offset(), |
5097 value, | 5097 value, |
5098 scratch, | 5098 scratch, |
5099 GetLinkRegisterState(), | 5099 GetLinkRegisterState(), |
5100 kSaveFPRegs, | 5100 kSaveFPRegs, |
5101 EMIT_REMEMBERED_SET, | 5101 EMIT_REMEMBERED_SET, |
5102 check_needed); | 5102 check_needed); |
5103 } | 5103 } |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5277 representation, instr->base_offset()); | 5277 representation, instr->base_offset()); |
5278 } | 5278 } |
5279 | 5279 |
5280 __ Store(value, mem_op, representation); | 5280 __ Store(value, mem_op, representation); |
5281 | 5281 |
5282 if (instr->hydrogen()->NeedsWriteBarrier()) { | 5282 if (instr->hydrogen()->NeedsWriteBarrier()) { |
5283 ASSERT(representation.IsTagged()); | 5283 ASSERT(representation.IsTagged()); |
5284 // This assignment may cause element_addr to alias store_base. | 5284 // This assignment may cause element_addr to alias store_base. |
5285 Register element_addr = scratch; | 5285 Register element_addr = scratch; |
5286 SmiCheck check_needed = | 5286 SmiCheck check_needed = |
5287 instr->hydrogen()->value()->IsHeapObject() | 5287 instr->hydrogen()->value()->type().IsHeapObject() |
5288 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | 5288 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
5289 // Compute address of modified element and store it into key register. | 5289 // Compute address of modified element and store it into key register. |
5290 __ Add(element_addr, mem_op.base(), mem_op.OffsetAsOperand()); | 5290 __ Add(element_addr, mem_op.base(), mem_op.OffsetAsOperand()); |
5291 __ RecordWrite(elements, element_addr, value, GetLinkRegisterState(), | 5291 __ RecordWrite(elements, element_addr, value, GetLinkRegisterState(), |
5292 kSaveFPRegs, EMIT_REMEMBERED_SET, check_needed); | 5292 kSaveFPRegs, EMIT_REMEMBERED_SET, check_needed); |
5293 } | 5293 } |
5294 } | 5294 } |
5295 | 5295 |
5296 | 5296 |
5297 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { | 5297 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { |
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6012 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 6012 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
6013 // Index is equal to negated out of object property index plus 1. | 6013 // Index is equal to negated out of object property index plus 1. |
6014 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); | 6014 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); |
6015 __ Ldr(result, FieldMemOperand(result, | 6015 __ Ldr(result, FieldMemOperand(result, |
6016 FixedArray::kHeaderSize - kPointerSize)); | 6016 FixedArray::kHeaderSize - kPointerSize)); |
6017 __ Bind(deferred->exit()); | 6017 __ Bind(deferred->exit()); |
6018 __ Bind(&done); | 6018 __ Bind(&done); |
6019 } | 6019 } |
6020 | 6020 |
6021 } } // namespace v8::internal | 6021 } } // namespace v8::internal |
OLD | NEW |