Index: src/x64/code-stubs-x64.cc |
diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc |
index 773e3a48cd0dadf3fd7d8e08b870a3d2c34a3fc9..a238629bc52fb67fcb11d361411af6209ee2daea 100644 |
--- a/src/x64/code-stubs-x64.cc |
+++ b/src/x64/code-stubs-x64.cc |
@@ -4273,129 +4273,6 @@ void FastNewStrictArgumentsStub::Generate(MacroAssembler* masm) { |
} |
-void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) { |
- Register context_reg = rsi; |
- Register slot_reg = rbx; |
- Register value_reg = rax; |
- Register cell_reg = r8; |
- Register cell_details_reg = rdx; |
- Register cell_value_reg = r9; |
- Label fast_heapobject_case, fast_smi_case, slow_case; |
- |
- if (FLAG_debug_code) { |
- __ CompareRoot(value_reg, Heap::kTheHoleValueRootIndex); |
- __ Check(not_equal, kUnexpectedValue); |
- } |
- |
- // Go up context chain to the script context. |
- for (int i = 0; i < depth(); ++i) { |
- __ movp(rdi, ContextOperand(context_reg, Context::PREVIOUS_INDEX)); |
- context_reg = rdi; |
- } |
- |
- // Load the PropertyCell at the specified slot. |
- __ movp(cell_reg, ContextOperand(context_reg, slot_reg)); |
- |
- // Load PropertyDetails for the cell (actually only the cell_type, kind and |
- // READ_ONLY bit of attributes). |
- __ SmiToInteger32(cell_details_reg, |
- FieldOperand(cell_reg, PropertyCell::kDetailsOffset)); |
- __ andl(cell_details_reg, |
- Immediate(PropertyDetails::PropertyCellTypeField::kMask | |
- PropertyDetails::KindField::kMask | |
- PropertyDetails::kAttributesReadOnlyMask)); |
- |
- // Check if PropertyCell holds mutable data. |
- Label not_mutable_data; |
- __ cmpl(cell_details_reg, |
- Immediate(PropertyDetails::PropertyCellTypeField::encode( |
- PropertyCellType::kMutable) | |
- PropertyDetails::KindField::encode(kData))); |
- __ j(not_equal, ¬_mutable_data); |
- __ JumpIfSmi(value_reg, &fast_smi_case); |
- __ bind(&fast_heapobject_case); |
- __ movp(FieldOperand(cell_reg, PropertyCell::kValueOffset), value_reg); |
- __ RecordWriteField(cell_reg, PropertyCell::kValueOffset, value_reg, |
- cell_value_reg, kDontSaveFPRegs, EMIT_REMEMBERED_SET, |
- OMIT_SMI_CHECK); |
- // RecordWriteField clobbers the value register, so we need to reload. |
- __ movp(value_reg, FieldOperand(cell_reg, PropertyCell::kValueOffset)); |
- __ Ret(); |
- __ bind(¬_mutable_data); |
- |
- // Check if PropertyCell value matches the new value (relevant for Constant, |
- // ConstantType and Undefined cells). |
- Label not_same_value; |
- __ movp(cell_value_reg, FieldOperand(cell_reg, PropertyCell::kValueOffset)); |
- __ cmpp(cell_value_reg, value_reg); |
- __ j(not_equal, ¬_same_value, |
- FLAG_debug_code ? Label::kFar : Label::kNear); |
- // Make sure the PropertyCell is not marked READ_ONLY. |
- __ testl(cell_details_reg, |
- Immediate(PropertyDetails::kAttributesReadOnlyMask)); |
- __ j(not_zero, &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. |
- __ cmpl(cell_details_reg, |
- Immediate(PropertyDetails::PropertyCellTypeField::encode( |
- PropertyCellType::kConstant) | |
- PropertyDetails::KindField::encode(kData))); |
- __ j(equal, &done); |
- __ cmpl(cell_details_reg, |
- Immediate(PropertyDetails::PropertyCellTypeField::encode( |
- PropertyCellType::kConstantType) | |
- PropertyDetails::KindField::encode(kData))); |
- __ j(equal, &done); |
- __ cmpl(cell_details_reg, |
- Immediate(PropertyDetails::PropertyCellTypeField::encode( |
- PropertyCellType::kUndefined) | |
- PropertyDetails::KindField::encode(kData))); |
- __ Check(equal, kUnexpectedValue); |
- __ bind(&done); |
- } |
- __ Ret(); |
- __ bind(¬_same_value); |
- |
- // Check if PropertyCell contains data with constant type (and is not |
- // READ_ONLY). |
- __ cmpl(cell_details_reg, |
- Immediate(PropertyDetails::PropertyCellTypeField::encode( |
- PropertyCellType::kConstantType) | |
- PropertyDetails::KindField::encode(kData))); |
- __ j(not_equal, &slow_case, Label::kNear); |
- |
- // 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_reg, &value_is_heap_object, Label::kNear); |
- __ JumpIfNotSmi(cell_value_reg, &slow_case, Label::kNear); |
- // Old and new values are SMIs, no need for a write barrier here. |
- __ bind(&fast_smi_case); |
- __ movp(FieldOperand(cell_reg, PropertyCell::kValueOffset), value_reg); |
- __ Ret(); |
- __ bind(&value_is_heap_object); |
- __ JumpIfSmi(cell_value_reg, &slow_case, Label::kNear); |
- Register cell_value_map_reg = cell_value_reg; |
- __ movp(cell_value_map_reg, |
- FieldOperand(cell_value_reg, HeapObject::kMapOffset)); |
- __ cmpp(cell_value_map_reg, FieldOperand(value_reg, HeapObject::kMapOffset)); |
- __ j(equal, &fast_heapobject_case); |
- |
- // Fallback to the runtime. |
- __ bind(&slow_case); |
- __ Integer32ToSmi(slot_reg, slot_reg); |
- __ PopReturnAddressTo(kScratchRegister); |
- __ Push(slot_reg); |
- __ Push(value_reg); |
- __ Push(kScratchRegister); |
- __ TailCallRuntime(is_strict(language_mode()) |
- ? Runtime::kStoreGlobalViaContext_Strict |
- : Runtime::kStoreGlobalViaContext_Sloppy); |
-} |
- |
- |
static int Offset(ExternalReference ref0, ExternalReference ref1) { |
int64_t offset = (ref0.address() - ref1.address()); |
// Check that fits into int. |