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

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

Issue 10824079: 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: Addressed comments 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/ia32/full-codegen-ia32.cc ('k') | src/ia32/lithium-ia32.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 1376 matching lines...) Expand 10 before | Expand all | Expand 10 after
1387 1387
1388 1388
1389 void LCodeGen::DoFixedArrayBaseLength( 1389 void LCodeGen::DoFixedArrayBaseLength(
1390 LFixedArrayBaseLength* instr) { 1390 LFixedArrayBaseLength* instr) {
1391 Register result = ToRegister(instr->result()); 1391 Register result = ToRegister(instr->result());
1392 Register array = ToRegister(instr->InputAt(0)); 1392 Register array = ToRegister(instr->InputAt(0));
1393 __ mov(result, FieldOperand(array, FixedArrayBase::kLengthOffset)); 1393 __ mov(result, FieldOperand(array, FixedArrayBase::kLengthOffset));
1394 } 1394 }
1395 1395
1396 1396
1397 void LCodeGen::DoMapEnumLength(LMapEnumLength* instr) {
1398 Register result = ToRegister(instr->result());
1399 Register map = ToRegister(instr->InputAt(0));
1400 __ EnumLength(result, map);
1401 }
1402
1403
1397 void LCodeGen::DoElementsKind(LElementsKind* instr) { 1404 void LCodeGen::DoElementsKind(LElementsKind* instr) {
1398 Register result = ToRegister(instr->result()); 1405 Register result = ToRegister(instr->result());
1399 Register input = ToRegister(instr->InputAt(0)); 1406 Register input = ToRegister(instr->InputAt(0));
1400 1407
1401 // Load map into |result|. 1408 // Load map into |result|.
1402 __ mov(result, FieldOperand(input, HeapObject::kMapOffset)); 1409 __ mov(result, FieldOperand(input, HeapObject::kMapOffset));
1403 // Load the map's "bit field 2" into |result|. We only need the first byte, 1410 // Load the map's "bit field 2" into |result|. We only need the first byte,
1404 // but the following masking takes care of that anyway. 1411 // but the following masking takes care of that anyway.
1405 __ mov(result, FieldOperand(result, Map::kBitField2Offset)); 1412 __ mov(result, FieldOperand(result, Map::kBitField2Offset));
1406 // Retrieve elements_kind from bit field 2. 1413 // Retrieve elements_kind from bit field 2.
(...skipping 4040 matching lines...) Expand 10 before | Expand all | Expand 10 after
5447 __ cmp(FieldOperand(eax, HeapObject::kMapOffset), 5454 __ cmp(FieldOperand(eax, HeapObject::kMapOffset),
5448 isolate()->factory()->meta_map()); 5455 isolate()->factory()->meta_map());
5449 DeoptimizeIf(not_equal, instr->environment()); 5456 DeoptimizeIf(not_equal, instr->environment());
5450 __ bind(&use_cache); 5457 __ bind(&use_cache);
5451 } 5458 }
5452 5459
5453 5460
5454 void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) { 5461 void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) {
5455 Register map = ToRegister(instr->map()); 5462 Register map = ToRegister(instr->map());
5456 Register result = ToRegister(instr->result()); 5463 Register result = ToRegister(instr->result());
5464 Label load_cache, done;
5465 __ EnumLength(result, map);
5466 __ cmp(result, Immediate(Smi::FromInt(0)));
5467 __ j(not_equal, &load_cache);
5468 __ mov(result, isolate()->factory()->empty_fixed_array());
5469 __ jmp(&done);
5470
5471 __ bind(&load_cache);
5457 __ LoadInstanceDescriptors(map, result); 5472 __ LoadInstanceDescriptors(map, result);
5458 __ mov(result, 5473 __ mov(result,
5459 FieldOperand(result, DescriptorArray::kEnumCacheOffset)); 5474 FieldOperand(result, DescriptorArray::kEnumCacheOffset));
5460 __ mov(result, 5475 __ mov(result,
5461 FieldOperand(result, FixedArray::SizeFor(instr->idx()))); 5476 FieldOperand(result, FixedArray::SizeFor(instr->idx())));
5477 __ bind(&done);
5462 __ test(result, result); 5478 __ test(result, result);
5463 DeoptimizeIf(equal, instr->environment()); 5479 DeoptimizeIf(equal, instr->environment());
5464 } 5480 }
5465 5481
5466 5482
5467 void LCodeGen::DoCheckMapValue(LCheckMapValue* instr) { 5483 void LCodeGen::DoCheckMapValue(LCheckMapValue* instr) {
5468 Register object = ToRegister(instr->value()); 5484 Register object = ToRegister(instr->value());
5469 __ cmp(ToRegister(instr->map()), 5485 __ cmp(ToRegister(instr->map()),
5470 FieldOperand(object, HeapObject::kMapOffset)); 5486 FieldOperand(object, HeapObject::kMapOffset));
5471 DeoptimizeIf(not_equal, instr->environment()); 5487 DeoptimizeIf(not_equal, instr->environment());
(...skipping 23 matching lines...) Expand all
5495 FixedArray::kHeaderSize - kPointerSize)); 5511 FixedArray::kHeaderSize - kPointerSize));
5496 __ bind(&done); 5512 __ bind(&done);
5497 } 5513 }
5498 5514
5499 5515
5500 #undef __ 5516 #undef __
5501 5517
5502 } } // namespace v8::internal 5518 } } // namespace v8::internal
5503 5519
5504 #endif // V8_TARGET_ARCH_IA32 5520 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/ia32/lithium-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698