Commit d83a2445 authored by ulan's avatar ulan Committed by Commit bot

Fix register aliasing after r26306, r26275.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#26317}
parent 1df5fed5
...@@ -18,7 +18,8 @@ namespace internal { ...@@ -18,7 +18,8 @@ namespace internal {
void NamedLoadHandlerCompiler::GenerateLoadViaGetter( void NamedLoadHandlerCompiler::GenerateLoadViaGetter(
MacroAssembler* masm, Handle<HeapType> type, Register receiver, MacroAssembler* masm, Handle<HeapType> type, Register receiver,
Register holder, int accessor_index, int expected_arguments) { Register holder, int accessor_index, int expected_arguments,
Register scratch) {
// ----------- S t a t e ------------- // ----------- S t a t e -------------
// -- r0 : receiver // -- r0 : receiver
// -- r2 : name // -- r2 : name
...@@ -28,11 +29,14 @@ void NamedLoadHandlerCompiler::GenerateLoadViaGetter( ...@@ -28,11 +29,14 @@ void NamedLoadHandlerCompiler::GenerateLoadViaGetter(
FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
if (accessor_index >= 0) { if (accessor_index >= 0) {
DCHECK(!holder.is(scratch));
DCHECK(!receiver.is(scratch));
// Call the JavaScript getter with the receiver on the stack. // Call the JavaScript getter with the receiver on the stack.
if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) {
// Swap in the global receiver. // Swap in the global receiver.
__ ldr(receiver, __ ldr(scratch,
FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset));
receiver = scratch;
} }
__ push(receiver); __ push(receiver);
ParameterCount actual(0); ParameterCount actual(0);
...@@ -54,7 +58,8 @@ void NamedLoadHandlerCompiler::GenerateLoadViaGetter( ...@@ -54,7 +58,8 @@ void NamedLoadHandlerCompiler::GenerateLoadViaGetter(
void NamedStoreHandlerCompiler::GenerateStoreViaSetter( void NamedStoreHandlerCompiler::GenerateStoreViaSetter(
MacroAssembler* masm, Handle<HeapType> type, Register receiver, MacroAssembler* masm, Handle<HeapType> type, Register receiver,
Register holder, int accessor_index, int expected_arguments) { Register holder, int accessor_index, int expected_arguments,
Register scratch) {
// ----------- S t a t e ------------- // ----------- S t a t e -------------
// -- lr : return address // -- lr : return address
// ----------------------------------- // -----------------------------------
...@@ -65,11 +70,15 @@ void NamedStoreHandlerCompiler::GenerateStoreViaSetter( ...@@ -65,11 +70,15 @@ void NamedStoreHandlerCompiler::GenerateStoreViaSetter(
__ push(value()); __ push(value());
if (accessor_index >= 0) { if (accessor_index >= 0) {
DCHECK(!holder.is(scratch));
DCHECK(!receiver.is(scratch));
DCHECK(!value().is(scratch));
// Call the JavaScript setter with receiver and value on the stack. // Call the JavaScript setter with receiver and value on the stack.
if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) {
// Swap in the global receiver. // Swap in the global receiver.
__ ldr(receiver, __ ldr(scratch,
FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset));
receiver = scratch;
} }
__ Push(receiver, value()); __ Push(receiver, value());
ParameterCount actual(1); ParameterCount actual(1);
......
...@@ -221,12 +221,12 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall( ...@@ -221,12 +221,12 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall(
void NamedStoreHandlerCompiler::GenerateStoreViaSetter( void NamedStoreHandlerCompiler::GenerateStoreViaSetter(
MacroAssembler* masm, Handle<HeapType> type, Register receiver, MacroAssembler* masm, Handle<HeapType> type, Register receiver,
Register holder, int accessor_index, int expected_arguments) { Register holder, int accessor_index, int expected_arguments,
Register scratch) {
// ----------- S t a t e ------------- // ----------- S t a t e -------------
// -- lr : return address // -- lr : return address
// ----------------------------------- // -----------------------------------
Label miss; Label miss;
{ {
FrameScope scope(masm, StackFrame::INTERNAL); FrameScope scope(masm, StackFrame::INTERNAL);
...@@ -234,11 +234,15 @@ void NamedStoreHandlerCompiler::GenerateStoreViaSetter( ...@@ -234,11 +234,15 @@ void NamedStoreHandlerCompiler::GenerateStoreViaSetter(
__ Push(value()); __ Push(value());
if (accessor_index >= 0) { if (accessor_index >= 0) {
DCHECK(!AreAliased(holder, scratch));
DCHECK(!AreAliased(receiver, scratch));
DCHECK(!AreAliased(value(), scratch));
// Call the JavaScript setter with receiver and value on the stack. // Call the JavaScript setter with receiver and value on the stack.
if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) {
// Swap in the global receiver. // Swap in the global receiver.
__ Ldr(receiver, __ Ldr(scratch,
FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset));
receiver = scratch;
} }
__ Push(receiver, value()); __ Push(receiver, value());
ParameterCount actual(1); ParameterCount actual(1);
...@@ -263,16 +267,20 @@ void NamedStoreHandlerCompiler::GenerateStoreViaSetter( ...@@ -263,16 +267,20 @@ void NamedStoreHandlerCompiler::GenerateStoreViaSetter(
void NamedLoadHandlerCompiler::GenerateLoadViaGetter( void NamedLoadHandlerCompiler::GenerateLoadViaGetter(
MacroAssembler* masm, Handle<HeapType> type, Register receiver, MacroAssembler* masm, Handle<HeapType> type, Register receiver,
Register holder, int accessor_index, int expected_arguments) { Register holder, int accessor_index, int expected_arguments,
Register scratch) {
{ {
FrameScope scope(masm, StackFrame::INTERNAL); FrameScope scope(masm, StackFrame::INTERNAL);
if (accessor_index >= 0) { if (accessor_index >= 0) {
DCHECK(!AreAliased(holder, scratch));
DCHECK(!AreAliased(receiver, scratch));
// Call the JavaScript getter with the receiver on the stack. // Call the JavaScript getter with the receiver on the stack.
if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) {
// Swap in the global receiver. // Swap in the global receiver.
__ Ldr(receiver, __ Ldr(scratch,
FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset));
receiver = scratch;
} }
__ Push(receiver); __ Push(receiver);
ParameterCount actual(0); ParameterCount actual(0);
......
...@@ -356,7 +356,7 @@ Handle<Code> NamedLoadHandlerCompiler::CompileLoadViaGetter( ...@@ -356,7 +356,7 @@ Handle<Code> NamedLoadHandlerCompiler::CompileLoadViaGetter(
Handle<Name> name, int accessor_index, int expected_arguments) { Handle<Name> name, int accessor_index, int expected_arguments) {
Register holder = Frontend(name); Register holder = Frontend(name);
GenerateLoadViaGetter(masm(), type(), receiver(), holder, accessor_index, GenerateLoadViaGetter(masm(), type(), receiver(), holder, accessor_index,
expected_arguments); expected_arguments, scratch2());
return GetCode(kind(), Code::FAST, name); return GetCode(kind(), Code::FAST, name);
} }
...@@ -446,7 +446,7 @@ Handle<Code> NamedStoreHandlerCompiler::CompileStoreViaSetter( ...@@ -446,7 +446,7 @@ Handle<Code> NamedStoreHandlerCompiler::CompileStoreViaSetter(
int expected_arguments) { int expected_arguments) {
Register holder = Frontend(name); Register holder = Frontend(name);
GenerateStoreViaSetter(masm(), type(), receiver(), holder, accessor_index, GenerateStoreViaSetter(masm(), type(), receiver(), holder, accessor_index,
expected_arguments); expected_arguments, scratch2());
return GetCode(kind(), Code::FAST, name); return GetCode(kind(), Code::FAST, name);
} }
......
...@@ -145,11 +145,12 @@ class NamedLoadHandlerCompiler : public PropertyHandlerCompiler { ...@@ -145,11 +145,12 @@ class NamedLoadHandlerCompiler : public PropertyHandlerCompiler {
static void GenerateLoadViaGetter(MacroAssembler* masm, Handle<HeapType> type, static void GenerateLoadViaGetter(MacroAssembler* masm, Handle<HeapType> type,
Register receiver, Register holder, Register receiver, Register holder,
int accessor_index, int expected_arguments); int accessor_index, int expected_arguments,
Register scratch);
static void GenerateLoadViaGetterForDeopt(MacroAssembler* masm) { static void GenerateLoadViaGetterForDeopt(MacroAssembler* masm) {
GenerateLoadViaGetter(masm, Handle<HeapType>::null(), no_reg, no_reg, -1, GenerateLoadViaGetter(masm, Handle<HeapType>::null(), no_reg, no_reg, -1,
-1); -1, no_reg);
} }
static void GenerateLoadFunctionPrototype(MacroAssembler* masm, static void GenerateLoadFunctionPrototype(MacroAssembler* masm,
...@@ -232,11 +233,11 @@ class NamedStoreHandlerCompiler : public PropertyHandlerCompiler { ...@@ -232,11 +233,11 @@ class NamedStoreHandlerCompiler : public PropertyHandlerCompiler {
static void GenerateStoreViaSetter(MacroAssembler* masm, static void GenerateStoreViaSetter(MacroAssembler* masm,
Handle<HeapType> type, Register receiver, Handle<HeapType> type, Register receiver,
Register holder, int accessor_index, Register holder, int accessor_index,
int expected_arguments); int expected_arguments, Register scratch);
static void GenerateStoreViaSetterForDeopt(MacroAssembler* masm) { static void GenerateStoreViaSetterForDeopt(MacroAssembler* masm) {
GenerateStoreViaSetter(masm, Handle<HeapType>::null(), no_reg, no_reg, -1, GenerateStoreViaSetter(masm, Handle<HeapType>::null(), no_reg, no_reg, -1,
-1); -1, no_reg);
} }
static void GenerateSlow(MacroAssembler* masm); static void GenerateSlow(MacroAssembler* masm);
......
...@@ -18,16 +18,20 @@ namespace internal { ...@@ -18,16 +18,20 @@ namespace internal {
void NamedLoadHandlerCompiler::GenerateLoadViaGetter( void NamedLoadHandlerCompiler::GenerateLoadViaGetter(
MacroAssembler* masm, Handle<HeapType> type, Register receiver, MacroAssembler* masm, Handle<HeapType> type, Register receiver,
Register holder, int accessor_index, int expected_arguments) { Register holder, int accessor_index, int expected_arguments,
Register scratch) {
{ {
FrameScope scope(masm, StackFrame::INTERNAL); FrameScope scope(masm, StackFrame::INTERNAL);
if (accessor_index >= 0) { if (accessor_index >= 0) {
DCHECK(!holder.is(scratch));
DCHECK(!receiver.is(scratch));
// Call the JavaScript getter with the receiver on the stack. // Call the JavaScript getter with the receiver on the stack.
if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) {
// Swap in the global receiver. // Swap in the global receiver.
__ mov(receiver, __ mov(scratch,
FieldOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); FieldOperand(receiver, JSGlobalObject::kGlobalProxyOffset));
receiver = scratch;
} }
__ push(receiver); __ push(receiver);
ParameterCount actual(0); ParameterCount actual(0);
...@@ -231,7 +235,8 @@ void PropertyHandlerCompiler::GenerateCheckPropertyCell( ...@@ -231,7 +235,8 @@ void PropertyHandlerCompiler::GenerateCheckPropertyCell(
void NamedStoreHandlerCompiler::GenerateStoreViaSetter( void NamedStoreHandlerCompiler::GenerateStoreViaSetter(
MacroAssembler* masm, Handle<HeapType> type, Register receiver, MacroAssembler* masm, Handle<HeapType> type, Register receiver,
Register holder, int accessor_index, int expected_arguments) { Register holder, int accessor_index, int expected_arguments,
Register scratch) {
// ----------- S t a t e ------------- // ----------- S t a t e -------------
// -- esp[0] : return address // -- esp[0] : return address
// ----------------------------------- // -----------------------------------
...@@ -242,11 +247,14 @@ void NamedStoreHandlerCompiler::GenerateStoreViaSetter( ...@@ -242,11 +247,14 @@ void NamedStoreHandlerCompiler::GenerateStoreViaSetter(
__ push(value()); __ push(value());
if (accessor_index >= 0) { if (accessor_index >= 0) {
DCHECK(!holder.is(scratch));
DCHECK(!receiver.is(scratch));
DCHECK(!value().is(scratch));
// Call the JavaScript setter with receiver and value on the stack. // Call the JavaScript setter with receiver and value on the stack.
if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) {
// Swap in the global receiver. __ mov(scratch,
__ mov(receiver,
FieldOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); FieldOperand(receiver, JSGlobalObject::kGlobalProxyOffset));
receiver = scratch;
} }
__ push(receiver); __ push(receiver);
__ push(value()); __ push(value());
......
...@@ -18,7 +18,8 @@ namespace internal { ...@@ -18,7 +18,8 @@ namespace internal {
void NamedLoadHandlerCompiler::GenerateLoadViaGetter( void NamedLoadHandlerCompiler::GenerateLoadViaGetter(
MacroAssembler* masm, Handle<HeapType> type, Register receiver, MacroAssembler* masm, Handle<HeapType> type, Register receiver,
Register holder, int accessor_index, int expected_arguments) { Register holder, int accessor_index, int expected_arguments,
Register scratch) {
// ----------- S t a t e ------------- // ----------- S t a t e -------------
// -- a0 : receiver // -- a0 : receiver
// -- a2 : name // -- a2 : name
...@@ -28,11 +29,14 @@ void NamedLoadHandlerCompiler::GenerateLoadViaGetter( ...@@ -28,11 +29,14 @@ void NamedLoadHandlerCompiler::GenerateLoadViaGetter(
FrameScope scope(masm, StackFrame::INTERNAL); FrameScope scope(masm, StackFrame::INTERNAL);
if (accessor_index >= 0) { if (accessor_index >= 0) {
DCHECK(!holder.is(scratch));
DCHECK(!receiver.is(scratch));
// Call the JavaScript getter with the receiver on the stack. // Call the JavaScript getter with the receiver on the stack.
if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) {
// Swap in the global receiver. // Swap in the global receiver.
__ lw(receiver, __ lw(scratch,
FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset));
receiver = scratch;
} }
__ push(receiver); __ push(receiver);
ParameterCount actual(0); ParameterCount actual(0);
...@@ -54,7 +58,8 @@ void NamedLoadHandlerCompiler::GenerateLoadViaGetter( ...@@ -54,7 +58,8 @@ void NamedLoadHandlerCompiler::GenerateLoadViaGetter(
void NamedStoreHandlerCompiler::GenerateStoreViaSetter( void NamedStoreHandlerCompiler::GenerateStoreViaSetter(
MacroAssembler* masm, Handle<HeapType> type, Register receiver, MacroAssembler* masm, Handle<HeapType> type, Register receiver,
Register holder, int accessor_index, int expected_arguments) { Register holder, int accessor_index, int expected_arguments,
Register scratch) {
// ----------- S t a t e ------------- // ----------- S t a t e -------------
// -- ra : return address // -- ra : return address
// ----------------------------------- // -----------------------------------
...@@ -65,11 +70,15 @@ void NamedStoreHandlerCompiler::GenerateStoreViaSetter( ...@@ -65,11 +70,15 @@ void NamedStoreHandlerCompiler::GenerateStoreViaSetter(
__ push(value()); __ push(value());
if (accessor_index >= 0) { if (accessor_index >= 0) {
DCHECK(!holder.is(scratch));
DCHECK(!receiver.is(scratch));
DCHECK(!value().is(scratch));
// Call the JavaScript setter with receiver and value on the stack. // Call the JavaScript setter with receiver and value on the stack.
if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) {
// Swap in the global receiver. // Swap in the global receiver.
__ lw(receiver, __ lw(scratch,
FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset));
receiver = scratch;
} }
__ Push(receiver, value()); __ Push(receiver, value());
ParameterCount actual(1); ParameterCount actual(1);
......
...@@ -18,7 +18,8 @@ namespace internal { ...@@ -18,7 +18,8 @@ namespace internal {
void NamedLoadHandlerCompiler::GenerateLoadViaGetter( void NamedLoadHandlerCompiler::GenerateLoadViaGetter(
MacroAssembler* masm, Handle<HeapType> type, Register receiver, MacroAssembler* masm, Handle<HeapType> type, Register receiver,
Register holder, int accessor_index, int expected_arguments) { Register holder, int accessor_index, int expected_arguments,
Register scratch) {
// ----------- S t a t e ------------- // ----------- S t a t e -------------
// -- a0 : receiver // -- a0 : receiver
// -- a2 : name // -- a2 : name
...@@ -28,11 +29,14 @@ void NamedLoadHandlerCompiler::GenerateLoadViaGetter( ...@@ -28,11 +29,14 @@ void NamedLoadHandlerCompiler::GenerateLoadViaGetter(
FrameScope scope(masm, StackFrame::INTERNAL); FrameScope scope(masm, StackFrame::INTERNAL);
if (accessor_index >= 0) { if (accessor_index >= 0) {
DCHECK(!holder.is(scratch));
DCHECK(!receiver.is(scratch));
// Call the JavaScript getter with the receiver on the stack. // Call the JavaScript getter with the receiver on the stack.
if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) {
// Swap in the global receiver. // Swap in the global receiver.
__ ld(receiver, __ ld(scratch,
FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset));
receiver = scratch;
} }
__ push(receiver); __ push(receiver);
ParameterCount actual(0); ParameterCount actual(0);
...@@ -54,7 +58,8 @@ void NamedLoadHandlerCompiler::GenerateLoadViaGetter( ...@@ -54,7 +58,8 @@ void NamedLoadHandlerCompiler::GenerateLoadViaGetter(
void NamedStoreHandlerCompiler::GenerateStoreViaSetter( void NamedStoreHandlerCompiler::GenerateStoreViaSetter(
MacroAssembler* masm, Handle<HeapType> type, Register receiver, MacroAssembler* masm, Handle<HeapType> type, Register receiver,
Register holder, int accessor_index, int expected_arguments) { Register holder, int accessor_index, int expected_arguments,
Register scratch) {
// ----------- S t a t e ------------- // ----------- S t a t e -------------
// -- ra : return address // -- ra : return address
// ----------------------------------- // -----------------------------------
...@@ -65,11 +70,15 @@ void NamedStoreHandlerCompiler::GenerateStoreViaSetter( ...@@ -65,11 +70,15 @@ void NamedStoreHandlerCompiler::GenerateStoreViaSetter(
__ push(value()); __ push(value());
if (accessor_index >= 0) { if (accessor_index >= 0) {
DCHECK(!holder.is(scratch));
DCHECK(!receiver.is(scratch));
DCHECK(!value().is(scratch));
// Call the JavaScript setter with receiver and value on the stack. // Call the JavaScript setter with receiver and value on the stack.
if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) {
// Swap in the global receiver. // Swap in the global receiver.
__ ld(receiver, __ ld(scratch,
FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset));
receiver = scratch;
} }
__ Push(receiver, value()); __ Push(receiver, value());
ParameterCount actual(1); ParameterCount actual(1);
......
...@@ -214,7 +214,8 @@ void PropertyHandlerCompiler::GenerateCheckPropertyCell( ...@@ -214,7 +214,8 @@ void PropertyHandlerCompiler::GenerateCheckPropertyCell(
void NamedStoreHandlerCompiler::GenerateStoreViaSetter( void NamedStoreHandlerCompiler::GenerateStoreViaSetter(
MacroAssembler* masm, Handle<HeapType> type, Register receiver, MacroAssembler* masm, Handle<HeapType> type, Register receiver,
Register holder, int accessor_index, int expected_arguments) { Register holder, int accessor_index, int expected_arguments,
Register scratch) {
// ----------- S t a t e ------------- // ----------- S t a t e -------------
// -- rsp[0] : return address // -- rsp[0] : return address
// ----------------------------------- // -----------------------------------
...@@ -225,11 +226,15 @@ void NamedStoreHandlerCompiler::GenerateStoreViaSetter( ...@@ -225,11 +226,15 @@ void NamedStoreHandlerCompiler::GenerateStoreViaSetter(
__ Push(value()); __ Push(value());
if (accessor_index >= 0) { if (accessor_index >= 0) {
DCHECK(!holder.is(scratch));
DCHECK(!receiver.is(scratch));
DCHECK(!value().is(scratch));
// Call the JavaScript setter with receiver and value on the stack. // Call the JavaScript setter with receiver and value on the stack.
if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) {
// Swap in the global receiver. // Swap in the global receiver.
__ movp(receiver, __ movp(scratch,
FieldOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); FieldOperand(receiver, JSGlobalObject::kGlobalProxyOffset));
receiver = scratch;
} }
__ Push(receiver); __ Push(receiver);
__ Push(value()); __ Push(value());
...@@ -256,7 +261,8 @@ void NamedStoreHandlerCompiler::GenerateStoreViaSetter( ...@@ -256,7 +261,8 @@ void NamedStoreHandlerCompiler::GenerateStoreViaSetter(
void NamedLoadHandlerCompiler::GenerateLoadViaGetter( void NamedLoadHandlerCompiler::GenerateLoadViaGetter(
MacroAssembler* masm, Handle<HeapType> type, Register receiver, MacroAssembler* masm, Handle<HeapType> type, Register receiver,
Register holder, int accessor_index, int expected_arguments) { Register holder, int accessor_index, int expected_arguments,
Register scratch) {
// ----------- S t a t e ------------- // ----------- S t a t e -------------
// -- rax : receiver // -- rax : receiver
// -- rcx : name // -- rcx : name
...@@ -266,11 +272,14 @@ void NamedLoadHandlerCompiler::GenerateLoadViaGetter( ...@@ -266,11 +272,14 @@ void NamedLoadHandlerCompiler::GenerateLoadViaGetter(
FrameScope scope(masm, StackFrame::INTERNAL); FrameScope scope(masm, StackFrame::INTERNAL);
if (accessor_index >= 0) { if (accessor_index >= 0) {
DCHECK(!holder.is(scratch));
DCHECK(!receiver.is(scratch));
// Call the JavaScript getter with the receiver on the stack. // Call the JavaScript getter with the receiver on the stack.
if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) {
// Swap in the global receiver. // Swap in the global receiver.
__ movp(receiver, __ movp(scratch,
FieldOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); FieldOperand(receiver, JSGlobalObject::kGlobalProxyOffset));
receiver = scratch;
} }
__ Push(receiver); __ Push(receiver);
ParameterCount actual(0); ParameterCount actual(0);
......
...@@ -18,16 +18,20 @@ namespace internal { ...@@ -18,16 +18,20 @@ namespace internal {
void NamedLoadHandlerCompiler::GenerateLoadViaGetter( void NamedLoadHandlerCompiler::GenerateLoadViaGetter(
MacroAssembler* masm, Handle<HeapType> type, Register receiver, MacroAssembler* masm, Handle<HeapType> type, Register receiver,
Register holder, int accessor_index, int expected_arguments) { Register holder, int accessor_index, int expected_arguments,
Register scratch) {
{ {
FrameScope scope(masm, StackFrame::INTERNAL); FrameScope scope(masm, StackFrame::INTERNAL);
if (accessor_index >= 0) { if (accessor_index >= 0) {
DCHECK(!holder.is(scratch));
DCHECK(!receiver.is(scratch));
// Call the JavaScript getter with the receiver on the stack. // Call the JavaScript getter with the receiver on the stack.
if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) {
// Swap in the global receiver. // Swap in the global receiver.
__ mov(receiver, __ mov(scratch,
FieldOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); FieldOperand(receiver, JSGlobalObject::kGlobalProxyOffset));
receiver = scratch;
} }
__ push(receiver); __ push(receiver);
ParameterCount actual(0); ParameterCount actual(0);
...@@ -231,7 +235,8 @@ void PropertyHandlerCompiler::GenerateCheckPropertyCell( ...@@ -231,7 +235,8 @@ void PropertyHandlerCompiler::GenerateCheckPropertyCell(
void NamedStoreHandlerCompiler::GenerateStoreViaSetter( void NamedStoreHandlerCompiler::GenerateStoreViaSetter(
MacroAssembler* masm, Handle<HeapType> type, Register receiver, MacroAssembler* masm, Handle<HeapType> type, Register receiver,
Register holder, int accessor_index, int expected_arguments) { Register holder, int accessor_index, int expected_arguments,
Register scratch) {
// ----------- S t a t e ------------- // ----------- S t a t e -------------
// -- esp[0] : return address // -- esp[0] : return address
// ----------------------------------- // -----------------------------------
...@@ -242,11 +247,15 @@ void NamedStoreHandlerCompiler::GenerateStoreViaSetter( ...@@ -242,11 +247,15 @@ void NamedStoreHandlerCompiler::GenerateStoreViaSetter(
__ push(value()); __ push(value());
if (accessor_index >= 0) { if (accessor_index >= 0) {
DCHECK(!holder.is(scratch));
DCHECK(!receiver.is(scratch));
DCHECK(!value().is(scratch));
// Call the JavaScript setter with receiver and value on the stack. // Call the JavaScript setter with receiver and value on the stack.
if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) {
// Swap in the global receiver. // Swap in the global receiver.
__ mov(receiver, __ mov(scratch,
FieldOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); FieldOperand(receiver, JSGlobalObject::kGlobalProxyOffset));
receiver = scratch;
} }
__ push(receiver); __ push(receiver);
__ push(value()); __ push(value());
......
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