From: bmeurer Date: Fri, 24 Jul 2015 12:37:07 +0000 (-0700) Subject: [mips] Fix Load/StoreGlobalContext stubs. X-Git-Tag: upstream/4.7.83~1196 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dd1a26de5c8ab9d4b539a33a2ec6a8dac877b243;p=platform%2Fupstream%2Fv8.git [mips] Fix Load/StoreGlobalContext stubs. Fix invalid tail calls and wrong context register. R=ishell@chromium.org Review URL: https://codereview.chromium.org/1257603004 Cr-Commit-Position: refs/heads/master@{#29844} --- diff --git a/src/mips/code-stubs-mips.cc b/src/mips/code-stubs-mips.cc index 272fedafe..7dbc5d8e7 100644 --- a/src/mips/code-stubs-mips.cc +++ b/src/mips/code-stubs-mips.cc @@ -5285,7 +5285,7 @@ void LoadGlobalViaContextStub::Generate(MacroAssembler* masm) { // Load the PropertyCell value at the specified slot. __ sll(at, slot_reg, kPointerSizeLog2); - __ Addu(at, at, Operand(cp)); + __ Addu(at, at, Operand(context_reg)); __ Addu(at, at, Context::SlotOffset(0)); __ lw(result_reg, MemOperand(at)); __ lw(result_reg, FieldMemOperand(result_reg, PropertyCell::kValueOffset)); @@ -5298,8 +5298,7 @@ void LoadGlobalViaContextStub::Generate(MacroAssembler* masm) { // Fallback to the runtime. __ bind(&slow_case); __ SmiTag(slot_reg); - __ Drop(1); // Pop return address. - __ Push(slot_reg, name_reg, result_reg); + __ Push(slot_reg, name_reg); __ TailCallRuntime(Runtime::kLoadGlobalViaContext, 2, 1); } @@ -5327,7 +5326,7 @@ void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) { // Load the PropertyCell at the specified slot. __ sll(at, slot_reg, kPointerSizeLog2); - __ Addu(at, at, Operand(cp)); + __ Addu(at, at, Operand(context_reg)); __ Addu(at, at, Context::SlotOffset(0)); __ lw(cell_reg, MemOperand(at)); @@ -5410,8 +5409,7 @@ void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) { // Fallback to the runtime. __ bind(&slow_case); __ SmiTag(slot_reg); - __ Drop(1); // Pop return address. - __ Push(slot_reg, name_reg, value_reg, cell_reg); + __ Push(slot_reg, name_reg, value_reg); __ TailCallRuntime(is_strict(language_mode()) ? Runtime::kStoreGlobalViaContext_Strict : Runtime::kStoreGlobalViaContext_Sloppy, diff --git a/src/mips64/code-stubs-mips64.cc b/src/mips64/code-stubs-mips64.cc index d8797ffab..dad5e75fd 100644 --- a/src/mips64/code-stubs-mips64.cc +++ b/src/mips64/code-stubs-mips64.cc @@ -5316,7 +5316,7 @@ void LoadGlobalViaContextStub::Generate(MacroAssembler* masm) { // Load the PropertyCell value at the specified slot. __ dsll(at, slot_reg, kPointerSizeLog2); - __ Daddu(at, at, Operand(cp)); + __ Daddu(at, at, Operand(context_reg)); __ Daddu(at, at, Context::SlotOffset(0)); __ ld(result_reg, MemOperand(at)); __ ld(result_reg, FieldMemOperand(result_reg, PropertyCell::kValueOffset)); @@ -5329,8 +5329,7 @@ void LoadGlobalViaContextStub::Generate(MacroAssembler* masm) { // Fallback to the runtime. __ bind(&slow_case); __ SmiTag(slot_reg); - __ Drop(1); // Pop return address. - __ Push(slot_reg, name_reg, result_reg); + __ Push(slot_reg, name_reg); __ TailCallRuntime(Runtime::kLoadGlobalViaContext, 2, 1); } @@ -5358,7 +5357,7 @@ void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) { // Load the PropertyCell at the specified slot. __ dsll(at, slot_reg, kPointerSizeLog2); - __ Daddu(at, at, Operand(cp)); + __ Daddu(at, at, Operand(context_reg)); __ Daddu(at, at, Context::SlotOffset(0)); __ ld(cell_reg, MemOperand(at)); @@ -5441,8 +5440,7 @@ void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) { // Fallback to the runtime. __ bind(&slow_case); __ SmiTag(slot_reg); - __ Drop(1); // Pop return address. - __ Push(slot_reg, name_reg, value_reg, cell_reg); + __ Push(slot_reg, name_reg, value_reg); __ TailCallRuntime(is_strict(language_mode()) ? Runtime::kStoreGlobalViaContext_Strict : Runtime::kStoreGlobalViaContext_Sloppy,