OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_MIPS64 | 7 #if V8_TARGET_ARCH_MIPS64 |
8 | 8 |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 5344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5355 __ ld(cell_reg, ContextOperand(context_reg, Context::PREVIOUS_INDEX)); | 5355 __ ld(cell_reg, ContextOperand(context_reg, Context::PREVIOUS_INDEX)); |
5356 context_reg = cell_reg; | 5356 context_reg = cell_reg; |
5357 } | 5357 } |
5358 | 5358 |
5359 // Load the PropertyCell at the specified slot. | 5359 // Load the PropertyCell at the specified slot. |
5360 __ dsll(at, slot_reg, kPointerSizeLog2); | 5360 __ dsll(at, slot_reg, kPointerSizeLog2); |
5361 __ Daddu(at, at, Operand(context_reg)); | 5361 __ Daddu(at, at, Operand(context_reg)); |
5362 __ Daddu(at, at, Context::SlotOffset(0)); | 5362 __ Daddu(at, at, Context::SlotOffset(0)); |
5363 __ ld(cell_reg, MemOperand(at)); | 5363 __ ld(cell_reg, MemOperand(at)); |
5364 | 5364 |
5365 // Check that cell value is not the_hole. | |
5366 __ ld(cell_value_reg, FieldMemOperand(cell_reg, PropertyCell::kValueOffset)); | |
5367 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); | |
5368 __ Branch(&slow_case, eq, cell_value_reg, Operand(at)); | |
5369 | |
5370 // Load PropertyDetails for the cell (actually only the cell_type and kind). | 5365 // Load PropertyDetails for the cell (actually only the cell_type and kind). |
5371 __ ld(cell_details_reg, | 5366 __ ld(cell_details_reg, |
5372 FieldMemOperand(cell_reg, PropertyCell::kDetailsOffset)); | 5367 FieldMemOperand(cell_reg, PropertyCell::kDetailsOffset)); |
5373 __ SmiUntag(cell_details_reg); | 5368 __ SmiUntag(cell_details_reg); |
5374 __ And(cell_details_reg, cell_details_reg, | 5369 __ And(cell_details_reg, cell_details_reg, |
5375 PropertyDetails::PropertyCellTypeField::kMask | | 5370 PropertyDetails::PropertyCellTypeField::kMask | |
5376 PropertyDetails::KindField::kMask); | 5371 PropertyDetails::KindField::kMask | |
| 5372 PropertyDetails::kAttributesReadOnlyMask); |
5377 | 5373 |
5378 // Check if PropertyCell holds mutable data. | 5374 // Check if PropertyCell holds mutable data. |
5379 Label not_mutable_data; | 5375 Label not_mutable_data; |
5380 __ Branch(¬_mutable_data, ne, cell_details_reg, | 5376 __ Branch(¬_mutable_data, ne, cell_details_reg, |
5381 Operand(PropertyDetails::PropertyCellTypeField::encode( | 5377 Operand(PropertyDetails::PropertyCellTypeField::encode( |
5382 PropertyCellType::kMutable) | | 5378 PropertyCellType::kMutable) | |
5383 PropertyDetails::KindField::encode(kData))); | 5379 PropertyDetails::KindField::encode(kData))); |
5384 __ JumpIfSmi(value_reg, &fast_smi_case); | 5380 __ JumpIfSmi(value_reg, &fast_smi_case); |
5385 __ bind(&fast_heapobject_case); | 5381 __ bind(&fast_heapobject_case); |
5386 __ sd(value_reg, FieldMemOperand(cell_reg, PropertyCell::kValueOffset)); | 5382 __ sd(value_reg, FieldMemOperand(cell_reg, PropertyCell::kValueOffset)); |
5387 __ RecordWriteField(cell_reg, PropertyCell::kValueOffset, value_reg, | 5383 __ RecordWriteField(cell_reg, PropertyCell::kValueOffset, value_reg, |
5388 cell_details_reg, kRAHasNotBeenSaved, kDontSaveFPRegs, | 5384 cell_details_reg, kRAHasNotBeenSaved, kDontSaveFPRegs, |
5389 EMIT_REMEMBERED_SET, OMIT_SMI_CHECK); | 5385 EMIT_REMEMBERED_SET, OMIT_SMI_CHECK); |
5390 // RecordWriteField clobbers the value register, so we need to reload. | 5386 // RecordWriteField clobbers the value register, so we need to reload. |
5391 __ Ret(USE_DELAY_SLOT); | 5387 __ Ret(USE_DELAY_SLOT); |
5392 __ ld(value_reg, FieldMemOperand(cell_reg, PropertyCell::kValueOffset)); | 5388 __ ld(value_reg, FieldMemOperand(cell_reg, PropertyCell::kValueOffset)); |
5393 __ bind(¬_mutable_data); | 5389 __ bind(¬_mutable_data); |
5394 | 5390 |
5395 // Check if PropertyCell value matches the new value (relevant for Constant, | 5391 // Check if PropertyCell value matches the new value (relevant for Constant, |
5396 // ConstantType and Undefined cells). | 5392 // ConstantType and Undefined cells). |
5397 Label not_same_value; | 5393 Label not_same_value; |
| 5394 __ ld(cell_value_reg, FieldMemOperand(cell_reg, PropertyCell::kValueOffset)); |
5398 __ Branch(¬_same_value, ne, value_reg, Operand(cell_value_reg)); | 5395 __ Branch(¬_same_value, ne, value_reg, Operand(cell_value_reg)); |
| 5396 // Make sure the PropertyCell is not marked READ_ONLY. |
| 5397 __ And(at, cell_details_reg, PropertyDetails::kAttributesReadOnlyMask); |
| 5398 __ Branch(&slow_case, ne, at, Operand(zero_reg)); |
5399 if (FLAG_debug_code) { | 5399 if (FLAG_debug_code) { |
5400 Label done; | 5400 Label done; |
5401 // This can only be true for Constant, ConstantType and Undefined cells, | 5401 // This can only be true for Constant, ConstantType and Undefined cells, |
5402 // because we never store the_hole via this stub. | 5402 // because we never store the_hole via this stub. |
5403 __ Branch(&done, eq, cell_details_reg, | 5403 __ Branch(&done, eq, cell_details_reg, |
5404 Operand(PropertyDetails::PropertyCellTypeField::encode( | 5404 Operand(PropertyDetails::PropertyCellTypeField::encode( |
5405 PropertyCellType::kConstant) | | 5405 PropertyCellType::kConstant) | |
5406 PropertyDetails::KindField::encode(kData))); | 5406 PropertyDetails::KindField::encode(kData))); |
5407 __ Branch(&done, eq, cell_details_reg, | 5407 __ Branch(&done, eq, cell_details_reg, |
5408 Operand(PropertyDetails::PropertyCellTypeField::encode( | 5408 Operand(PropertyDetails::PropertyCellTypeField::encode( |
5409 PropertyCellType::kConstantType) | | 5409 PropertyCellType::kConstantType) | |
5410 PropertyDetails::KindField::encode(kData))); | 5410 PropertyDetails::KindField::encode(kData))); |
5411 __ Check(eq, kUnexpectedValue, cell_details_reg, | 5411 __ Check(eq, kUnexpectedValue, cell_details_reg, |
5412 Operand(PropertyDetails::PropertyCellTypeField::encode( | 5412 Operand(PropertyDetails::PropertyCellTypeField::encode( |
5413 PropertyCellType::kUndefined) | | 5413 PropertyCellType::kUndefined) | |
5414 PropertyDetails::KindField::encode(kData))); | 5414 PropertyDetails::KindField::encode(kData))); |
5415 __ bind(&done); | 5415 __ bind(&done); |
5416 } | 5416 } |
5417 __ Ret(); | 5417 __ Ret(); |
5418 __ bind(¬_same_value); | 5418 __ bind(¬_same_value); |
5419 | 5419 |
5420 // Check if PropertyCell contains data with constant type. | 5420 // Check if PropertyCell contains data with constant type (and is not |
| 5421 // READ_ONLY). |
5421 __ Branch(&slow_case, ne, cell_details_reg, | 5422 __ Branch(&slow_case, ne, cell_details_reg, |
5422 Operand(PropertyDetails::PropertyCellTypeField::encode( | 5423 Operand(PropertyDetails::PropertyCellTypeField::encode( |
5423 PropertyCellType::kConstantType) | | 5424 PropertyCellType::kConstantType) | |
5424 PropertyDetails::KindField::encode(kData))); | 5425 PropertyDetails::KindField::encode(kData))); |
5425 | 5426 |
5426 // Now either both old and new values must be SMIs or both must be heap | 5427 // Now either both old and new values must be SMIs or both must be heap |
5427 // objects with same map. | 5428 // objects with same map. |
5428 Label value_is_heap_object; | 5429 Label value_is_heap_object; |
5429 __ JumpIfNotSmi(value_reg, &value_is_heap_object); | 5430 __ JumpIfNotSmi(value_reg, &value_is_heap_object); |
5430 __ JumpIfNotSmi(cell_value_reg, &slow_case); | 5431 __ JumpIfNotSmi(cell_value_reg, &slow_case); |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5754 MemOperand(fp, 6 * kPointerSize), NULL); | 5755 MemOperand(fp, 6 * kPointerSize), NULL); |
5755 } | 5756 } |
5756 | 5757 |
5757 | 5758 |
5758 #undef __ | 5759 #undef __ |
5759 | 5760 |
5760 } // namespace internal | 5761 } // namespace internal |
5761 } // namespace v8 | 5762 } // namespace v8 |
5762 | 5763 |
5763 #endif // V8_TARGET_ARCH_MIPS64 | 5764 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |