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

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

Issue 7971009: Add kHeaderSize constant to SeqString. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments by Lasse Reichstein. Created 9 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/code-stubs-arm.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 4703 matching lines...) Expand 10 before | Expand all | Expand 10 after
4714 __ addu(a0, a0, a2); 4714 __ addu(a0, a0, a2);
4715 __ sw(a0, MemOperand(sp, 2 * kPointerSize)); 4715 __ sw(a0, MemOperand(sp, 2 * kPointerSize));
4716 4716
4717 // Argument 5: static offsets vector buffer. 4717 // Argument 5: static offsets vector buffer.
4718 __ li(a0, Operand( 4718 __ li(a0, Operand(
4719 ExternalReference::address_of_static_offsets_vector(masm->isolate()))); 4719 ExternalReference::address_of_static_offsets_vector(masm->isolate())));
4720 __ sw(a0, MemOperand(sp, 1 * kPointerSize)); 4720 __ sw(a0, MemOperand(sp, 1 * kPointerSize));
4721 4721
4722 // For arguments 4 and 3 get string length, calculate start of string data 4722 // For arguments 4 and 3 get string length, calculate start of string data
4723 // and calculate the shift of the index (0 for ASCII and 1 for two byte). 4723 // and calculate the shift of the index (0 for ASCII and 1 for two byte).
4724 STATIC_ASSERT(SeqAsciiString::kHeaderSize == SeqTwoByteString::kHeaderSize); 4724 __ Addu(t2, subject, Operand(SeqString::kHeaderSize - kHeapObjectTag));
4725 __ Addu(t2, subject, Operand(SeqAsciiString::kHeaderSize - kHeapObjectTag));
4726 __ Xor(a3, a3, Operand(1)); // 1 for 2-byte str, 0 for 1-byte. 4725 __ Xor(a3, a3, Operand(1)); // 1 for 2-byte str, 0 for 1-byte.
4727 // Load the length from the original subject string from the previous stack 4726 // Load the length from the original subject string from the previous stack
4728 // frame. Therefore we have to use fp, which points exactly to two pointer 4727 // frame. Therefore we have to use fp, which points exactly to two pointer
4729 // sizes below the previous sp. (Because creating a new stack frame pushes 4728 // sizes below the previous sp. (Because creating a new stack frame pushes
4730 // the previous fp onto the stack and moves up sp by 2 * kPointerSize.) 4729 // the previous fp onto the stack and moves up sp by 2 * kPointerSize.)
4731 __ lw(subject, MemOperand(fp, kSubjectOffset + 2 * kPointerSize)); 4730 __ lw(subject, MemOperand(fp, kSubjectOffset + 2 * kPointerSize));
4732 // If slice offset is not 0, load the length from the original sliced string. 4731 // If slice offset is not 0, load the length from the original sliced string.
4733 // Argument 4, a3: End of string data 4732 // Argument 4, a3: End of string data
4734 // Argument 3, a2: Start of string data 4733 // Argument 3, a2: Start of string data
4735 // Prepare start and end index of the input. 4734 // Prepare start and end index of the input.
(...skipping 2285 matching lines...) Expand 10 before | Expand all | Expand 10 after
7021 __ mov(result, zero_reg); 7020 __ mov(result, zero_reg);
7022 __ Ret(); 7021 __ Ret();
7023 } 7022 }
7024 7023
7025 7024
7026 #undef __ 7025 #undef __
7027 7026
7028 } } // namespace v8::internal 7027 } } // namespace v8::internal
7029 7028
7030 #endif // V8_TARGET_ARCH_MIPS 7029 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/arm/code-stubs-arm.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698