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

Unified Diff: src/mips64/code-stubs-mips64.cc

Issue 1255133002: [stubs] Properly handle read-only properties in StoreGlobalViaContextStub. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE Created 5 years, 5 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/mips/code-stubs-mips.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips64/code-stubs-mips64.cc
diff --git a/src/mips64/code-stubs-mips64.cc b/src/mips64/code-stubs-mips64.cc
index 20cae9554b54429451e03ef5d8739b55fc51e8e6..fdbae1f66b254313d42c152e9285c749737e2b1d 100644
--- a/src/mips64/code-stubs-mips64.cc
+++ b/src/mips64/code-stubs-mips64.cc
@@ -5362,18 +5362,14 @@ void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) {
__ Daddu(at, at, Context::SlotOffset(0));
__ ld(cell_reg, MemOperand(at));
- // Check that cell value is not the_hole.
- __ ld(cell_value_reg, FieldMemOperand(cell_reg, PropertyCell::kValueOffset));
- __ LoadRoot(at, Heap::kTheHoleValueRootIndex);
- __ Branch(&slow_case, eq, cell_value_reg, Operand(at));
-
// Load PropertyDetails for the cell (actually only the cell_type and kind).
__ ld(cell_details_reg,
FieldMemOperand(cell_reg, PropertyCell::kDetailsOffset));
__ SmiUntag(cell_details_reg);
__ And(cell_details_reg, cell_details_reg,
PropertyDetails::PropertyCellTypeField::kMask |
- PropertyDetails::KindField::kMask);
+ PropertyDetails::KindField::kMask |
+ PropertyDetails::kAttributesReadOnlyMask);
// Check if PropertyCell holds mutable data.
Label not_mutable_data;
@@ -5395,7 +5391,11 @@ void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) {
// Check if PropertyCell value matches the new value (relevant for Constant,
// ConstantType and Undefined cells).
Label not_same_value;
+ __ ld(cell_value_reg, FieldMemOperand(cell_reg, PropertyCell::kValueOffset));
__ Branch(&not_same_value, ne, value_reg, Operand(cell_value_reg));
+ // Make sure the PropertyCell is not marked READ_ONLY.
+ __ And(at, cell_details_reg, PropertyDetails::kAttributesReadOnlyMask);
+ __ Branch(&slow_case, ne, at, Operand(zero_reg));
if (FLAG_debug_code) {
Label done;
// This can only be true for Constant, ConstantType and Undefined cells,
@@ -5417,7 +5417,8 @@ void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) {
__ Ret();
__ bind(&not_same_value);
- // Check if PropertyCell contains data with constant type.
+ // Check if PropertyCell contains data with constant type (and is not
+ // READ_ONLY).
__ Branch(&slow_case, ne, cell_details_reg,
Operand(PropertyDetails::PropertyCellTypeField::encode(
PropertyCellType::kConstantType) |
« no previous file with comments | « src/mips/code-stubs-mips.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698