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

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

Issue 10209027: Implement tracking and optimizations of packed arrays. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: New upload Created 8 years, 8 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
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 2685 matching lines...) Expand 10 before | Expand all | Expand 10 after
2696 __ b(eq, &done); 2696 __ b(eq, &done);
2697 __ LoadRoot(ip, Heap::kFixedCOWArrayMapRootIndex); 2697 __ LoadRoot(ip, Heap::kFixedCOWArrayMapRootIndex);
2698 __ cmp(scratch, ip); 2698 __ cmp(scratch, ip);
2699 __ b(eq, &done); 2699 __ b(eq, &done);
2700 // |scratch| still contains |input|'s map. 2700 // |scratch| still contains |input|'s map.
2701 __ ldr(scratch, FieldMemOperand(scratch, Map::kBitField2Offset)); 2701 __ ldr(scratch, FieldMemOperand(scratch, Map::kBitField2Offset));
2702 __ ubfx(scratch, scratch, Map::kElementsKindShift, 2702 __ ubfx(scratch, scratch, Map::kElementsKindShift,
2703 Map::kElementsKindBitCount); 2703 Map::kElementsKindBitCount);
2704 __ cmp(scratch, Operand(FAST_ELEMENTS)); 2704 __ cmp(scratch, Operand(FAST_ELEMENTS));
2705 __ b(eq, &done); 2705 __ b(eq, &done);
2706 __ cmp(scratch, Operand(FAST_HOLEY_ELEMENTS));
2707 __ b(eq, &done);
2706 __ cmp(scratch, Operand(FIRST_EXTERNAL_ARRAY_ELEMENTS_KIND)); 2708 __ cmp(scratch, Operand(FIRST_EXTERNAL_ARRAY_ELEMENTS_KIND));
2707 __ b(lt, &fail); 2709 __ b(lt, &fail);
2708 __ cmp(scratch, Operand(LAST_EXTERNAL_ARRAY_ELEMENTS_KIND)); 2710 __ cmp(scratch, Operand(LAST_EXTERNAL_ARRAY_ELEMENTS_KIND));
2709 __ b(le, &done); 2711 __ b(le, &done);
2710 __ bind(&fail); 2712 __ bind(&fail);
2711 __ Abort("Check for fast or external elements failed."); 2713 __ Abort("Check for fast or external elements failed.");
2712 __ bind(&done); 2714 __ bind(&done);
2713 } 2715 }
2714 } 2716 }
2715 2717
(...skipping 1954 matching lines...) Expand 10 before | Expand all | Expand 10 after
4670 } 4672 }
4671 4673
4672 4674
4673 void LCodeGen::DoArrayLiteral(LArrayLiteral* instr) { 4675 void LCodeGen::DoArrayLiteral(LArrayLiteral* instr) {
4674 Heap* heap = isolate()->heap(); 4676 Heap* heap = isolate()->heap();
4675 ElementsKind boilerplate_elements_kind = 4677 ElementsKind boilerplate_elements_kind =
4676 instr->hydrogen()->boilerplate_elements_kind(); 4678 instr->hydrogen()->boilerplate_elements_kind();
4677 4679
4678 // Deopt if the array literal boilerplate ElementsKind is of a type different 4680 // Deopt if the array literal boilerplate ElementsKind is of a type different
4679 // than the expected one. The check isn't necessary if the boilerplate has 4681 // than the expected one. The check isn't necessary if the boilerplate has
4680 // already been converted to FAST_ELEMENTS. 4682 // already been converted to TERMINAL_FAST_ELEMENTS_KIND.
4681 if (boilerplate_elements_kind != FAST_ELEMENTS) { 4683 if (boilerplate_elements_kind != TERMINAL_FAST_ELEMENTS_KIND) {
4682 __ LoadHeapObject(r1, instr->hydrogen()->boilerplate_object()); 4684 __ LoadHeapObject(r1, instr->hydrogen()->boilerplate_object());
4683 // Load map into r2. 4685 // Load map into r2.
4684 __ ldr(r2, FieldMemOperand(r1, HeapObject::kMapOffset)); 4686 __ ldr(r2, FieldMemOperand(r1, HeapObject::kMapOffset));
4685 // Load the map's "bit field 2". 4687 // Load the map's "bit field 2".
4686 __ ldrb(r2, FieldMemOperand(r2, Map::kBitField2Offset)); 4688 __ ldrb(r2, FieldMemOperand(r2, Map::kBitField2Offset));
4687 // Retrieve elements_kind from bit field 2. 4689 // Retrieve elements_kind from bit field 2.
4688 __ ubfx(r2, r2, Map::kElementsKindShift, Map::kElementsKindBitCount); 4690 __ ubfx(r2, r2, Map::kElementsKindShift, Map::kElementsKindBitCount);
4689 __ cmp(r2, Operand(boilerplate_elements_kind)); 4691 __ cmp(r2, Operand(boilerplate_elements_kind));
4690 DeoptimizeIf(ne, instr->environment()); 4692 DeoptimizeIf(ne, instr->environment());
4691 } 4693 }
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
5296 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); 5298 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize));
5297 __ ldr(result, FieldMemOperand(scratch, 5299 __ ldr(result, FieldMemOperand(scratch,
5298 FixedArray::kHeaderSize - kPointerSize)); 5300 FixedArray::kHeaderSize - kPointerSize));
5299 __ bind(&done); 5301 __ bind(&done);
5300 } 5302 }
5301 5303
5302 5304
5303 #undef __ 5305 #undef __
5304 5306
5305 } } // namespace v8::internal 5307 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/ic-arm.cc ('k') | src/arm/stub-cache-arm.cc » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698