PPC: Cross-script variables handling fixed. It was possible to write to read-only global variable.

Port 156042f7f7

R=ishell@chromium.org, dstence@us.ibm.com, michael_dawson@ca.ibm.com
BUG=

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

Cr-Commit-Position: refs/heads/master@{#29880}
This commit is contained in:
mbrandy 2015-07-27 11:01:22 -07:00 committed by Commit bot
parent b8adca9668
commit ee70ad1be7

View File

@ -5377,6 +5377,11 @@ void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) {
__ add(cell, context, r0);
__ LoadP(cell, ContextOperand(cell));
// Check that cell value is not the_hole.
__ LoadP(cell_value, FieldMemOperand(cell, PropertyCell::kValueOffset));
__ CompareRoot(cell_value, Heap::kTheHoleValueRootIndex);
__ beq(&slow_case);
// Load PropertyDetails for the cell (actually only the cell_type and kind).
__ LoadP(cell_details, FieldMemOperand(cell, PropertyCell::kDetailsOffset));
__ SmiUntag(cell_details);
@ -5406,7 +5411,6 @@ void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) {
// Check if PropertyCell value matches the new value (relevant for Constant,
// ConstantType and Undefined cells).
Label not_same_value;
__ LoadP(cell_value, FieldMemOperand(cell, PropertyCell::kValueOffset));
__ cmp(cell_value, value);
__ bne(&not_same_value);