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

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

Issue 2412613004: [stubs] Remove unused StoreGlobalViaContextStub. (Closed)
Patch Set: Created 4 years, 2 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/runtime/runtime-object.cc ('k') | src/s390/interface-descriptors-s390.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/s390/code-stubs-s390.cc
diff --git a/src/s390/code-stubs-s390.cc b/src/s390/code-stubs-s390.cc
index 146bc86a6cc9165eef229226e48f2cdf1584ed82..0d6ad63966e0e2618eb9baccefde92da54c64ed0 100644
--- a/src/s390/code-stubs-s390.cc
+++ b/src/s390/code-stubs-s390.cc
@@ -4498,133 +4498,6 @@ void FastNewStrictArgumentsStub::Generate(MacroAssembler* masm) {
__ TailCallRuntime(Runtime::kNewStrictArguments);
}
-void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) {
- Register value = r2;
- Register slot = r4;
-
- Register cell = r3;
- Register cell_details = r5;
- Register cell_value = r6;
- Register cell_value_map = r7;
- Register scratch = r8;
-
- Register context = cp;
- Register context_temp = cell;
-
- 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++) {
- __ LoadP(context_temp, ContextMemOperand(context, Context::PREVIOUS_INDEX));
- context = context_temp;
- }
-
- // Load the PropertyCell at the specified slot.
- __ ShiftLeftP(r0, slot, Operand(kPointerSizeLog2));
- __ AddP(cell, context, r0);
- __ LoadP(cell, ContextMemOperand(cell));
-
- // Load PropertyDetails for the cell (actually only the cell_type and kind).
- __ LoadP(cell_details, FieldMemOperand(cell, PropertyCell::kDetailsOffset));
- __ SmiUntag(cell_details);
- __ AndP(cell_details, cell_details,
- Operand(PropertyDetails::PropertyCellTypeField::kMask |
- PropertyDetails::KindField::kMask |
- PropertyDetails::kAttributesReadOnlyMask));
-
- // Check if PropertyCell holds mutable data.
- Label not_mutable_data;
- __ CmpP(cell_details, Operand(PropertyDetails::PropertyCellTypeField::encode(
- PropertyCellType::kMutable) |
- PropertyDetails::KindField::encode(kData)));
- __ bne(&not_mutable_data);
- __ JumpIfSmi(value, &fast_smi_case);
-
- __ bind(&fast_heapobject_case);
- __ StoreP(value, FieldMemOperand(cell, PropertyCell::kValueOffset), r0);
- // RecordWriteField clobbers the value register, so we copy it before the
- // call.
- __ LoadRR(r5, value);
- __ RecordWriteField(cell, PropertyCell::kValueOffset, r5, scratch,
- kLRHasNotBeenSaved, kDontSaveFPRegs, EMIT_REMEMBERED_SET,
- OMIT_SMI_CHECK);
- __ Ret();
-
- __ bind(&not_mutable_data);
- // 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));
- __ CmpP(cell_value, value);
- __ bne(&not_same_value);
-
- // Make sure the PropertyCell is not marked READ_ONLY.
- __ AndP(r0, cell_details, Operand(PropertyDetails::kAttributesReadOnlyMask));
- __ bne(&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.
- __ CmpP(cell_details,
- Operand(PropertyDetails::PropertyCellTypeField::encode(
- PropertyCellType::kConstant) |
- PropertyDetails::KindField::encode(kData)));
- __ beq(&done);
- __ CmpP(cell_details,
- Operand(PropertyDetails::PropertyCellTypeField::encode(
- PropertyCellType::kConstantType) |
- PropertyDetails::KindField::encode(kData)));
- __ beq(&done);
- __ CmpP(cell_details,
- Operand(PropertyDetails::PropertyCellTypeField::encode(
- PropertyCellType::kUndefined) |
- PropertyDetails::KindField::encode(kData)));
- __ Check(eq, kUnexpectedValue);
- __ bind(&done);
- }
- __ Ret();
- __ bind(&not_same_value);
-
- // Check if PropertyCell contains data with constant type (and is not
- // READ_ONLY).
- __ CmpP(cell_details, Operand(PropertyDetails::PropertyCellTypeField::encode(
- PropertyCellType::kConstantType) |
- PropertyDetails::KindField::encode(kData)));
- __ bne(&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);
- __ StoreP(value, FieldMemOperand(cell, PropertyCell::kValueOffset), r0);
- __ Ret();
-
- __ bind(&value_is_heap_object);
- __ JumpIfSmi(cell_value, &slow_case);
-
- __ LoadP(cell_value_map, FieldMemOperand(cell_value, HeapObject::kMapOffset));
- __ LoadP(scratch, FieldMemOperand(value, HeapObject::kMapOffset));
- __ CmpP(cell_value_map, scratch);
- __ beq(&fast_heapobject_case);
-
- // Fallback to runtime.
- __ bind(&slow_case);
- __ SmiTag(slot);
- __ Push(slot, value);
- __ TailCallRuntime(is_strict(language_mode())
- ? Runtime::kStoreGlobalViaContext_Strict
- : Runtime::kStoreGlobalViaContext_Sloppy);
-}
-
static int AddressOffset(ExternalReference ref0, ExternalReference ref1) {
return ref0.address() - ref1.address();
}
« no previous file with comments | « src/runtime/runtime-object.cc ('k') | src/s390/interface-descriptors-s390.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698