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

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

Issue 877243004: Load callback data from weak cell instead of embedding it in handler. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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
« no previous file with comments | « src/ic/ia32/handler-compiler-ia32.cc ('k') | src/ic/mips64/handler-compiler-mips64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic/mips/handler-compiler-mips.cc
diff --git a/src/ic/mips/handler-compiler-mips.cc b/src/ic/mips/handler-compiler-mips.cc
index 6e2903d428fd0131ffb3c1be8244d0b7f02630e1..ba81dfe3a05b82320305e9adee4f1454b20e90dd 100644
--- a/src/ic/mips/handler-compiler-mips.cc
+++ b/src/ic/mips/handler-compiler-mips.cc
@@ -559,12 +559,15 @@ void NamedLoadHandlerCompiler::GenerateLoadCallback(
DCHECK(!scratch3().is(reg));
DCHECK(!scratch4().is(reg));
__ push(receiver());
- if (heap()->InNewSpace(callback->data())) {
- __ li(scratch3(), callback);
- __ lw(scratch3(),
- FieldMemOperand(scratch3(), ExecutableAccessorInfo::kDataOffset));
+ Handle<Object> data(callback->data(), isolate());
+ if (data->IsUndefined() || data->IsSmi()) {
+ __ li(scratch3(), data);
} else {
- __ li(scratch3(), Handle<Object>(callback->data(), isolate()));
+ Handle<WeakCell> cell =
+ isolate()->factory()->NewWeakCell(Handle<HeapObject>::cast(data));
+ // The callback is alive if this instruction is executed,
+ // so the weak cell is not cleared and points to data.
+ __ GetWeakValue(scratch3(), cell);
}
__ Subu(sp, sp, 6 * kPointerSize);
__ sw(scratch3(), MemOperand(sp, 5 * kPointerSize));
« no previous file with comments | « src/ic/ia32/handler-compiler-ia32.cc ('k') | src/ic/mips64/handler-compiler-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698