Commit 6fb3708d authored by mbrandy's avatar mbrandy Committed by Commit bot

PPC: Full code shouldn't embed the type feedback vector.

Port c90c60ba

Original commit message:
    Make sure to always reference it indirectly. This allows us to make the vector
    native-context dependent should we wish.

R=mvstanton@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com, dstence@us.ibm.com
BUG=

Review URL: https://codereview.chromium.org/1381803002

Cr-Commit-Position: refs/heads/master@{#31036}
parent aeefe101
......@@ -1090,9 +1090,9 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
Label non_proxy;
__ bind(&fixed_array);
__ Move(r4, FeedbackVector());
__ EmitLoadTypeFeedbackVector(r4);
__ mov(r5, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate())));
int vector_index = FeedbackVector()->GetIndex(slot);
int vector_index = SmiFromSlot(slot)->value();
__ StoreP(
r5, FieldMemOperand(r4, FixedArray::OffsetOfElementAt(vector_index)), r0);
......@@ -3176,7 +3176,7 @@ void FullCodeGenerator::VisitCallNew(CallNew* expr) {
__ LoadP(r4, MemOperand(sp, arg_count * kPointerSize), r0);
// Record call targets in unoptimized code.
__ Move(r5, FeedbackVector());
__ EmitLoadTypeFeedbackVector(r5);
__ LoadSmiLiteral(r6, SmiFromSlot(expr->CallNewFeedbackSlot()));
CallConstructStub stub(isolate(), RECORD_CONSTRUCTOR_TARGET);
......@@ -3216,7 +3216,7 @@ void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
__ LoadP(r4, MemOperand(sp, arg_count * kPointerSize));
// Record call targets in unoptimized code.
__ Move(r5, FeedbackVector());
__ EmitLoadTypeFeedbackVector(r5);
__ LoadSmiLiteral(r6, SmiFromSlot(expr->CallFeedbackSlot()));
CallConstructStub stub(isolate(), SUPER_CALL_RECORD_TARGET);
......
......@@ -2681,15 +2681,6 @@ void CallConstructStub::Generate(MacroAssembler* masm) {
}
static void EmitLoadTypeFeedbackVector(MacroAssembler* masm, Register vector) {
__ LoadP(vector, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
__ LoadP(vector,
FieldMemOperand(vector, JSFunction::kSharedFunctionInfoOffset));
__ LoadP(vector,
FieldMemOperand(vector, SharedFunctionInfo::kFeedbackVectorOffset));
}
void CallICStub::HandleArrayCase(MacroAssembler* masm, Label* miss) {
// r4 - function
// r6 - slot id
......@@ -4465,21 +4456,21 @@ void StubFailureTrampolineStub::Generate(MacroAssembler* masm) {
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, r5);
__ EmitLoadTypeFeedbackVector(r5);
CallICStub stub(isolate(), state());
__ Jump(stub.GetCode(), RelocInfo::CODE_TARGET);
}
......@@ -4705,14 +4696,14 @@ void KeyedLoadICStub::GenerateImpl(MacroAssembler* masm, bool in_frame) {
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);
}
......
......@@ -753,6 +753,14 @@ void MacroAssembler::Prologue(bool code_pre_aging, int prologue_offset) {
}
void MacroAssembler::EmitLoadTypeFeedbackVector(Register vector) {
LoadP(vector, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
LoadP(vector, FieldMemOperand(vector, JSFunction::kSharedFunctionInfoOffset));
LoadP(vector,
FieldMemOperand(vector, SharedFunctionInfo::kFeedbackVectorOffset));
}
void MacroAssembler::EnterFrame(StackFrame::Type type,
bool load_constant_pool_pointer_reg) {
if (FLAG_enable_embedded_constant_pool && load_constant_pool_pointer_reg) {
......
......@@ -1416,6 +1416,9 @@ class MacroAssembler : public Assembler {
DecodeFieldToSmi<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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment