// r1 : the function to call
FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
- // Arguments register must be smi-tagged to call out.
+ // Number-of-arguments register must be smi-tagged to call out.
__ SmiTag(r0);
__ Push(r3, r2, r1, r0);
// A monomorphic cache hit or an already megamorphic state: invoke the
// function without changing the state.
+ // We don't know if r4 is a WeakCell or a Symbol, but it's harmless to read at
+ // this position in a symbol (see static asserts in type-feedback-vector.h).
Label check_allocation_site;
Register feedback_map = r5;
Register weak_value = r8;
__ b(eq, &done);
__ CompareRoot(r4, Heap::kmegamorphic_symbolRootIndex);
__ b(eq, &done);
- __ ldr(feedback_map, FieldMemOperand(r4, 0));
+ __ ldr(feedback_map, FieldMemOperand(r4, HeapObject::kMapOffset));
__ CompareRoot(feedback_map, Heap::kWeakCellMapRootIndex);
__ b(ne, FLAG_pretenuring_call_new ? &miss : &check_allocation_site);
- // If r1 is not equal to the weak cell value, and the weak cell value is
- // cleared, we have a new chance to become monomorphic.
+ // If the weak cell is cleared, we have a new chance to become monomorphic.
__ JumpIfSmi(weak_value, &initialize);
__ jmp(&megamorphic);
// If we came here, we need to see if we are the array function.
// If we didn't have a matching function, and we didn't find the megamorph
// sentinel, then we have in the slot either some other function or an
- // AllocationSite. Do a map check on the object in ecx.
+ // AllocationSite.
__ CompareRoot(feedback_map, Heap::kAllocationSiteMapRootIndex);
__ b(ne, &miss);
Register index) {
FrameScope scope(masm, StackFrame::INTERNAL);
- // Arguments register must be smi-tagged to call out.
+ // Number-of-arguments register must be smi-tagged to call out.
__ SmiTag(argc);
__ Push(argc, function, feedback_vector, index);
// A monomorphic cache hit or an already megamorphic state: invoke the
// function without changing the state.
+ // We don't know if feedback value is a WeakCell or a Symbol, but it's
+ // harmless to read at this position in a symbol (see static asserts in
+ // type-feedback-vector.h).
Label check_allocation_site;
__ Ldr(feedback_value, FieldMemOperand(feedback, WeakCell::kValueOffset));
__ Cmp(function, feedback_value);
__ B(eq, &done);
__ CompareRoot(feedback, Heap::kmegamorphic_symbolRootIndex);
__ B(eq, &done);
- __ Ldr(feedback_map, FieldMemOperand(feedback, 0));
+ __ Ldr(feedback_map, FieldMemOperand(feedback, HeapObject::kMapOffset));
__ CompareRoot(feedback_map, Heap::kWeakCellMapRootIndex);
__ B(ne, FLAG_pretenuring_call_new ? &miss : &check_allocation_site);
- // If function is not equal to the weak cell value, and the weak cell value is
- // cleared, we have a new chance to become monomorphic.
+ // If the weak cell is cleared, we have a new chance to become monomorphic.
__ JumpIfSmi(feedback_value, &initialize);
__ B(&megamorphic);
// If we came here, we need to see if we are the array function.
// If we didn't have a matching function, and we didn't find the megamorph
// sentinel, then we have in the slot either some other function or an
- // AllocationSite. Do a map check on the object in scratch1 register.
+ // AllocationSite.
__ JumpIfNotRoot(feedback_map, Heap::kAllocationSiteMapRootIndex, &miss);
// Make sure the function is the Array() function
// edi : the function to call
FrameScope scope(masm, StackFrame::INTERNAL);
- // Arguments register must be smi-tagged to call out.
+ // Number-of-arguments register must be smi-tagged to call out.
__ SmiTag(eax);
__ push(eax);
__ push(edi);
// A monomorphic cache hit or an already megamorphic state: invoke the
// function without changing the state.
+ // We don't know if ecx is a WeakCell or a Symbol, but it's harmless to read
+ // at this position in a symbol (see static asserts in
+ // type-feedback-vector.h).
Label check_allocation_site;
__ cmp(edi, FieldOperand(ecx, WeakCell::kValueOffset));
__ j(equal, &done, Label::kFar);
__ CompareRoot(ecx, Heap::kmegamorphic_symbolRootIndex);
__ j(equal, &done, Label::kFar);
- __ CompareRoot(FieldOperand(ecx, 0), Heap::kWeakCellMapRootIndex);
+ __ CompareRoot(FieldOperand(ecx, HeapObject::kMapOffset),
+ Heap::kWeakCellMapRootIndex);
__ j(not_equal, FLAG_pretenuring_call_new ? &miss : &check_allocation_site);
- // If edi is not equal to the weak cell value, and the weak cell value is
- // cleared, we have a new chance to become monomorphic.
+ // If the weak cell is cleared, we have a new chance to become monomorphic.
__ JumpIfSmi(FieldOperand(ecx, WeakCell::kValueOffset), &initialize);
__ jmp(&megamorphic);
// If we came here, we need to see if we are the array function.
// If we didn't have a matching function, and we didn't find the megamorph
// sentinel, then we have in the slot either some other function or an
- // AllocationSite. Do a map check on the object in ecx.
+ // AllocationSite.
__ CompareRoot(FieldOperand(ecx, 0), Heap::kAllocationSiteMapRootIndex);
__ j(not_equal, &miss);
1 << 6 | // a2
1 << 7; // a3
- // Arguments register must be smi-tagged to call out.
+ // Number-of-arguments register must be smi-tagged to call out.
__ SmiTag(a0);
__ MultiPush(kSavedRegs);
// A monomorphic cache hit or an already megamorphic state: invoke the
// function without changing the state.
+ // We don't know if t0 is a WeakCell or a Symbol, but it's harmless to read at
+ // this position in a symbol (see static asserts in type-feedback-vector.h).
Label check_allocation_site;
Register feedback_map = t1;
Register weak_value = t4;
__ Branch(&done, eq, a1, Operand(weak_value));
__ LoadRoot(at, Heap::kmegamorphic_symbolRootIndex);
__ Branch(&done, eq, t0, Operand(at));
- __ lw(feedback_map, FieldMemOperand(t0, 0));
+ __ lw(feedback_map, FieldMemOperand(t0, Heap::kMapOffset));
__ LoadRoot(at, Heap::kWeakCellMapRootIndex);
__ Branch(FLAG_pretenuring_call_new ? &miss : &check_allocation_site, ne,
feedback_map, Operand(at));
- // If a1 is not equal to the weak cell value, and the weak cell value is
- // cleared, we have a new chance to become monomorphic.
+ // If the weak cell is cleared, we have a new chance to become monomorphic.
__ JumpIfSmi(weak_value, &initialize);
__ jmp(&megamorphic);
// If we came here, we need to see if we are the array function.
// If we didn't have a matching function, and we didn't find the megamorph
// sentinel, then we have in the slot either some other function or an
- // AllocationSite. Do a map check on the object in a3.
+ // AllocationSite.
__ LoadRoot(at, Heap::kAllocationSiteMapRootIndex);
__ Branch(&miss, ne, feedback_map, Operand(at));
1 << 6 | // a2
1 << 7; // a3
- // Arguments register must be smi-tagged to call out.
+ // Number-of-arguments register must be smi-tagged to call out.
__ SmiTag(a0);
__ MultiPush(kSavedRegs);
// A monomorphic cache hit or an already megamorphic state: invoke the
// function without changing the state.
+ // We don't know if a4 is a WeakCell or a Symbol, but it's harmless to read at
+ // this position in a symbol (see static asserts in type-feedback-vector.h).
Label check_allocation_site;
Register feedback_map = a5;
Register weak_value = t0;
__ Branch(&done, eq, a1, Operand(weak_value));
__ LoadRoot(at, Heap::kmegamorphic_symbolRootIndex);
__ Branch(&done, eq, a4, Operand(at));
- __ ld(feedback_map, FieldMemOperand(a4, 0));
+ __ ld(feedback_map, FieldMemOperand(a4, HeapObject::kMapOffset));
__ LoadRoot(at, Heap::kWeakCellMapRootIndex);
__ Branch(FLAG_pretenuring_call_new ? &miss : &check_allocation_site, ne,
feedback_map, Operand(at));
- // If a1 is not equal to the weak cell value, and the weak cell value is
- // cleared, we have a new chance to become monomorphic.
+ // If the weak cell is cleared, we have a new chance to become monomorphic.
__ JumpIfSmi(weak_value, &initialize);
__ jmp(&megamorphic);
// If we came here, we need to see if we are the array function.
// If we didn't have a matching function, and we didn't find the megamorph
// sentinel, then we have in the slot either some other function or an
- // AllocationSite. Do a map check on the object in a3.
+ // AllocationSite.
__ LoadRoot(at, Heap::kAllocationSiteMapRootIndex);
__ Branch(&miss, ne, feedback_map, Operand(at));
// edi : the function to call
FrameScope scope(masm, StackFrame::INTERNAL);
- // Arguments register must be smi-tagged to call out.
+ // Number-of-arguments register must be smi-tagged to call out.
__ Integer32ToSmi(rax, rax);
__ Push(rax);
__ Push(rdi);
// A monomorphic cache hit or an already megamorphic state: invoke the
// function without changing the state.
+ // We don't know if rcx is a WeakCell or a Symbol, but it's harmless to read
+ // at this position in a symbol (see static asserts in
+ // type-feedback-vector.h).
Label check_allocation_site;
__ cmpp(rdi, FieldOperand(rcx, WeakCell::kValueOffset));
__ j(equal, &done, Label::kFar);
__ CompareRoot(rcx, Heap::kmegamorphic_symbolRootIndex);
__ j(equal, &done, Label::kFar);
- __ CompareRoot(FieldOperand(rcx, 0), Heap::kWeakCellMapRootIndex);
+ __ CompareRoot(FieldOperand(rcx, HeapObject::kMapOffset),
+ Heap::kWeakCellMapRootIndex);
__ j(not_equal, FLAG_pretenuring_call_new ? &miss : &check_allocation_site);
- // If edi is not equal to the weak cell value, and the weak cell value is
- // cleared, we have a new chance to become monomorphic. Otherwise, we
- // need to go megamorphic.
+ // If the weak cell is cleared, we have a new chance to become monomorphic.
__ CheckSmi(FieldOperand(rcx, WeakCell::kValueOffset));
__ j(equal, &initialize);
__ jmp(&megamorphic);
// If we came here, we need to see if we are the array function.
// If we didn't have a matching function, and we didn't find the megamorph
// sentinel, then we have in the slot either some other function or an
- // AllocationSite. Do a map check on the object in rcx.
+ // AllocationSite.
__ CompareRoot(FieldOperand(rcx, 0), Heap::kAllocationSiteMapRootIndex);
__ j(not_equal, &miss);