}
-static void EmitLoadTypeFeedbackVector(MacroAssembler* masm, Register vector) {
- __ ldr(vector, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
- __ ldr(vector, FieldMemOperand(vector,
- JSFunction::kSharedFunctionInfoOffset));
- __ ldr(vector, FieldMemOperand(vector,
- SharedFunctionInfo::kFeedbackVectorOffset));
-}
-
-
void CallICStub::HandleArrayCase(MacroAssembler* masm, Label* miss) {
// r1 - function
// r3 - slot id
void LoadICTrampolineStub::Generate(MacroAssembler* masm) {
- EmitLoadTypeFeedbackVector(masm, LoadWithVectorDescriptor::VectorRegister());
+ __ EmitLoadTypeFeedbackVector(LoadWithVectorDescriptor::VectorRegister());
LoadICStub stub(isolate(), state());
stub.GenerateForTrampoline(masm);
}
void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) {
- EmitLoadTypeFeedbackVector(masm, LoadWithVectorDescriptor::VectorRegister());
+ __ EmitLoadTypeFeedbackVector(LoadWithVectorDescriptor::VectorRegister());
KeyedLoadICStub stub(isolate(), state());
stub.GenerateForTrampoline(masm);
}
void CallICTrampolineStub::Generate(MacroAssembler* masm) {
- EmitLoadTypeFeedbackVector(masm, r2);
+ __ EmitLoadTypeFeedbackVector(r2);
CallICStub stub(isolate(), state());
__ Jump(stub.GetCode(), RelocInfo::CODE_TARGET);
}
void VectorStoreICTrampolineStub::Generate(MacroAssembler* masm) {
- EmitLoadTypeFeedbackVector(masm, VectorStoreICDescriptor::VectorRegister());
+ __ EmitLoadTypeFeedbackVector(VectorStoreICDescriptor::VectorRegister());
VectorStoreICStub stub(isolate(), state());
stub.GenerateForTrampoline(masm);
}
void VectorKeyedStoreICTrampolineStub::Generate(MacroAssembler* masm) {
- EmitLoadTypeFeedbackVector(masm, VectorStoreICDescriptor::VectorRegister());
+ __ EmitLoadTypeFeedbackVector(VectorStoreICDescriptor::VectorRegister());
VectorKeyedStoreICStub stub(isolate(), state());
stub.GenerateForTrampoline(masm);
}
}
+void MacroAssembler::EmitLoadTypeFeedbackVector(Register vector) {
+ ldr(vector, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
+ ldr(vector, FieldMemOperand(vector, JSFunction::kSharedFunctionInfoOffset));
+ ldr(vector,
+ FieldMemOperand(vector, SharedFunctionInfo::kFeedbackVectorOffset));
+}
+
+
void MacroAssembler::EnterFrame(StackFrame::Type type,
bool load_constant_pool_pointer_reg) {
// r0-r3: preserved
DecodeField<Field>(reg, reg);
}
+ // Load the type feedback vector from a JavaScript frame.
+ void EmitLoadTypeFeedbackVector(Register vector);
+
// Activation support.
void EnterFrame(StackFrame::Type type,
bool load_constant_pool_pointer_reg = false);
}
-static void EmitLoadTypeFeedbackVector(MacroAssembler* masm, Register vector) {
- __ Ldr(vector, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
- __ Ldr(vector, FieldMemOperand(vector,
- JSFunction::kSharedFunctionInfoOffset));
- __ Ldr(vector, FieldMemOperand(vector,
- SharedFunctionInfo::kFeedbackVectorOffset));
-}
-
-
void CallICStub::HandleArrayCase(MacroAssembler* masm, Label* miss) {
// x1 - function
// x3 - slot id
void LoadICTrampolineStub::Generate(MacroAssembler* masm) {
- EmitLoadTypeFeedbackVector(masm, LoadWithVectorDescriptor::VectorRegister());
+ __ EmitLoadTypeFeedbackVector(LoadWithVectorDescriptor::VectorRegister());
LoadICStub stub(isolate(), state());
stub.GenerateForTrampoline(masm);
}
void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) {
- EmitLoadTypeFeedbackVector(masm, LoadWithVectorDescriptor::VectorRegister());
+ __ EmitLoadTypeFeedbackVector(LoadWithVectorDescriptor::VectorRegister());
KeyedLoadICStub stub(isolate(), state());
stub.GenerateForTrampoline(masm);
}
void CallICTrampolineStub::Generate(MacroAssembler* masm) {
- EmitLoadTypeFeedbackVector(masm, x2);
+ __ EmitLoadTypeFeedbackVector(x2);
CallICStub stub(isolate(), state());
__ Jump(stub.GetCode(), RelocInfo::CODE_TARGET);
}
void VectorStoreICTrampolineStub::Generate(MacroAssembler* masm) {
- EmitLoadTypeFeedbackVector(masm, VectorStoreICDescriptor::VectorRegister());
+ __ EmitLoadTypeFeedbackVector(VectorStoreICDescriptor::VectorRegister());
VectorStoreICStub stub(isolate(), state());
stub.GenerateForTrampoline(masm);
}
void VectorKeyedStoreICTrampolineStub::Generate(MacroAssembler* masm) {
- EmitLoadTypeFeedbackVector(masm, VectorStoreICDescriptor::VectorRegister());
+ __ EmitLoadTypeFeedbackVector(VectorStoreICDescriptor::VectorRegister());
VectorKeyedStoreICStub stub(isolate(), state());
stub.GenerateForTrampoline(masm);
}
}
+void MacroAssembler::EmitLoadTypeFeedbackVector(Register vector) {
+ Ldr(vector, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
+ Ldr(vector, FieldMemOperand(vector, JSFunction::kSharedFunctionInfoOffset));
+ Ldr(vector,
+ FieldMemOperand(vector, SharedFunctionInfo::kFeedbackVectorOffset));
+}
+
+
void MacroAssembler::EnterFrame(StackFrame::Type type,
bool load_constant_pool_pointer_reg) {
// Out-of-line constant pool not implemented on arm64.
// ---------------------------------------------------------------------------
// Frames.
+ // Load the type feedback vector from a JavaScript frame.
+ void EmitLoadTypeFeedbackVector(Register vector);
+
// Activation support.
void EnterFrame(StackFrame::Type type);
void EnterFrame(StackFrame::Type type, bool load_constant_pool_pointer_reg);
Label non_proxy;
__ bind(&fixed_array);
- __ Move(r1, FeedbackVector());
+ __ EmitLoadTypeFeedbackVector(r1);
__ mov(r2, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate())));
- int vector_index = FeedbackVector()->GetIndex(slot);
+ int vector_index = SmiFromSlot(slot)->value();
__ str(r2, FieldMemOperand(r1, FixedArray::OffsetOfElementAt(vector_index)));
__ mov(r1, Operand(Smi::FromInt(1))); // Smi indicates slow check
__ ldr(r1, MemOperand(sp, arg_count * kPointerSize));
// Record call targets in unoptimized code.
- __ Move(r2, FeedbackVector());
+ __ EmitLoadTypeFeedbackVector(r2);
__ mov(r3, Operand(SmiFromSlot(expr->CallNewFeedbackSlot())));
CallConstructStub stub(isolate(), RECORD_CONSTRUCTOR_TARGET);
__ ldr(r1, MemOperand(sp, arg_count * kPointerSize));
// Record call targets in unoptimized code.
- __ Move(r2, FeedbackVector());
+ __ EmitLoadTypeFeedbackVector(r2);
__ mov(r3, Operand(SmiFromSlot(expr->CallFeedbackSlot())));
CallConstructStub stub(isolate(), SUPER_CALL_RECORD_TARGET);
// We got a fixed array in register x0. Iterate through that.
__ Bind(&fixed_array);
- __ LoadObject(x1, FeedbackVector());
+ __ EmitLoadTypeFeedbackVector(x1);
__ Mov(x10, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate())));
- int vector_index = FeedbackVector()->GetIndex(slot);
+ int vector_index = SmiFromSlot(slot)->value();
__ Str(x10, FieldMemOperand(x1, FixedArray::OffsetOfElementAt(vector_index)));
__ Mov(x1, Smi::FromInt(1)); // Smi indicates slow check.
__ Peek(x1, arg_count * kXRegSize);
// Record call targets in unoptimized code.
- __ LoadObject(x2, FeedbackVector());
+ __ EmitLoadTypeFeedbackVector(x2);
__ Mov(x3, SmiFromSlot(expr->CallNewFeedbackSlot()));
CallConstructStub stub(isolate(), RECORD_CONSTRUCTOR_TARGET);
__ Peek(x1, arg_count * kXRegSize);
// Record call targets in unoptimized code.
- __ LoadObject(x2, FeedbackVector());
+ __ EmitLoadTypeFeedbackVector(x2);
__ Mov(x3, SmiFromSlot(expr->CallFeedbackSlot()));
CallConstructStub stub(isolate(), SUPER_CALL_RECORD_TARGET);
}
-void FullCodeGenerator::EnsureSlotContainsAllocationSite(
- FeedbackVectorSlot slot) {
- Handle<TypeFeedbackVector> vector = FeedbackVector();
- if (!vector->Get(slot)->IsAllocationSite()) {
- Handle<AllocationSite> allocation_site =
- isolate()->factory()->NewAllocationSite();
- vector->Set(slot, *allocation_site);
- }
-}
-
-
-void FullCodeGenerator::EnsureSlotContainsAllocationSite(
- FeedbackVectorICSlot slot) {
- Handle<TypeFeedbackVector> vector = FeedbackVector();
- if (!vector->Get(slot)->IsAllocationSite()) {
- Handle<AllocationSite> allocation_site =
- isolate()->factory()->NewAllocationSite();
- vector->Set(slot, *allocation_site);
- }
-}
-
-
void FullCodeGenerator::PopulateDeoptimizationData(Handle<Code> code) {
// Fill in the deoptimization information.
DCHECK(info_->HasDeoptimizationSupport() || bailout_entries_.is_empty());
void PrepareForBailout(Expression* node, State state);
void PrepareForBailoutForId(BailoutId id, State state);
- // Feedback slot support. The feedback vector will be cleared during gc and
- // collected by the type-feedback oracle.
- Handle<TypeFeedbackVector> FeedbackVector() const {
- return info_->feedback_vector();
- }
- void EnsureSlotContainsAllocationSite(FeedbackVectorSlot slot);
- void EnsureSlotContainsAllocationSite(FeedbackVectorICSlot slot);
-
// Returns a smi for the index into the FixedArray that backs the feedback
// vector
Smi* SmiFromSlot(FeedbackVectorSlot slot) const {
- return Smi::FromInt(FeedbackVector()->GetIndex(slot));
+ return Smi::FromInt(TypeFeedbackVector::GetIndexFromSpec(
+ literal()->feedback_vector_spec(), slot));
}
Smi* SmiFromSlot(FeedbackVectorICSlot slot) const {
- return Smi::FromInt(FeedbackVector()->GetIndex(slot));
+ return Smi::FromInt(TypeFeedbackVector::GetIndexFromSpec(
+ literal()->feedback_vector_spec(), slot));
}
// Record a call's return site offset, used to rebuild the frame if the
bool is_native() { return info_->is_native(); }
LanguageMode language_mode() { return literal()->language_mode(); }
bool has_simple_parameters() { return info_->has_simple_parameters(); }
- FunctionLiteral* literal() { return info_->literal(); }
+ FunctionLiteral* literal() const { return info_->literal(); }
Scope* scope() { return scope_; }
static Register result_register();
__ bind(&fixed_array);
// No need for a write barrier, we are storing a Smi in the feedback vector.
- __ LoadHeapObject(ebx, FeedbackVector());
- int vector_index = FeedbackVector()->GetIndex(slot);
+ __ EmitLoadTypeFeedbackVector(ebx);
+ int vector_index = SmiFromSlot(slot)->value();
__ mov(FieldOperand(ebx, FixedArray::OffsetOfElementAt(vector_index)),
Immediate(TypeFeedbackVector::MegamorphicSentinel(isolate())));
__ mov(edi, Operand(esp, arg_count * kPointerSize));
// Record call targets in unoptimized code.
- __ LoadHeapObject(ebx, FeedbackVector());
+ __ EmitLoadTypeFeedbackVector(ebx);
__ mov(edx, Immediate(SmiFromSlot(expr->CallNewFeedbackSlot())));
CallConstructStub stub(isolate(), RECORD_CONSTRUCTOR_TARGET);
__ mov(edi, Operand(esp, arg_count * kPointerSize));
// Record call targets in unoptimized code.
- __ LoadHeapObject(ebx, FeedbackVector());
+ __ EmitLoadTypeFeedbackVector(ebx);
__ mov(edx, Immediate(SmiFromSlot(expr->CallFeedbackSlot())));
CallConstructStub stub(isolate(), SUPER_CALL_RECORD_TARGET);
Label non_proxy;
__ bind(&fixed_array);
- __ li(a1, FeedbackVector());
+ __ EmitLoadTypeFeedbackVector(a1);
__ li(a2, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate())));
- int vector_index = FeedbackVector()->GetIndex(slot);
+ int vector_index = SmiFromSlot(slot)->value();
__ sw(a2, FieldMemOperand(a1, FixedArray::OffsetOfElementAt(vector_index)));
__ li(a1, Operand(Smi::FromInt(1))); // Smi indicates slow check
__ lw(a1, MemOperand(sp, arg_count * kPointerSize));
// Record call targets in unoptimized code.
- __ li(a2, FeedbackVector());
+ __ EmitLoadTypeFeedbackVector(a2);
__ li(a3, Operand(SmiFromSlot(expr->CallNewFeedbackSlot())));
CallConstructStub stub(isolate(), RECORD_CONSTRUCTOR_TARGET);
__ lw(a1, MemOperand(sp, arg_count * kPointerSize));
// Record call targets in unoptimized code.
- __ li(a2, FeedbackVector());
+ __ EmitLoadTypeFeedbackVector(a2);
__ li(a3, Operand(SmiFromSlot(expr->CallFeedbackSlot())));
CallConstructStub stub(isolate(), SUPER_CALL_RECORD_TARGET);
Label non_proxy;
__ bind(&fixed_array);
- __ li(a1, FeedbackVector());
+ __ EmitLoadTypeFeedbackVector(a1);
__ li(a2, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate())));
- int vector_index = FeedbackVector()->GetIndex(slot);
+ int vector_index = SmiFromSlot(slot)->value();
__ sd(a2, FieldMemOperand(a1, FixedArray::OffsetOfElementAt(vector_index)));
__ li(a1, Operand(Smi::FromInt(1))); // Smi indicates slow check
__ ld(a1, MemOperand(sp, arg_count * kPointerSize));
// Record call targets in unoptimized code.
- __ li(a2, FeedbackVector());
+ __ EmitLoadTypeFeedbackVector(a2);
__ li(a3, Operand(SmiFromSlot(expr->CallNewFeedbackSlot())));
CallConstructStub stub(isolate(), RECORD_CONSTRUCTOR_TARGET);
__ ld(a1, MemOperand(sp, arg_count * kPointerSize));
// Record call targets in unoptimized code.
- __ li(a2, FeedbackVector());
+ __ EmitLoadTypeFeedbackVector(a2);
__ li(a3, Operand(SmiFromSlot(expr->CallFeedbackSlot())));
CallConstructStub stub(isolate(), SUPER_CALL_RECORD_TARGET);
__ bind(&fixed_array);
// No need for a write barrier, we are storing a Smi in the feedback vector.
- __ Move(rbx, FeedbackVector());
- int vector_index = FeedbackVector()->GetIndex(slot);
+ __ EmitLoadTypeFeedbackVector(rbx);
+ int vector_index = SmiFromSlot(slot)->value();
__ Move(FieldOperand(rbx, FixedArray::OffsetOfElementAt(vector_index)),
TypeFeedbackVector::MegamorphicSentinel(isolate()));
__ Move(rbx, Smi::FromInt(1)); // Smi indicates slow check
__ movp(rdi, Operand(rsp, arg_count * kPointerSize));
// Record call targets in unoptimized code, but not in the snapshot.
- __ Move(rbx, FeedbackVector());
+ __ EmitLoadTypeFeedbackVector(rbx);
__ Move(rdx, SmiFromSlot(expr->CallNewFeedbackSlot()));
CallConstructStub stub(isolate(), RECORD_CONSTRUCTOR_TARGET);
__ movp(rdi, Operand(rsp, arg_count * kPointerSize));
// Record call targets in unoptimized code.
- __ Move(rbx, FeedbackVector());
+ __ EmitLoadTypeFeedbackVector(rbx);
__ Move(rdx, SmiFromSlot(expr->CallFeedbackSlot()));
CallConstructStub stub(isolate(), SUPER_CALL_RECORD_TARGET);
}
-static void EmitLoadTypeFeedbackVector(MacroAssembler* masm, Register vector) {
- __ mov(vector, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
- __ mov(vector, FieldOperand(vector, JSFunction::kSharedFunctionInfoOffset));
- __ mov(vector, FieldOperand(vector,
- SharedFunctionInfo::kFeedbackVectorOffset));
-}
-
-
void CallICStub::HandleArrayCase(MacroAssembler* masm, Label* miss) {
// edi - function
// edx - slot id
void LoadICTrampolineStub::Generate(MacroAssembler* masm) {
- EmitLoadTypeFeedbackVector(masm, LoadWithVectorDescriptor::VectorRegister());
+ __ EmitLoadTypeFeedbackVector(LoadWithVectorDescriptor::VectorRegister());
LoadICStub stub(isolate(), state());
stub.GenerateForTrampoline(masm);
}
void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) {
- EmitLoadTypeFeedbackVector(masm, LoadWithVectorDescriptor::VectorRegister());
+ __ EmitLoadTypeFeedbackVector(LoadWithVectorDescriptor::VectorRegister());
KeyedLoadICStub stub(isolate(), state());
stub.GenerateForTrampoline(masm);
}
void VectorStoreICTrampolineStub::Generate(MacroAssembler* masm) {
- EmitLoadTypeFeedbackVector(masm, VectorStoreICDescriptor::VectorRegister());
+ __ EmitLoadTypeFeedbackVector(VectorStoreICDescriptor::VectorRegister());
VectorStoreICStub stub(isolate(), state());
stub.GenerateForTrampoline(masm);
}
void VectorKeyedStoreICTrampolineStub::Generate(MacroAssembler* masm) {
- EmitLoadTypeFeedbackVector(masm, VectorStoreICDescriptor::VectorRegister());
+ __ EmitLoadTypeFeedbackVector(VectorStoreICDescriptor::VectorRegister());
VectorKeyedStoreICStub stub(isolate(), state());
stub.GenerateForTrampoline(masm);
}
void CallICTrampolineStub::Generate(MacroAssembler* masm) {
- EmitLoadTypeFeedbackVector(masm, ebx);
+ __ EmitLoadTypeFeedbackVector(ebx);
CallICStub stub(isolate(), state());
__ jmp(stub.GetCode(), RelocInfo::CODE_TARGET);
}
}
+void MacroAssembler::EmitLoadTypeFeedbackVector(Register vector) {
+ mov(vector, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
+ mov(vector, FieldOperand(vector, JSFunction::kSharedFunctionInfoOffset));
+ mov(vector, FieldOperand(vector, SharedFunctionInfo::kFeedbackVectorOffset));
+}
+
+
void MacroAssembler::EnterFrame(StackFrame::Type type,
bool load_constant_pool_pointer_reg) {
// Out-of-line constant pool not implemented on ia32.
return SafepointRegisterStackIndex(reg.code());
}
+ // Load the type feedback vector from a JavaScript frame.
+ void EmitLoadTypeFeedbackVector(Register vector);
+
// Activation support.
void EnterFrame(StackFrame::Type type);
void EnterFrame(StackFrame::Type type, bool load_constant_pool_pointer_reg);
}
-static void EmitLoadTypeFeedbackVector(MacroAssembler* masm, Register vector) {
- __ lw(vector, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
- __ lw(vector, FieldMemOperand(vector,
- JSFunction::kSharedFunctionInfoOffset));
- __ lw(vector, FieldMemOperand(vector,
- SharedFunctionInfo::kFeedbackVectorOffset));
-}
-
-
void CallICStub::HandleArrayCase(MacroAssembler* masm, Label* miss) {
// a1 - function
// a3 - slot id
void LoadICTrampolineStub::Generate(MacroAssembler* masm) {
- EmitLoadTypeFeedbackVector(masm, LoadWithVectorDescriptor::VectorRegister());
+ __ EmitLoadTypeFeedbackVector(LoadWithVectorDescriptor::VectorRegister());
LoadICStub stub(isolate(), state());
stub.GenerateForTrampoline(masm);
}
void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) {
- EmitLoadTypeFeedbackVector(masm, LoadWithVectorDescriptor::VectorRegister());
+ __ EmitLoadTypeFeedbackVector(LoadWithVectorDescriptor::VectorRegister());
KeyedLoadICStub stub(isolate(), state());
stub.GenerateForTrampoline(masm);
}
void CallICTrampolineStub::Generate(MacroAssembler* masm) {
- EmitLoadTypeFeedbackVector(masm, a2);
+ __ EmitLoadTypeFeedbackVector(a2);
CallICStub stub(isolate(), state());
__ Jump(stub.GetCode(), RelocInfo::CODE_TARGET);
}
void VectorStoreICTrampolineStub::Generate(MacroAssembler* masm) {
- EmitLoadTypeFeedbackVector(masm, VectorStoreICDescriptor::VectorRegister());
+ __ EmitLoadTypeFeedbackVector(VectorStoreICDescriptor::VectorRegister());
VectorStoreICStub stub(isolate(), state());
stub.GenerateForTrampoline(masm);
}
void VectorKeyedStoreICTrampolineStub::Generate(MacroAssembler* masm) {
- EmitLoadTypeFeedbackVector(masm, VectorStoreICDescriptor::VectorRegister());
+ __ EmitLoadTypeFeedbackVector(VectorStoreICDescriptor::VectorRegister());
VectorKeyedStoreICStub stub(isolate(), state());
stub.GenerateForTrampoline(masm);
}
}
+void MacroAssembler::EmitLoadTypeFeedbackVector(Register vector) {
+ lw(vector, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
+ lw(vector, FieldMemOperand(vector, JSFunction::kSharedFunctionInfoOffset));
+ lw(vector,
+ FieldMemOperand(vector, SharedFunctionInfo::kFeedbackVectorOffset));
+}
+
+
void MacroAssembler::EnterFrame(StackFrame::Type type,
bool load_constant_pool_pointer_reg) {
// Out-of-line constant pool not implemented on mips.
void StubPrologue();
void Prologue(bool code_pre_aging);
+ // Load the type feedback vector from a JavaScript frame.
+ void EmitLoadTypeFeedbackVector(Register vector);
+
// Activation support.
void EnterFrame(StackFrame::Type type);
void EnterFrame(StackFrame::Type type, bool load_constant_pool_pointer_reg);
}
-static void EmitLoadTypeFeedbackVector(MacroAssembler* masm, Register vector) {
- __ ld(vector, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
- __ ld(vector, FieldMemOperand(vector,
- JSFunction::kSharedFunctionInfoOffset));
- __ ld(vector, FieldMemOperand(vector,
- SharedFunctionInfo::kFeedbackVectorOffset));
-}
-
-
void CallICStub::HandleArrayCase(MacroAssembler* masm, Label* miss) {
// a1 - function
// a3 - slot id
void LoadICTrampolineStub::Generate(MacroAssembler* masm) {
- EmitLoadTypeFeedbackVector(masm, LoadWithVectorDescriptor::VectorRegister());
+ __ EmitLoadTypeFeedbackVector(LoadWithVectorDescriptor::VectorRegister());
LoadICStub stub(isolate(), state());
stub.GenerateForTrampoline(masm);
}
void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) {
- EmitLoadTypeFeedbackVector(masm, LoadWithVectorDescriptor::VectorRegister());
+ __ EmitLoadTypeFeedbackVector(LoadWithVectorDescriptor::VectorRegister());
KeyedLoadICStub stub(isolate(), state());
stub.GenerateForTrampoline(masm);
}
void CallICTrampolineStub::Generate(MacroAssembler* masm) {
- EmitLoadTypeFeedbackVector(masm, a2);
+ __ EmitLoadTypeFeedbackVector(a2);
CallICStub stub(isolate(), state());
__ Jump(stub.GetCode(), RelocInfo::CODE_TARGET);
}
void VectorStoreICTrampolineStub::Generate(MacroAssembler* masm) {
- EmitLoadTypeFeedbackVector(masm, VectorStoreICDescriptor::VectorRegister());
+ __ EmitLoadTypeFeedbackVector(VectorStoreICDescriptor::VectorRegister());
VectorStoreICStub stub(isolate(), state());
stub.GenerateForTrampoline(masm);
}
void VectorKeyedStoreICTrampolineStub::Generate(MacroAssembler* masm) {
- EmitLoadTypeFeedbackVector(masm, VectorStoreICDescriptor::VectorRegister());
+ __ EmitLoadTypeFeedbackVector(VectorStoreICDescriptor::VectorRegister());
VectorKeyedStoreICStub stub(isolate(), state());
stub.GenerateForTrampoline(masm);
}
}
+void MacroAssembler::EmitLoadTypeFeedbackVector(Register vector) {
+ ld(vector, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
+ ld(vector, FieldMemOperand(vector, JSFunction::kSharedFunctionInfoOffset));
+ ld(vector,
+ FieldMemOperand(vector, SharedFunctionInfo::kFeedbackVectorOffset));
+}
+
+
void MacroAssembler::EnterFrame(StackFrame::Type type,
bool load_constant_pool_pointer_reg) {
// Out-of-line constant pool not implemented on mips64.
void StubPrologue();
void Prologue(bool code_pre_aging);
+ // Load the type feedback vector from a JavaScript frame.
+ void EmitLoadTypeFeedbackVector(Register vector);
+
// Activation support.
void EnterFrame(StackFrame::Type type);
void EnterFrame(StackFrame::Type type, bool load_constant_pool_pointer_reg);
}
+template int TypeFeedbackVector::GetIndexFromSpec(const ZoneFeedbackVectorSpec*,
+ FeedbackVectorICSlot);
+template int TypeFeedbackVector::GetIndexFromSpec(const ZoneFeedbackVectorSpec*,
+ FeedbackVectorSlot);
+
+
+// static
+template <typename Spec>
+int TypeFeedbackVector::GetIndexFromSpec(const Spec* spec,
+ FeedbackVectorSlot slot) {
+ const int ic_slot_count = spec->ic_slots();
+ const int index_count = VectorICComputer::word_count(ic_slot_count);
+ return kReservedIndexCount + index_count + slot.ToInt();
+}
+
+
+// static
+template <typename Spec>
+int TypeFeedbackVector::GetIndexFromSpec(const Spec* spec,
+ FeedbackVectorICSlot slot) {
+ const int slot_count = spec->slots();
+ const int ic_slot_count = spec->ic_slots();
+ const int index_count = VectorICComputer::word_count(ic_slot_count);
+ return kReservedIndexCount + index_count + slot_count +
+ slot.ToInt() * elements_per_ic_slot();
+}
+
+
// static
int TypeFeedbackVector::PushAppliedArgumentsIndex() {
const int index_count = VectorICComputer::word_count(1);
inline int GetIndex(FeedbackVectorSlot slot) const;
inline int GetIndex(FeedbackVectorICSlot slot) const;
+ template <typename Spec>
+ static int GetIndexFromSpec(const Spec* spec, FeedbackVectorSlot slot);
+ template <typename Spec>
+ static int GetIndexFromSpec(const Spec* spec, FeedbackVectorICSlot slot);
+
// Conversion from an integer index to either a slot or an ic slot. The caller
// should know what kind she expects.
inline FeedbackVectorSlot ToSlot(int index) const;
}
-static void EmitLoadTypeFeedbackVector(MacroAssembler* masm, Register vector) {
- __ movp(vector, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
- __ movp(vector, FieldOperand(vector, JSFunction::kSharedFunctionInfoOffset));
- __ movp(vector, FieldOperand(vector,
- SharedFunctionInfo::kFeedbackVectorOffset));
-}
-
-
void CallICStub::HandleArrayCase(MacroAssembler* masm, Label* miss) {
// rdi - function
// rdx - slot id
void LoadICTrampolineStub::Generate(MacroAssembler* masm) {
- EmitLoadTypeFeedbackVector(masm, LoadWithVectorDescriptor::VectorRegister());
+ __ EmitLoadTypeFeedbackVector(LoadWithVectorDescriptor::VectorRegister());
LoadICStub stub(isolate(), state());
stub.GenerateForTrampoline(masm);
}
void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) {
- EmitLoadTypeFeedbackVector(masm, LoadWithVectorDescriptor::VectorRegister());
+ __ EmitLoadTypeFeedbackVector(LoadWithVectorDescriptor::VectorRegister());
KeyedLoadICStub stub(isolate(), state());
stub.GenerateForTrampoline(masm);
}
void VectorStoreICTrampolineStub::Generate(MacroAssembler* masm) {
- EmitLoadTypeFeedbackVector(masm, VectorStoreICDescriptor::VectorRegister());
+ __ EmitLoadTypeFeedbackVector(VectorStoreICDescriptor::VectorRegister());
VectorStoreICStub stub(isolate(), state());
stub.GenerateForTrampoline(masm);
}
void VectorKeyedStoreICTrampolineStub::Generate(MacroAssembler* masm) {
- EmitLoadTypeFeedbackVector(masm, VectorStoreICDescriptor::VectorRegister());
+ __ EmitLoadTypeFeedbackVector(VectorStoreICDescriptor::VectorRegister());
VectorKeyedStoreICStub stub(isolate(), state());
stub.GenerateForTrampoline(masm);
}
void CallICTrampolineStub::Generate(MacroAssembler* masm) {
- EmitLoadTypeFeedbackVector(masm, rbx);
+ __ EmitLoadTypeFeedbackVector(rbx);
CallICStub stub(isolate(), state());
__ jmp(stub.GetCode(), RelocInfo::CODE_TARGET);
}
}
+void MacroAssembler::EmitLoadTypeFeedbackVector(Register vector) {
+ movp(vector, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset));
+ movp(vector, FieldOperand(vector, JSFunction::kSharedFunctionInfoOffset));
+ movp(vector, FieldOperand(vector, SharedFunctionInfo::kFeedbackVectorOffset));
+}
+
+
void MacroAssembler::EnterFrame(StackFrame::Type type,
bool load_constant_pool_pointer_reg) {
// Out-of-line constant pool not implemented on x64.
return SafepointRegisterStackIndex(reg.code());
}
+ // Load the type feedback vector from a JavaScript frame.
+ void EmitLoadTypeFeedbackVector(Register vector);
+
// Activation support.
void EnterFrame(StackFrame::Type type);
void EnterFrame(StackFrame::Type type, bool load_constant_pool_pointer_reg);