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

Side by Side Diff: src/mips/macro-assembler-mips.cc

Issue 10827335: MIPS: Swapped transition array and descriptor array. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 5275 matching lines...) Expand 10 before | Expand all | Expand 10 after
5286 Addu(t8, t8, Operand(length)); 5286 Addu(t8, t8, Operand(length));
5287 sw(t8, MemOperand(bitmap_scratch, MemoryChunk::kLiveBytesOffset)); 5287 sw(t8, MemOperand(bitmap_scratch, MemoryChunk::kLiveBytesOffset));
5288 5288
5289 bind(&done); 5289 bind(&done);
5290 } 5290 }
5291 5291
5292 5292
5293 void MacroAssembler::LoadInstanceDescriptors(Register map, 5293 void MacroAssembler::LoadInstanceDescriptors(Register map,
5294 Register descriptors, 5294 Register descriptors,
5295 Register scratch) { 5295 Register scratch) {
5296 lw(descriptors, 5296 Register temp = descriptors;
5297 FieldMemOperand(map, Map::kInstanceDescriptorsOrBackPointerOffset)); 5297 lw(temp, FieldMemOperand(map, Map::kTransitionsOrBackPointerOffset));
5298 5298
5299 Label ok, fail; 5299 Label ok, fail;
5300 CheckMap(descriptors, 5300 CheckMap(temp,
5301 scratch, 5301 scratch,
5302 isolate()->factory()->fixed_array_map(), 5302 isolate()->factory()->fixed_array_map(),
5303 &fail, 5303 &fail,
5304 DONT_DO_SMI_CHECK); 5304 DONT_DO_SMI_CHECK);
5305 lw(descriptors, FieldMemOperand(temp, TransitionArray::kDescriptorsOffset));
5305 jmp(&ok); 5306 jmp(&ok);
5306 bind(&fail); 5307 bind(&fail);
5307 LoadRoot(descriptors, Heap::kEmptyDescriptorArrayRootIndex); 5308 LoadRoot(descriptors, Heap::kEmptyDescriptorArrayRootIndex);
5308 bind(&ok); 5309 bind(&ok);
5309 } 5310 }
5310 5311
5311 5312
5312 void MacroAssembler::CheckEnumCache(Register null_value, Label* call_runtime) { 5313 void MacroAssembler::CheckEnumCache(Register null_value, Label* call_runtime) {
5313 Label next; 5314 Label next;
5314 // Preload a couple of values used in the loop. 5315 // Preload a couple of values used in the loop.
5315 Register empty_fixed_array_value = t2; 5316 Register empty_fixed_array_value = t2;
5316 LoadRoot(empty_fixed_array_value, Heap::kEmptyFixedArrayRootIndex); 5317 LoadRoot(empty_fixed_array_value, Heap::kEmptyFixedArrayRootIndex);
5317 Register empty_descriptor_array_value = t3;
5318 LoadRoot(empty_descriptor_array_value,
5319 Heap::kEmptyDescriptorArrayRootIndex);
5320 mov(a1, a0); 5318 mov(a1, a0);
5321 bind(&next); 5319 bind(&next);
5322 5320
5323 // Check that there are no elements. Register a1 contains the 5321 // Check that there are no elements. Register a1 contains the
5324 // current JS object we've reached through the prototype chain. 5322 // current JS object we've reached through the prototype chain.
5325 lw(a2, FieldMemOperand(a1, JSObject::kElementsOffset)); 5323 lw(a2, FieldMemOperand(a1, JSObject::kElementsOffset));
5326 Branch(call_runtime, ne, a2, Operand(empty_fixed_array_value)); 5324 Branch(call_runtime, ne, a2, Operand(empty_fixed_array_value));
5327 5325
5328 // Check that instance descriptors are not empty so that we can 5326 // Check that instance descriptors are not empty so that we can
5329 // check for an enum cache. Leave the map in a2 for the subsequent 5327 // check for an enum cache. Leave the map in a2 for the subsequent
5330 // prototype load. 5328 // prototype load.
5331 lw(a2, FieldMemOperand(a1, HeapObject::kMapOffset)); 5329 lw(a2, FieldMemOperand(a1, HeapObject::kMapOffset));
5332 lw(a3, FieldMemOperand(a2, Map::kInstanceDescriptorsOrBackPointerOffset)); 5330 lw(a3, FieldMemOperand(a2, Map::kTransitionsOrBackPointerOffset));
5333 5331
5334 CheckMap(a3, 5332 CheckMap(a3,
5335 t3, 5333 t3,
5336 isolate()->factory()->fixed_array_map(), 5334 isolate()->factory()->fixed_array_map(),
5337 call_runtime, 5335 call_runtime,
5338 DONT_DO_SMI_CHECK); 5336 DONT_DO_SMI_CHECK);
5339 5337
5338 LoadRoot(t3, Heap::kEmptyDescriptorArrayRootIndex);
5339 lw(a3, FieldMemOperand(a3, TransitionArray::kDescriptorsOffset));
5340 Branch(call_runtime, eq, a3, Operand(t3));
5341
5340 // Check that there is an enum cache in the non-empty instance 5342 // Check that there is an enum cache in the non-empty instance
5341 // descriptors (a3). This is the case if the next enumeration 5343 // descriptors (a3). This is the case if the next enumeration
5342 // index field does not contain a smi. 5344 // index field does not contain a smi.
5343 lw(a3, FieldMemOperand(a3, DescriptorArray::kEnumCacheOffset)); 5345 lw(a3, FieldMemOperand(a3, DescriptorArray::kEnumCacheOffset));
5344 JumpIfSmi(a3, call_runtime); 5346 JumpIfSmi(a3, call_runtime);
5345 5347
5346 // For all objects but the receiver, check that the cache is empty. 5348 // For all objects but the receiver, check that the cache is empty.
5347 Label check_prototype; 5349 Label check_prototype;
5348 Branch(&check_prototype, eq, a1, Operand(a0)); 5350 Branch(&check_prototype, eq, a1, Operand(a0));
5349 lw(a3, FieldMemOperand(a3, DescriptorArray::kEnumCacheBridgeCacheOffset)); 5351 lw(a3, FieldMemOperand(a3, DescriptorArray::kEnumCacheBridgeCacheOffset));
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
5460 opcode == BGTZL); 5462 opcode == BGTZL);
5461 opcode = (cond == eq) ? BEQ : BNE; 5463 opcode = (cond == eq) ? BEQ : BNE;
5462 instr = (instr & ~kOpcodeMask) | opcode; 5464 instr = (instr & ~kOpcodeMask) | opcode;
5463 masm_.emit(instr); 5465 masm_.emit(instr);
5464 } 5466 }
5465 5467
5466 5468
5467 } } // namespace v8::internal 5469 } } // namespace v8::internal
5468 5470
5469 #endif // V8_TARGET_ARCH_MIPS 5471 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698