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

Side by Side Diff: src/mips/code-stubs-mips.cc

Issue 10917260: Microoptimization to regexps. (Closed) Base URL: http://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/ia32/code-stubs-ia32.cc ('k') | src/regexp.js » ('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 5387 matching lines...) Expand 10 before | Expand all | Expand 10 after
5398 // v0: JSArray, tagged. 5398 // v0: JSArray, tagged.
5399 // a3: FixedArray, tagged. 5399 // a3: FixedArray, tagged.
5400 // t1: Number of elements in array, untagged. 5400 // t1: Number of elements in array, untagged.
5401 5401
5402 // Set map. 5402 // Set map.
5403 __ li(a2, Operand(masm->isolate()->factory()->fixed_array_map())); 5403 __ li(a2, Operand(masm->isolate()->factory()->fixed_array_map()));
5404 __ sw(a2, FieldMemOperand(a3, HeapObject::kMapOffset)); 5404 __ sw(a2, FieldMemOperand(a3, HeapObject::kMapOffset));
5405 // Set FixedArray length. 5405 // Set FixedArray length.
5406 __ sll(t2, t1, kSmiTagSize); 5406 __ sll(t2, t1, kSmiTagSize);
5407 __ sw(t2, FieldMemOperand(a3, FixedArray::kLengthOffset)); 5407 __ sw(t2, FieldMemOperand(a3, FixedArray::kLengthOffset));
5408 // Fill contents of fixed-array with the-hole. 5408 // Fill contents of fixed-array with undefined.
5409 __ li(a2, Operand(masm->isolate()->factory()->the_hole_value())); 5409 __ LoadRoot(a2, Heap::kUndefinedValueRootIndex);
5410 __ Addu(a3, a3, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); 5410 __ Addu(a3, a3, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
5411 // Fill fixed array elements with hole. 5411 // Fill fixed array elements with undefined.
5412 // v0: JSArray, tagged. 5412 // v0: JSArray, tagged.
5413 // a2: the hole. 5413 // a2: undefined.
5414 // a3: Start of elements in FixedArray. 5414 // a3: Start of elements in FixedArray.
5415 // t1: Number of elements to fill. 5415 // t1: Number of elements to fill.
5416 Label loop; 5416 Label loop;
5417 __ sll(t1, t1, kPointerSizeLog2); // Convert num elements to num bytes. 5417 __ sll(t1, t1, kPointerSizeLog2); // Convert num elements to num bytes.
5418 __ addu(t1, t1, a3); // Point past last element to store. 5418 __ addu(t1, t1, a3); // Point past last element to store.
5419 __ bind(&loop); 5419 __ bind(&loop);
5420 __ Branch(&done, ge, a3, Operand(t1)); // Break when a3 past end of elem. 5420 __ Branch(&done, ge, a3, Operand(t1)); // Break when a3 past end of elem.
5421 __ sw(a2, MemOperand(a3)); 5421 __ sw(a2, MemOperand(a3));
5422 __ Branch(&loop, USE_DELAY_SLOT); 5422 __ Branch(&loop, USE_DELAY_SLOT);
5423 __ addiu(a3, a3, kPointerSize); // In branch delay slot. 5423 __ addiu(a3, a3, kPointerSize); // In branch delay slot.
(...skipping 2402 matching lines...) Expand 10 before | Expand all | Expand 10 after
7826 __ Pop(ra, t1, a1); 7826 __ Pop(ra, t1, a1);
7827 __ Ret(); 7827 __ Ret();
7828 } 7828 }
7829 7829
7830 7830
7831 #undef __ 7831 #undef __
7832 7832
7833 } } // namespace v8::internal 7833 } } // namespace v8::internal
7834 7834
7835 #endif // V8_TARGET_ARCH_MIPS 7835 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/regexp.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698