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

Side by Side Diff: src/mips/stub-cache-mips.cc

Issue 7600025: Create a common subclass for arrays (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: review feedback Created 9 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 | « src/ia32/stub-cache-ia32.cc ('k') | src/objects.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 3476 matching lines...) Expand 10 before | Expand all | Expand 10 after
3487 // Check that the key is a smi. 3487 // Check that the key is a smi.
3488 __ JumpIfNotSmi(key, &miss_force_generic); 3488 __ JumpIfNotSmi(key, &miss_force_generic);
3489 3489
3490 __ lw(a3, FieldMemOperand(receiver, JSObject::kElementsOffset)); 3490 __ lw(a3, FieldMemOperand(receiver, JSObject::kElementsOffset));
3491 // a3: elements array 3491 // a3: elements array
3492 3492
3493 // Check that the index is in range. 3493 // Check that the index is in range.
3494 __ lw(t1, FieldMemOperand(a3, ExternalArray::kLengthOffset)); 3494 __ lw(t1, FieldMemOperand(a3, ExternalArray::kLengthOffset));
3495 __ sra(t2, key, kSmiTagSize); 3495 __ sra(t2, key, kSmiTagSize);
3496 // Unsigned comparison catches both negative and too-large values. 3496 // Unsigned comparison catches both negative and too-large values.
3497 __ Branch(&miss_force_generic, Uless, t1, Operand(t2)); 3497 __ Branch(&miss_force_generic, Ugreater_equal, key, Operand(t1));
3498 3498
3499 __ lw(a3, FieldMemOperand(a3, ExternalArray::kExternalPointerOffset)); 3499 __ lw(a3, FieldMemOperand(a3, ExternalArray::kExternalPointerOffset));
3500 // a3: base pointer of external storage 3500 // a3: base pointer of external storage
3501 3501
3502 // We are not untagging smi key and instead work with it 3502 // We are not untagging smi key and instead work with it
3503 // as if it was premultiplied by 2. 3503 // as if it was premultiplied by 2.
3504 ASSERT((kSmiTag == 0) && (kSmiTagSize == 1)); 3504 ASSERT((kSmiTag == 0) && (kSmiTagSize == 1));
3505 3505
3506 Register value = a2; 3506 Register value = a2;
3507 switch (elements_kind) { 3507 switch (elements_kind) {
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
3815 3815
3816 // Register usage. 3816 // Register usage.
3817 Register value = a0; 3817 Register value = a0;
3818 Register key = a1; 3818 Register key = a1;
3819 Register receiver = a2; 3819 Register receiver = a2;
3820 // a3 mostly holds the elements array or the destination external array. 3820 // a3 mostly holds the elements array or the destination external array.
3821 3821
3822 // This stub is meant to be tail-jumped to, the receiver must already 3822 // This stub is meant to be tail-jumped to, the receiver must already
3823 // have been verified by the caller to not be a smi. 3823 // have been verified by the caller to not be a smi.
3824 3824
3825 // Check that the key is a smi.
3826 __ JumpIfNotSmi(key, &miss_force_generic);
3827
3825 __ lw(a3, FieldMemOperand(receiver, JSObject::kElementsOffset)); 3828 __ lw(a3, FieldMemOperand(receiver, JSObject::kElementsOffset));
3826 3829
3827 // Check that the key is a smi.
3828 __ JumpIfNotSmi(key, &miss_force_generic);
3829
3830 // Check that the index is in range. 3830 // Check that the index is in range.
3831 __ SmiUntag(t0, key); 3831 __ SmiUntag(t0, key);
3832 __ lw(t1, FieldMemOperand(a3, ExternalArray::kLengthOffset)); 3832 __ lw(t1, FieldMemOperand(a3, ExternalArray::kLengthOffset));
3833 // Unsigned comparison catches both negative and too-large values. 3833 // Unsigned comparison catches both negative and too-large values.
3834 __ Branch(&miss_force_generic, Ugreater_equal, t0, Operand(t1)); 3834 __ Branch(&miss_force_generic, Ugreater_equal, key, Operand(t1));
3835 3835
3836 // Handle both smis and HeapNumbers in the fast path. Go to the 3836 // Handle both smis and HeapNumbers in the fast path. Go to the
3837 // runtime for all other kinds of values. 3837 // runtime for all other kinds of values.
3838 // a3: external array. 3838 // a3: external array.
3839 // t0: key (integer). 3839 // t0: key (integer).
3840 3840
3841 if (elements_kind == JSObject::EXTERNAL_PIXEL_ELEMENTS) { 3841 if (elements_kind == JSObject::EXTERNAL_PIXEL_ELEMENTS) {
3842 // Double to pixel conversion is only implemented in the runtime for now. 3842 // Double to pixel conversion is only implemented in the runtime for now.
3843 __ JumpIfNotSmi(value, &slow); 3843 __ JumpIfNotSmi(value, &slow);
3844 } else { 3844 } else {
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
4486 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); 4486 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric();
4487 __ Jump(ic, RelocInfo::CODE_TARGET); 4487 __ Jump(ic, RelocInfo::CODE_TARGET);
4488 } 4488 }
4489 4489
4490 4490
4491 #undef __ 4491 #undef __
4492 4492
4493 } } // namespace v8::internal 4493 } } // namespace v8::internal
4494 4494
4495 #endif // V8_TARGET_ARCH_MIPS 4495 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/ia32/stub-cache-ia32.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698