Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Unified Diff: src/ic/mips64/handler-compiler-mips64.cc

Issue 877343003: Fix register aliasing after r26306, r26275. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Assertions Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/ic/mips64/handler-compiler-mips64.cc
diff --git a/src/ic/mips64/handler-compiler-mips64.cc b/src/ic/mips64/handler-compiler-mips64.cc
index 14a9161075d6724856c01616b11e86936993af0c..7479aac967190829521ce1c203f08e67fc2bad82 100644
--- a/src/ic/mips64/handler-compiler-mips64.cc
+++ b/src/ic/mips64/handler-compiler-mips64.cc
@@ -18,7 +18,8 @@ namespace internal {
void NamedLoadHandlerCompiler::GenerateLoadViaGetter(
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 -------------
// -- a0 : receiver
// -- a2 : name
@@ -28,11 +29,15 @@ void NamedLoadHandlerCompiler::GenerateLoadViaGetter(
FrameScope scope(masm, StackFrame::INTERNAL);
if (accessor_index >= 0) {
+ DCHECK(!holder.is(scratch));
+ DCHECK(!receiver.is(scratch));
// Call the JavaScript getter with the receiver on the stack.
if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) {
// Swap in the global receiver.
- __ ld(receiver,
+ // Do not overwrite receiver register, it can alias to holder register.
+ __ ld(scratch,
FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset));
+ receiver = scratch;
}
__ push(receiver);
ParameterCount actual(0);
@@ -54,7 +59,8 @@ void NamedLoadHandlerCompiler::GenerateLoadViaGetter(
void NamedStoreHandlerCompiler::GenerateStoreViaSetter(
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 -------------
// -- ra : return address
// -----------------------------------
@@ -65,11 +71,16 @@ void NamedStoreHandlerCompiler::GenerateStoreViaSetter(
__ push(value());
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.
if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) {
// Swap in the global receiver.
- __ ld(receiver,
+ // Do not overwrite receiver register, it can alias to holder register.
+ __ ld(scratch,
FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset));
+ receiver = scratch;
}
__ Push(receiver, value());
ParameterCount actual(1);

Powered by Google App Engine
This is Rietveld 408576698