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

Side by Side Diff: src/mips/lithium-codegen-mips.cc

Issue 10914025: MIPS: Use a special EnumLength field to indicate number of valid enum cache values. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 3 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 | « src/mips/full-codegen-mips.cc ('k') | src/mips/lithium-mips.h » ('j') | 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 1206 matching lines...) Expand 10 before | Expand all | Expand 10 after
1217 } 1217 }
1218 1218
1219 1219
1220 void LCodeGen::DoFixedArrayBaseLength(LFixedArrayBaseLength* instr) { 1220 void LCodeGen::DoFixedArrayBaseLength(LFixedArrayBaseLength* instr) {
1221 Register result = ToRegister(instr->result()); 1221 Register result = ToRegister(instr->result());
1222 Register array = ToRegister(instr->InputAt(0)); 1222 Register array = ToRegister(instr->InputAt(0));
1223 __ lw(result, FieldMemOperand(array, FixedArrayBase::kLengthOffset)); 1223 __ lw(result, FieldMemOperand(array, FixedArrayBase::kLengthOffset));
1224 } 1224 }
1225 1225
1226 1226
1227 void LCodeGen::DoMapEnumLength(LMapEnumLength* instr) {
1228 Register result = ToRegister(instr->result());
1229 Register map = ToRegister(instr->InputAt(0));
1230 __ EnumLength(result, map);
1231 }
1232
1233
1227 void LCodeGen::DoElementsKind(LElementsKind* instr) { 1234 void LCodeGen::DoElementsKind(LElementsKind* instr) {
1228 Register result = ToRegister(instr->result()); 1235 Register result = ToRegister(instr->result());
1229 Register input = ToRegister(instr->InputAt(0)); 1236 Register input = ToRegister(instr->InputAt(0));
1230 1237
1231 // Load map into |result|. 1238 // Load map into |result|.
1232 __ lw(result, FieldMemOperand(input, HeapObject::kMapOffset)); 1239 __ lw(result, FieldMemOperand(input, HeapObject::kMapOffset));
1233 // Load the map's "bit field 2" into |result|. We only need the first byte, 1240 // Load the map's "bit field 2" into |result|. We only need the first byte,
1234 // but the following bit field extraction takes care of that anyway. 1241 // but the following bit field extraction takes care of that anyway.
1235 __ lbu(result, FieldMemOperand(result, Map::kBitField2Offset)); 1242 __ lbu(result, FieldMemOperand(result, Map::kBitField2Offset));
1236 // Retrieve elements_kind from bit field 2. 1243 // Retrieve elements_kind from bit field 2.
(...skipping 4060 matching lines...) Expand 10 before | Expand all | Expand 10 after
5297 __ LoadRoot(at, Heap::kMetaMapRootIndex); 5304 __ LoadRoot(at, Heap::kMetaMapRootIndex);
5298 DeoptimizeIf(ne, instr->environment(), a1, Operand(at)); 5305 DeoptimizeIf(ne, instr->environment(), a1, Operand(at));
5299 __ bind(&use_cache); 5306 __ bind(&use_cache);
5300 } 5307 }
5301 5308
5302 5309
5303 void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) { 5310 void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) {
5304 Register map = ToRegister(instr->map()); 5311 Register map = ToRegister(instr->map());
5305 Register result = ToRegister(instr->result()); 5312 Register result = ToRegister(instr->result());
5306 Register scratch = ToRegister(instr->scratch()); 5313 Register scratch = ToRegister(instr->scratch());
5314 Label load_cache, done;
5315 __ EnumLength(result, map);
5316 __ Branch(&load_cache, ne, result, Operand(Smi::FromInt(0)));
5317 __ li(result, Operand(isolate()->factory()->empty_fixed_array()));
5318 __ jmp(&done);
5319
5320 __ bind(&load_cache);
5307 __ LoadInstanceDescriptors(map, result, scratch); 5321 __ LoadInstanceDescriptors(map, result, scratch);
5308 __ lw(result, 5322 __ lw(result,
5309 FieldMemOperand(result, DescriptorArray::kEnumCacheOffset)); 5323 FieldMemOperand(result, DescriptorArray::kEnumCacheOffset));
5310 __ lw(result, 5324 __ lw(result,
5311 FieldMemOperand(result, FixedArray::SizeFor(instr->idx()))); 5325 FieldMemOperand(result, FixedArray::SizeFor(instr->idx())));
5312 DeoptimizeIf(eq, instr->environment(), result, Operand(zero_reg)); 5326 DeoptimizeIf(eq, instr->environment(), result, Operand(zero_reg));
5327
5328 __ bind(&done);
5313 } 5329 }
5314 5330
5315 5331
5316 void LCodeGen::DoCheckMapValue(LCheckMapValue* instr) { 5332 void LCodeGen::DoCheckMapValue(LCheckMapValue* instr) {
5317 Register object = ToRegister(instr->value()); 5333 Register object = ToRegister(instr->value());
5318 Register map = ToRegister(instr->map()); 5334 Register map = ToRegister(instr->map());
5319 __ lw(scratch0(), FieldMemOperand(object, HeapObject::kMapOffset)); 5335 __ lw(scratch0(), FieldMemOperand(object, HeapObject::kMapOffset));
5320 DeoptimizeIf(ne, instr->environment(), map, Operand(scratch0())); 5336 DeoptimizeIf(ne, instr->environment(), map, Operand(scratch0()));
5321 } 5337 }
5322 5338
(...skipping 20 matching lines...) Expand all
5343 __ Subu(scratch, result, scratch); 5359 __ Subu(scratch, result, scratch);
5344 __ lw(result, FieldMemOperand(scratch, 5360 __ lw(result, FieldMemOperand(scratch,
5345 FixedArray::kHeaderSize - kPointerSize)); 5361 FixedArray::kHeaderSize - kPointerSize));
5346 __ bind(&done); 5362 __ bind(&done);
5347 } 5363 }
5348 5364
5349 5365
5350 #undef __ 5366 #undef __
5351 5367
5352 } } // namespace v8::internal 5368 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mips/full-codegen-mips.cc ('k') | src/mips/lithium-mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698