OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 5272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5283 And(bitmap_scratch, bitmap_scratch, Operand(~Page::kPageAlignmentMask)); | 5283 And(bitmap_scratch, bitmap_scratch, Operand(~Page::kPageAlignmentMask)); |
5284 lw(t8, MemOperand(bitmap_scratch, MemoryChunk::kLiveBytesOffset)); | 5284 lw(t8, MemOperand(bitmap_scratch, MemoryChunk::kLiveBytesOffset)); |
5285 Addu(t8, t8, Operand(length)); | 5285 Addu(t8, t8, Operand(length)); |
5286 sw(t8, MemOperand(bitmap_scratch, MemoryChunk::kLiveBytesOffset)); | 5286 sw(t8, MemOperand(bitmap_scratch, MemoryChunk::kLiveBytesOffset)); |
5287 | 5287 |
5288 bind(&done); | 5288 bind(&done); |
5289 } | 5289 } |
5290 | 5290 |
5291 | 5291 |
5292 void MacroAssembler::LoadInstanceDescriptors(Register map, | 5292 void MacroAssembler::LoadInstanceDescriptors(Register map, |
5293 Register descriptors) { | 5293 Register descriptors, |
| 5294 Register scratch) { |
5294 lw(descriptors, | 5295 lw(descriptors, |
5295 FieldMemOperand(map, Map::kInstanceDescriptorsOrBitField3Offset)); | 5296 FieldMemOperand(map, Map::kInstanceDescriptorsOrBackPointerOffset)); |
5296 Label not_smi; | 5297 |
5297 JumpIfNotSmi(descriptors, ¬_smi); | 5298 Label ok, fail; |
| 5299 CheckMap(descriptors, |
| 5300 scratch, |
| 5301 isolate()->factory()->fixed_array_map(), |
| 5302 &fail, |
| 5303 DONT_DO_SMI_CHECK); |
| 5304 jmp(&ok); |
| 5305 bind(&fail); |
5298 LoadRoot(descriptors, Heap::kEmptyDescriptorArrayRootIndex); | 5306 LoadRoot(descriptors, Heap::kEmptyDescriptorArrayRootIndex); |
5299 bind(¬_smi); | 5307 bind(&ok); |
5300 } | 5308 } |
5301 | 5309 |
5302 | 5310 |
5303 void MacroAssembler::CheckEnumCache(Register null_value, Label* call_runtime) { | 5311 void MacroAssembler::CheckEnumCache(Register null_value, Label* call_runtime) { |
5304 Label next; | 5312 Label next; |
5305 // Preload a couple of values used in the loop. | 5313 // Preload a couple of values used in the loop. |
5306 Register empty_fixed_array_value = t2; | 5314 Register empty_fixed_array_value = t2; |
5307 LoadRoot(empty_fixed_array_value, Heap::kEmptyFixedArrayRootIndex); | 5315 LoadRoot(empty_fixed_array_value, Heap::kEmptyFixedArrayRootIndex); |
5308 Register empty_descriptor_array_value = t3; | 5316 Register empty_descriptor_array_value = t3; |
5309 LoadRoot(empty_descriptor_array_value, | 5317 LoadRoot(empty_descriptor_array_value, |
5310 Heap::kEmptyDescriptorArrayRootIndex); | 5318 Heap::kEmptyDescriptorArrayRootIndex); |
5311 mov(a1, a0); | 5319 mov(a1, a0); |
5312 bind(&next); | 5320 bind(&next); |
5313 | 5321 |
5314 // Check that there are no elements. Register a1 contains the | 5322 // Check that there are no elements. Register a1 contains the |
5315 // current JS object we've reached through the prototype chain. | 5323 // current JS object we've reached through the prototype chain. |
5316 lw(a2, FieldMemOperand(a1, JSObject::kElementsOffset)); | 5324 lw(a2, FieldMemOperand(a1, JSObject::kElementsOffset)); |
5317 Branch(call_runtime, ne, a2, Operand(empty_fixed_array_value)); | 5325 Branch(call_runtime, ne, a2, Operand(empty_fixed_array_value)); |
5318 | 5326 |
5319 // Check that instance descriptors are not empty so that we can | 5327 // Check that instance descriptors are not empty so that we can |
5320 // check for an enum cache. Leave the map in a2 for the subsequent | 5328 // check for an enum cache. Leave the map in a2 for the subsequent |
5321 // prototype load. | 5329 // prototype load. |
5322 lw(a2, FieldMemOperand(a1, HeapObject::kMapOffset)); | 5330 lw(a2, FieldMemOperand(a1, HeapObject::kMapOffset)); |
5323 lw(a3, FieldMemOperand(a2, Map::kInstanceDescriptorsOrBitField3Offset)); | 5331 lw(a3, FieldMemOperand(a2, Map::kInstanceDescriptorsOrBackPointerOffset)); |
5324 JumpIfSmi(a3, call_runtime); | 5332 |
| 5333 CheckMap(a3, |
| 5334 t3, |
| 5335 isolate()->factory()->fixed_array_map(), |
| 5336 call_runtime, |
| 5337 DONT_DO_SMI_CHECK); |
5325 | 5338 |
5326 // Check that there is an enum cache in the non-empty instance | 5339 // Check that there is an enum cache in the non-empty instance |
5327 // descriptors (a3). This is the case if the next enumeration | 5340 // descriptors (a3). This is the case if the next enumeration |
5328 // index field does not contain a smi. | 5341 // index field does not contain a smi. |
5329 lw(a3, FieldMemOperand(a3, DescriptorArray::kEnumerationIndexOffset)); | 5342 lw(a3, FieldMemOperand(a3, DescriptorArray::kEnumerationIndexOffset)); |
5330 JumpIfSmi(a3, call_runtime); | 5343 JumpIfSmi(a3, call_runtime); |
5331 | 5344 |
5332 // For all objects but the receiver, check that the cache is empty. | 5345 // For all objects but the receiver, check that the cache is empty. |
5333 Label check_prototype; | 5346 Label check_prototype; |
5334 Branch(&check_prototype, eq, a1, Operand(a0)); | 5347 Branch(&check_prototype, eq, a1, Operand(a0)); |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5446 opcode == BGTZL); | 5459 opcode == BGTZL); |
5447 opcode = (cond == eq) ? BEQ : BNE; | 5460 opcode = (cond == eq) ? BEQ : BNE; |
5448 instr = (instr & ~kOpcodeMask) | opcode; | 5461 instr = (instr & ~kOpcodeMask) | opcode; |
5449 masm_.emit(instr); | 5462 masm_.emit(instr); |
5450 } | 5463 } |
5451 | 5464 |
5452 | 5465 |
5453 } } // namespace v8::internal | 5466 } } // namespace v8::internal |
5454 | 5467 |
5455 #endif // V8_TARGET_ARCH_MIPS | 5468 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |