| 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 #if V8_TARGET_ARCH_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
| 8 | 8 |
| 9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 3212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3223 Register feedback_vector = x2; | 3223 Register feedback_vector = x2; |
| 3224 Register index = x3; | 3224 Register index = x3; |
| 3225 Register scratch = x4; | 3225 Register scratch = x4; |
| 3226 | 3226 |
| 3227 EmitLoadTypeFeedbackVector(masm, feedback_vector); | 3227 EmitLoadTypeFeedbackVector(masm, feedback_vector); |
| 3228 | 3228 |
| 3229 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, scratch); | 3229 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, scratch); |
| 3230 __ Cmp(function, scratch); | 3230 __ Cmp(function, scratch); |
| 3231 __ B(ne, &miss); | 3231 __ B(ne, &miss); |
| 3232 | 3232 |
| 3233 Register allocation_site = feedback_vector; | |
| 3234 __ Mov(x0, Operand(arg_count())); | 3233 __ Mov(x0, Operand(arg_count())); |
| 3235 | 3234 |
| 3236 __ Add(scratch, feedback_vector, | 3235 __ Add(scratch, feedback_vector, |
| 3237 Operand::UntagSmiAndScale(index, kPointerSizeLog2)); | 3236 Operand::UntagSmiAndScale(index, kPointerSizeLog2)); |
| 3238 __ Ldr(allocation_site, FieldMemOperand(scratch, FixedArray::kHeaderSize)); | 3237 __ Ldr(scratch, FieldMemOperand(scratch, FixedArray::kHeaderSize)); |
| 3239 | 3238 |
| 3240 // Verify that x2 contains an AllocationSite | 3239 // Verify that scratch contains an AllocationSite |
| 3241 __ AssertUndefinedOrAllocationSite(allocation_site, scratch); | 3240 Register map = x5; |
| 3241 __ Ldr(map, FieldMemOperand(scratch, HeapObject::kMapOffset)); |
| 3242 __ JumpIfNotRoot(map, Heap::kAllocationSiteMapRootIndex, &miss); |
| 3243 |
| 3244 Register allocation_site = feedback_vector; |
| 3245 __ Mov(allocation_site, scratch); |
| 3242 ArrayConstructorStub stub(masm->isolate(), arg_count()); | 3246 ArrayConstructorStub stub(masm->isolate(), arg_count()); |
| 3243 __ TailCallStub(&stub); | 3247 __ TailCallStub(&stub); |
| 3244 | 3248 |
| 3245 __ bind(&miss); | 3249 __ bind(&miss); |
| 3246 GenerateMiss(masm, IC::kCallIC_Customization_Miss); | 3250 GenerateMiss(masm, IC::kCallIC_Customization_Miss); |
| 3247 | 3251 |
| 3248 // The slow case, we need this no matter what to complete a call after a miss. | 3252 // The slow case, we need this no matter what to complete a call after a miss. |
| 3249 CallFunctionNoFeedback(masm, | 3253 CallFunctionNoFeedback(masm, |
| 3250 arg_count(), | 3254 arg_count(), |
| 3251 true, | 3255 true, |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3307 EmitWrapCase(masm, argc, &cont); | 3311 EmitWrapCase(masm, argc, &cont); |
| 3308 } | 3312 } |
| 3309 | 3313 |
| 3310 __ bind(&extra_checks_or_miss); | 3314 __ bind(&extra_checks_or_miss); |
| 3311 Label miss; | 3315 Label miss; |
| 3312 | 3316 |
| 3313 __ JumpIfRoot(x4, Heap::kMegamorphicSymbolRootIndex, &slow_start); | 3317 __ JumpIfRoot(x4, Heap::kMegamorphicSymbolRootIndex, &slow_start); |
| 3314 __ JumpIfRoot(x4, Heap::kUninitializedSymbolRootIndex, &miss); | 3318 __ JumpIfRoot(x4, Heap::kUninitializedSymbolRootIndex, &miss); |
| 3315 | 3319 |
| 3316 if (!FLAG_trace_ic) { | 3320 if (!FLAG_trace_ic) { |
| 3317 // We are going megamorphic, and we don't want to visit the runtime. | 3321 // We are going megamorphic. If the feedback is a JSFunction, it is fine |
| 3322 // to handle it here. More complex cases are dealt with in the runtime. |
| 3323 __ AssertNotSmi(x4); |
| 3324 __ JumpIfNotObjectType(x4, x5, x5, JS_FUNCTION_TYPE, &miss); |
| 3318 __ Add(x4, feedback_vector, | 3325 __ Add(x4, feedback_vector, |
| 3319 Operand::UntagSmiAndScale(index, kPointerSizeLog2)); | 3326 Operand::UntagSmiAndScale(index, kPointerSizeLog2)); |
| 3320 __ LoadRoot(x5, Heap::kMegamorphicSymbolRootIndex); | 3327 __ LoadRoot(x5, Heap::kMegamorphicSymbolRootIndex); |
| 3321 __ Str(x5, FieldMemOperand(x4, FixedArray::kHeaderSize)); | 3328 __ Str(x5, FieldMemOperand(x4, FixedArray::kHeaderSize)); |
| 3322 __ B(&slow_start); | 3329 __ B(&slow_start); |
| 3323 } | 3330 } |
| 3324 | 3331 |
| 3325 // We are here because tracing is on or we are going monomorphic. | 3332 // We are here because tracing is on or we are going monomorphic. |
| 3326 __ bind(&miss); | 3333 __ bind(&miss); |
| 3327 GenerateMiss(masm, IC::kCallIC_Miss); | 3334 GenerateMiss(masm, IC::kCallIC_Miss); |
| (...skipping 2073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5401 MemOperand(fp, 6 * kPointerSize), | 5408 MemOperand(fp, 6 * kPointerSize), |
| 5402 NULL); | 5409 NULL); |
| 5403 } | 5410 } |
| 5404 | 5411 |
| 5405 | 5412 |
| 5406 #undef __ | 5413 #undef __ |
| 5407 | 5414 |
| 5408 } } // namespace v8::internal | 5415 } } // namespace v8::internal |
| 5409 | 5416 |
| 5410 #endif // V8_TARGET_ARCH_ARM64 | 5417 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |