Index: src/arm64/code-stubs-arm64.cc |
diff --git a/src/arm64/code-stubs-arm64.cc b/src/arm64/code-stubs-arm64.cc |
index 09eeac7ccabd6ca2abc51d074770d16c155a8ead..0cdac1f5aeab65f7adea409ec60f9dd7f1a10fb6 100644 |
--- a/src/arm64/code-stubs-arm64.cc |
+++ b/src/arm64/code-stubs-arm64.cc |
@@ -4676,126 +4676,6 @@ void FastNewStrictArgumentsStub::Generate(MacroAssembler* masm) { |
} |
-void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) { |
- Register context = cp; |
- Register value = x0; |
- Register slot = x2; |
- Register context_temp = x10; |
- Register cell = x10; |
- Register cell_details = x11; |
- Register cell_value = x12; |
- Register cell_value_map = x13; |
- Register value_map = x14; |
- Label fast_heapobject_case, fast_smi_case, slow_case; |
- |
- if (FLAG_debug_code) { |
- __ CompareRoot(value, Heap::kTheHoleValueRootIndex); |
- __ Check(ne, kUnexpectedValue); |
- } |
- |
- // Go up the context chain to the script context. |
- for (int i = 0; i < depth(); i++) { |
- __ Ldr(context_temp, ContextMemOperand(context, Context::PREVIOUS_INDEX)); |
- context = context_temp; |
- } |
- |
- // Load the PropertyCell at the specified slot. |
- __ Add(cell, context, Operand(slot, LSL, kPointerSizeLog2)); |
- __ Ldr(cell, ContextMemOperand(cell)); |
- |
- // Load PropertyDetails for the cell (actually only the cell_type and kind). |
- __ Ldr(cell_details, |
- UntagSmiFieldMemOperand(cell, PropertyCell::kDetailsOffset)); |
- __ And(cell_details, cell_details, |
- PropertyDetails::PropertyCellTypeField::kMask | |
- PropertyDetails::KindField::kMask | |
- PropertyDetails::kAttributesReadOnlyMask); |
- |
- // Check if PropertyCell holds mutable data. |
- Label not_mutable_data; |
- __ Cmp(cell_details, PropertyDetails::PropertyCellTypeField::encode( |
- PropertyCellType::kMutable) | |
- PropertyDetails::KindField::encode(kData)); |
- __ B(ne, ¬_mutable_data); |
- __ JumpIfSmi(value, &fast_smi_case); |
- __ Bind(&fast_heapobject_case); |
- __ Str(value, FieldMemOperand(cell, PropertyCell::kValueOffset)); |
- // RecordWriteField clobbers the value register, so we copy it before the |
- // call. |
- __ Mov(x11, value); |
- __ RecordWriteField(cell, PropertyCell::kValueOffset, x11, x12, |
- kLRHasNotBeenSaved, kDontSaveFPRegs, EMIT_REMEMBERED_SET, |
- OMIT_SMI_CHECK); |
- __ Ret(); |
- |
- __ Bind(¬_mutable_data); |
- // Check if PropertyCell value matches the new value (relevant for Constant, |
- // ConstantType and Undefined cells). |
- Label not_same_value; |
- __ Ldr(cell_value, FieldMemOperand(cell, PropertyCell::kValueOffset)); |
- __ Cmp(cell_value, value); |
- __ B(ne, ¬_same_value); |
- |
- // Make sure the PropertyCell is not marked READ_ONLY. |
- __ Tst(cell_details, PropertyDetails::kAttributesReadOnlyMask); |
- __ B(ne, &slow_case); |
- |
- if (FLAG_debug_code) { |
- Label done; |
- // This can only be true for Constant, ConstantType and Undefined cells, |
- // because we never store the_hole via this stub. |
- __ Cmp(cell_details, PropertyDetails::PropertyCellTypeField::encode( |
- PropertyCellType::kConstant) | |
- PropertyDetails::KindField::encode(kData)); |
- __ B(eq, &done); |
- __ Cmp(cell_details, PropertyDetails::PropertyCellTypeField::encode( |
- PropertyCellType::kConstantType) | |
- PropertyDetails::KindField::encode(kData)); |
- __ B(eq, &done); |
- __ Cmp(cell_details, PropertyDetails::PropertyCellTypeField::encode( |
- PropertyCellType::kUndefined) | |
- PropertyDetails::KindField::encode(kData)); |
- __ Check(eq, kUnexpectedValue); |
- __ Bind(&done); |
- } |
- __ Ret(); |
- __ Bind(¬_same_value); |
- |
- // Check if PropertyCell contains data with constant type (and is not |
- // READ_ONLY). |
- __ Cmp(cell_details, PropertyDetails::PropertyCellTypeField::encode( |
- PropertyCellType::kConstantType) | |
- PropertyDetails::KindField::encode(kData)); |
- __ B(ne, &slow_case); |
- |
- // Now either both old and new values must be smis or both must be heap |
- // objects with same map. |
- Label value_is_heap_object; |
- __ JumpIfNotSmi(value, &value_is_heap_object); |
- __ JumpIfNotSmi(cell_value, &slow_case); |
- // Old and new values are smis, no need for a write barrier here. |
- __ Bind(&fast_smi_case); |
- __ Str(value, FieldMemOperand(cell, PropertyCell::kValueOffset)); |
- __ Ret(); |
- |
- __ Bind(&value_is_heap_object); |
- __ JumpIfSmi(cell_value, &slow_case); |
- |
- __ Ldr(cell_value_map, FieldMemOperand(cell_value, HeapObject::kMapOffset)); |
- __ Ldr(value_map, FieldMemOperand(value, HeapObject::kMapOffset)); |
- __ Cmp(cell_value_map, value_map); |
- __ B(eq, &fast_heapobject_case); |
- |
- // Fall back to the runtime. |
- __ Bind(&slow_case); |
- __ SmiTag(slot); |
- __ Push(slot, value); |
- __ TailCallRuntime(is_strict(language_mode()) |
- ? Runtime::kStoreGlobalViaContext_Strict |
- : Runtime::kStoreGlobalViaContext_Sloppy); |
-} |
- |
- |
// The number of register that CallApiFunctionAndReturn will need to save on |
// the stack. The space for these registers need to be allocated in the |
// ExitFrame before calling CallApiFunctionAndReturn. |