From f74501c6278b8acee5146f637c791f7d9632b947 Mon Sep 17 00:00:00 2001 From: "plind44@gmail.com" Date: Thu, 6 Feb 2014 16:45:50 +0000 Subject: [PATCH] MIPS: swap in global proxy on accessors. Port r19142 (087bc3e) BUG= R=plind44@gmail.com Review URL: https://codereview.chromium.org/140893011 Patch from Balazs Kilvady . git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19168 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/mips/stub-cache-mips.cc | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/mips/stub-cache-mips.cc b/src/mips/stub-cache-mips.cc index 10813eb..60ab0b8 100644 --- a/src/mips/stub-cache-mips.cc +++ b/src/mips/stub-cache-mips.cc @@ -1270,6 +1270,7 @@ Handle StoreStubCompiler::CompileStoreCallback( void StoreStubCompiler::GenerateStoreViaSetter( MacroAssembler* masm, + Handle type, Handle setter) { // ----------- S t a t e ------------- // -- a0 : value @@ -1279,13 +1280,21 @@ void StoreStubCompiler::GenerateStoreViaSetter( // ----------------------------------- { FrameScope scope(masm, StackFrame::INTERNAL); + Register receiver = a1; + Register value = a0; // Save value register, so we can restore it later. - __ push(a0); + __ push(value); if (!setter.is_null()) { // Call the JavaScript setter with receiver and value on the stack. - __ Push(a1, a0); + if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { + // Swap in the global receiver. + __ lw(receiver, + FieldMemOperand( + receiver, JSGlobalObject::kGlobalReceiverOffset)); + } + __ Push(receiver, value); ParameterCount actual(1); ParameterCount expected(setter); __ InvokeFunction(setter, expected, actual, @@ -1391,6 +1400,7 @@ Register* KeyedStoreStubCompiler::registers() { void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm, + Handle type, Register receiver, Handle getter) { // ----------- S t a t e ------------- @@ -1403,6 +1413,12 @@ void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm, if (!getter.is_null()) { // Call the JavaScript getter with the receiver on the stack. + if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { + // Swap in the global receiver. + __ lw(receiver, + FieldMemOperand( + receiver, JSGlobalObject::kGlobalReceiverOffset)); + } __ push(receiver); ParameterCount actual(0); ParameterCount expected(getter); -- 2.7.4