| 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 3356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3367 Register feedback_vector = x2; | 3367 Register feedback_vector = x2; |
| 3368 Register index = x3; | 3368 Register index = x3; |
| 3369 Register scratch = x4; | 3369 Register scratch = x4; |
| 3370 | 3370 |
| 3371 EmitLoadTypeFeedbackVector(masm, feedback_vector); | 3371 EmitLoadTypeFeedbackVector(masm, feedback_vector); |
| 3372 | 3372 |
| 3373 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, scratch); | 3373 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, scratch); |
| 3374 __ Cmp(function, scratch); | 3374 __ Cmp(function, scratch); |
| 3375 __ B(ne, &miss); | 3375 __ B(ne, &miss); |
| 3376 | 3376 |
| 3377 Register allocation_site = feedback_vector; | |
| 3378 __ Mov(x0, Operand(arg_count())); | 3377 __ Mov(x0, Operand(arg_count())); |
| 3379 | 3378 |
| 3380 __ Add(scratch, feedback_vector, | 3379 __ Add(scratch, feedback_vector, |
| 3381 Operand::UntagSmiAndScale(index, kPointerSizeLog2)); | 3380 Operand::UntagSmiAndScale(index, kPointerSizeLog2)); |
| 3382 __ Ldr(allocation_site, FieldMemOperand(scratch, FixedArray::kHeaderSize)); | 3381 __ Ldr(scratch, FieldMemOperand(scratch, FixedArray::kHeaderSize)); |
| 3383 | 3382 |
| 3384 // Verify that x2 contains an AllocationSite | 3383 // Verify that scratch contains an AllocationSite |
| 3385 __ AssertUndefinedOrAllocationSite(allocation_site, scratch); | 3384 Register map = x5; |
| 3385 __ Ldr(map, FieldMemOperand(scratch, HeapObject::kMapOffset)); |
| 3386 __ JumpIfNotRoot(map, Heap::kAllocationSiteMapRootIndex, &miss); |
| 3387 |
| 3388 Register allocation_site = feedback_vector; |
| 3389 __ Mov(allocation_site, scratch); |
| 3386 ArrayConstructorStub stub(masm->isolate(), arg_count()); | 3390 ArrayConstructorStub stub(masm->isolate(), arg_count()); |
| 3387 __ TailCallStub(&stub); | 3391 __ TailCallStub(&stub); |
| 3388 | 3392 |
| 3389 __ bind(&miss); | 3393 __ bind(&miss); |
| 3390 GenerateMiss(masm, IC::kCallIC_Customization_Miss); | 3394 GenerateMiss(masm, IC::kCallIC_Customization_Miss); |
| 3391 | 3395 |
| 3392 // The slow case, we need this no matter what to complete a call after a miss. | 3396 // The slow case, we need this no matter what to complete a call after a miss. |
| 3393 CallFunctionNoFeedback(masm, | 3397 CallFunctionNoFeedback(masm, |
| 3394 arg_count(), | 3398 arg_count(), |
| 3395 true, | 3399 true, |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3451 EmitWrapCase(masm, argc, &cont); | 3455 EmitWrapCase(masm, argc, &cont); |
| 3452 } | 3456 } |
| 3453 | 3457 |
| 3454 __ bind(&extra_checks_or_miss); | 3458 __ bind(&extra_checks_or_miss); |
| 3455 Label miss; | 3459 Label miss; |
| 3456 | 3460 |
| 3457 __ JumpIfRoot(x4, Heap::kMegamorphicSymbolRootIndex, &slow_start); | 3461 __ JumpIfRoot(x4, Heap::kMegamorphicSymbolRootIndex, &slow_start); |
| 3458 __ JumpIfRoot(x4, Heap::kUninitializedSymbolRootIndex, &miss); | 3462 __ JumpIfRoot(x4, Heap::kUninitializedSymbolRootIndex, &miss); |
| 3459 | 3463 |
| 3460 if (!FLAG_trace_ic) { | 3464 if (!FLAG_trace_ic) { |
| 3461 // We are going megamorphic, and we don't want to visit the runtime. | 3465 // We are going megamorphic. If the feedback is a JSFunction, it is fine |
| 3466 // to handle it here. More complex cases are dealt with in the runtime. |
| 3467 __ AssertNotSmi(x4); |
| 3468 __ JumpIfNotObjectType(x4, x5, x5, JS_FUNCTION_TYPE, &miss); |
| 3462 __ Add(x4, feedback_vector, | 3469 __ Add(x4, feedback_vector, |
| 3463 Operand::UntagSmiAndScale(index, kPointerSizeLog2)); | 3470 Operand::UntagSmiAndScale(index, kPointerSizeLog2)); |
| 3464 __ LoadRoot(x5, Heap::kMegamorphicSymbolRootIndex); | 3471 __ LoadRoot(x5, Heap::kMegamorphicSymbolRootIndex); |
| 3465 __ Str(x5, FieldMemOperand(x4, FixedArray::kHeaderSize)); | 3472 __ Str(x5, FieldMemOperand(x4, FixedArray::kHeaderSize)); |
| 3466 __ B(&slow_start); | 3473 __ B(&slow_start); |
| 3467 } | 3474 } |
| 3468 | 3475 |
| 3469 // We are here because tracing is on or we are going monomorphic. | 3476 // We are here because tracing is on or we are going monomorphic. |
| 3470 __ bind(&miss); | 3477 __ bind(&miss); |
| 3471 GenerateMiss(masm, IC::kCallIC_Miss); | 3478 GenerateMiss(masm, IC::kCallIC_Miss); |
| (...skipping 2074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5546 MemOperand(fp, 6 * kPointerSize), | 5553 MemOperand(fp, 6 * kPointerSize), |
| 5547 NULL); | 5554 NULL); |
| 5548 } | 5555 } |
| 5549 | 5556 |
| 5550 | 5557 |
| 5551 #undef __ | 5558 #undef __ |
| 5552 | 5559 |
| 5553 } } // namespace v8::internal | 5560 } } // namespace v8::internal |
| 5554 | 5561 |
| 5555 #endif // V8_TARGET_ARCH_ARM64 | 5562 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |