Reviewers: mvstanton,
Message:
Thank you for finding this leak, Michael! PTAL at fix.
Description:
Use weak cell in LoadGlobal handler.
BUG=v8:3629
LOG=N
Please review this at https://codereview.chromium.org/816923004/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+14, -16 lines):
M src/ic/arm/handler-compiler-arm.cc
M src/ic/arm64/handler-compiler-arm64.cc
M src/ic/ia32/handler-compiler-ia32.cc
M src/ic/mips/handler-compiler-mips.cc
M src/ic/x64/handler-compiler-x64.cc
M src/ic/x87/handler-compiler-x87.cc
Index: src/ic/arm/handler-compiler-arm.cc
diff --git a/src/ic/arm/handler-compiler-arm.cc
b/src/ic/arm/handler-compiler-arm.cc
index
3b8f10e634b1487c794b8aae194ac7596c889024..9905e4eb7de75b4b38f659e91f58df62e3f53362
100644
--- a/src/ic/arm/handler-compiler-arm.cc
+++ b/src/ic/arm/handler-compiler-arm.cc
@@ -704,7 +704,8 @@ Handle<Code>
NamedLoadHandlerCompiler::CompileLoadGlobal(
// Get the value from the cell.
Register result = StoreDescriptor::ValueRegister();
- __ mov(result, Operand(cell));
+ Handle<WeakCell> weak_cell = factory()->NewWeakCell(cell);
+ __ LoadWeakValue(result, weak_cell, &miss);
__ ldr(result, FieldMemOperand(result, Cell::kValueOffset));
// Check for deleted property if property can actually be deleted.
Index: src/ic/arm64/handler-compiler-arm64.cc
diff --git a/src/ic/arm64/handler-compiler-arm64.cc
b/src/ic/arm64/handler-compiler-arm64.cc
index
bf9035bb9e4a67e8d16aed0a9a898ff840e3e3db..1c28bf51a215ac265a891e37b6cae695efe9d147
100644
--- a/src/ic/arm64/handler-compiler-arm64.cc
+++ b/src/ic/arm64/handler-compiler-arm64.cc
@@ -334,7 +334,8 @@ Handle<Code>
NamedLoadHandlerCompiler::CompileLoadGlobal(
// Get the value from the cell.
Register result = StoreDescriptor::ValueRegister();
- __ Mov(result, Operand(cell));
+ Handle<WeakCell> weak_cell = factory()->NewWeakCell(cell);
+ __ LoadWeakValue(result, weak_cell, &miss);
__ Ldr(result, FieldMemOperand(result, Cell::kValueOffset));
// Check for deleted property if property can actually be deleted.
Index: src/ic/ia32/handler-compiler-ia32.cc
diff --git a/src/ic/ia32/handler-compiler-ia32.cc
b/src/ic/ia32/handler-compiler-ia32.cc
index
f02731e4c20c47002595be341656e80dcc74ef06..90512e9bc8797514b401d0cbe0d32e4b2c98a853
100644
--- a/src/ic/ia32/handler-compiler-ia32.cc
+++ b/src/ic/ia32/handler-compiler-ia32.cc
@@ -724,12 +724,9 @@ Handle<Code>
NamedLoadHandlerCompiler::CompileLoadGlobal(
FrontendHeader(receiver(), name, &miss);
// Get the value from the cell.
Register result = StoreDescriptor::ValueRegister();
- if (masm()->serializer_enabled()) {
- __ mov(result, Immediate(cell));
- __ mov(result, FieldOperand(result, PropertyCell::kValueOffset));
- } else {
- __ mov(result, Operand::ForCell(cell));
- }
+ Handle<WeakCell> weak_cell = factory()->NewWeakCell(cell);
+ __ LoadWeakValue(result, weak_cell, &miss);
+ __ mov(result, FieldOperand(result, PropertyCell::kValueOffset));
// Check for deleted property if property can actually be deleted.
if (is_configurable) {
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
e058876442519d597d4db05d1edc2ec7e59ef3fa..75032e1915c59bbe202b7873e8b648bdf5a5cfaf
100644
--- a/src/ic/mips/handler-compiler-mips.cc
+++ b/src/ic/mips/handler-compiler-mips.cc
@@ -701,7 +701,8 @@ Handle<Code>
NamedLoadHandlerCompiler::CompileLoadGlobal(
// Get the value from the cell.
Register result = StoreDescriptor::ValueRegister();
- __ li(result, Operand(cell));
+ Handle<WeakCell> weak_cell = factory()->NewWeakCell(cell);
+ __ LoadWeakValue(result, weak_cell, &miss);
__ lw(result, FieldMemOperand(result, Cell::kValueOffset));
// Check for deleted property if property can actually be deleted.
Index: src/ic/x64/handler-compiler-x64.cc
diff --git a/src/ic/x64/handler-compiler-x64.cc
b/src/ic/x64/handler-compiler-x64.cc
index
c545c7e2c4edf6117f353b2727ebceabc4794843..46fa8cc337139fa0089a14b2c79e7b22a6161ed8
100644
--- a/src/ic/x64/handler-compiler-x64.cc
+++ b/src/ic/x64/handler-compiler-x64.cc
@@ -712,7 +712,8 @@ Handle<Code>
NamedLoadHandlerCompiler::CompileLoadGlobal(
// Get the value from the cell.
Register result = StoreDescriptor::ValueRegister();
- __ Move(result, cell);
+ Handle<WeakCell> weak_cell = factory()->NewWeakCell(cell);
+ __ LoadWeakValue(result, weak_cell, &miss);
__ movp(result, FieldOperand(result, PropertyCell::kValueOffset));
// Check for deleted property if property can actually be deleted.
Index: src/ic/x87/handler-compiler-x87.cc
diff --git a/src/ic/x87/handler-compiler-x87.cc
b/src/ic/x87/handler-compiler-x87.cc
index
db388d8e283a6312fdbcbbebff97041d8d8e602e..2ff35954c89a95e3e13815de1c0c718d5d247623
100644
--- a/src/ic/x87/handler-compiler-x87.cc
+++ b/src/ic/x87/handler-compiler-x87.cc
@@ -724,12 +724,9 @@ Handle<Code>
NamedLoadHandlerCompiler::CompileLoadGlobal(
FrontendHeader(receiver(), name, &miss);
// Get the value from the cell.
Register result = StoreDescriptor::ValueRegister();
- if (masm()->serializer_enabled()) {
- __ mov(result, Immediate(cell));
- __ mov(result, FieldOperand(result, PropertyCell::kValueOffset));
- } else {
- __ mov(result, Operand::ForCell(cell));
- }
+ Handle<WeakCell> weak_cell = factory()->NewWeakCell(cell);
+ __ LoadWeakValue(result, weak_cell, &miss);
+ __ mov(result, FieldOperand(result, PropertyCell::kValueOffset));
// Check for deleted property if property can actually be deleted.
if (is_configurable) {
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.