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

Side by Side Diff: src/arm/lithium-codegen-arm.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/arm/lithium-arm.cc ('k') | src/arm/macro-assembler-arm.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 1521 matching lines...) Expand 10 before | Expand all | Expand 10 after
1532 } 1532 }
1533 1533
1534 1534
1535 void LCodeGen::DoFixedArrayBaseLength(LFixedArrayBaseLength* instr) { 1535 void LCodeGen::DoFixedArrayBaseLength(LFixedArrayBaseLength* instr) {
1536 Register result = ToRegister(instr->result()); 1536 Register result = ToRegister(instr->result());
1537 Register array = ToRegister(instr->InputAt(0)); 1537 Register array = ToRegister(instr->InputAt(0));
1538 __ ldr(result, FieldMemOperand(array, FixedArrayBase::kLengthOffset)); 1538 __ ldr(result, FieldMemOperand(array, FixedArrayBase::kLengthOffset));
1539 } 1539 }
1540 1540
1541 1541
1542 void LCodeGen::DoMapEnumLength(LMapEnumLength* instr) {
1543 Register result = ToRegister(instr->result());
1544 Register map = ToRegister(instr->InputAt(0));
1545 __ EnumLength(result, map);
1546 }
1547
1548
1542 void LCodeGen::DoElementsKind(LElementsKind* instr) { 1549 void LCodeGen::DoElementsKind(LElementsKind* instr) {
1543 Register result = ToRegister(instr->result()); 1550 Register result = ToRegister(instr->result());
1544 Register input = ToRegister(instr->InputAt(0)); 1551 Register input = ToRegister(instr->InputAt(0));
1545 1552
1546 // Load map into |result|. 1553 // Load map into |result|.
1547 __ ldr(result, FieldMemOperand(input, HeapObject::kMapOffset)); 1554 __ ldr(result, FieldMemOperand(input, HeapObject::kMapOffset));
1548 // Load the map's "bit field 2" into |result|. We only need the first byte, 1555 // Load the map's "bit field 2" into |result|. We only need the first byte,
1549 // but the following bit field extraction takes care of that anyway. 1556 // but the following bit field extraction takes care of that anyway.
1550 __ ldr(result, FieldMemOperand(result, Map::kBitField2Offset)); 1557 __ ldr(result, FieldMemOperand(result, Map::kBitField2Offset));
1551 // Retrieve elements_kind from bit field 2. 1558 // Retrieve elements_kind from bit field 2.
(...skipping 3999 matching lines...) Expand 10 before | Expand all | Expand 10 after
5551 __ cmp(r1, ip); 5558 __ cmp(r1, ip);
5552 DeoptimizeIf(ne, instr->environment()); 5559 DeoptimizeIf(ne, instr->environment());
5553 __ bind(&use_cache); 5560 __ bind(&use_cache);
5554 } 5561 }
5555 5562
5556 5563
5557 void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) { 5564 void LCodeGen::DoForInCacheArray(LForInCacheArray* instr) {
5558 Register map = ToRegister(instr->map()); 5565 Register map = ToRegister(instr->map());
5559 Register result = ToRegister(instr->result()); 5566 Register result = ToRegister(instr->result());
5560 Register scratch = ToRegister(instr->scratch()); 5567 Register scratch = ToRegister(instr->scratch());
5568 Label load_cache, done;
5569 __ EnumLength(result, map);
5570 __ cmp(result, Operand(Smi::FromInt(0)));
5571 __ b(ne, &load_cache);
5572 __ mov(result, Operand(isolate()->factory()->empty_fixed_array()));
5573 __ jmp(&done);
5574
5575 __ bind(&load_cache);
5561 __ LoadInstanceDescriptors(map, result, scratch); 5576 __ LoadInstanceDescriptors(map, result, scratch);
5562 __ ldr(result, 5577 __ ldr(result,
5563 FieldMemOperand(result, DescriptorArray::kEnumCacheOffset)); 5578 FieldMemOperand(result, DescriptorArray::kEnumCacheOffset));
5564 __ ldr(result, 5579 __ ldr(result,
5565 FieldMemOperand(result, FixedArray::SizeFor(instr->idx()))); 5580 FieldMemOperand(result, FixedArray::SizeFor(instr->idx())));
5566 __ cmp(result, Operand(0)); 5581 __ cmp(result, Operand(0));
5567 DeoptimizeIf(eq, instr->environment()); 5582 DeoptimizeIf(eq, instr->environment());
5583
5584 __ bind(&done);
5568 } 5585 }
5569 5586
5570 5587
5571 void LCodeGen::DoCheckMapValue(LCheckMapValue* instr) { 5588 void LCodeGen::DoCheckMapValue(LCheckMapValue* instr) {
5572 Register object = ToRegister(instr->value()); 5589 Register object = ToRegister(instr->value());
5573 Register map = ToRegister(instr->map()); 5590 Register map = ToRegister(instr->map());
5574 __ ldr(scratch0(), FieldMemOperand(object, HeapObject::kMapOffset)); 5591 __ ldr(scratch0(), FieldMemOperand(object, HeapObject::kMapOffset));
5575 __ cmp(map, scratch0()); 5592 __ cmp(map, scratch0());
5576 DeoptimizeIf(ne, instr->environment()); 5593 DeoptimizeIf(ne, instr->environment());
5577 } 5594 }
(...skipping 21 matching lines...) Expand all
5599 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); 5616 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize));
5600 __ ldr(result, FieldMemOperand(scratch, 5617 __ ldr(result, FieldMemOperand(scratch,
5601 FixedArray::kHeaderSize - kPointerSize)); 5618 FixedArray::kHeaderSize - kPointerSize));
5602 __ bind(&done); 5619 __ bind(&done);
5603 } 5620 }
5604 5621
5605 5622
5606 #undef __ 5623 #undef __
5607 5624
5608 } } // namespace v8::internal 5625 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-arm.cc ('k') | src/arm/macro-assembler-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698