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

Side by Side Diff: src/ia32/codegen-ia32.cc

Issue 552186: ARM: Implement native substring copying. (Closed)
Patch Set: Changed order of tests to bail out earlier on short substrings. Created 10 years, 10 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
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 9950 matching lines...) Expand 10 before | Expand all | Expand 10 after
9961 9961
9962 // eax: result string 9962 // eax: result string
9963 // ecx: result string length 9963 // ecx: result string length
9964 __ mov(edx, esi); // esi used by following code. 9964 __ mov(edx, esi); // esi used by following code.
9965 // Locate first character of result. 9965 // Locate first character of result.
9966 __ mov(edi, eax); 9966 __ mov(edi, eax);
9967 __ add(Operand(edi), 9967 __ add(Operand(edi),
9968 Immediate(SeqTwoByteString::kHeaderSize - kHeapObjectTag)); 9968 Immediate(SeqTwoByteString::kHeaderSize - kHeapObjectTag));
9969 // Load string argument and locate character of sub string start. 9969 // Load string argument and locate character of sub string start.
9970 __ mov(esi, Operand(esp, 3 * kPointerSize)); 9970 __ mov(esi, Operand(esp, 3 * kPointerSize));
9971 __ add(Operand(esi), Immediate(SeqAsciiString::kHeaderSize - kHeapObjectTag)); 9971 __ add(Operand(esi),
9972 Immediate(SeqTwoByteString::kHeaderSize - kHeapObjectTag));
9972 __ mov(ebx, Operand(esp, 2 * kPointerSize)); // from 9973 __ mov(ebx, Operand(esp, 2 * kPointerSize)); // from
9973 // As from is a smi it is 2 times the value which matches the size of a two 9974 // As from is a smi it is 2 times the value which matches the size of a two
9974 // byte character. 9975 // byte character.
9975 ASSERT_EQ(0, kSmiTag); 9976 ASSERT_EQ(0, kSmiTag);
9976 ASSERT_EQ(1, kSmiTagSize + kSmiShiftSize); 9977 ASSERT_EQ(1, kSmiTagSize + kSmiShiftSize);
9977 __ add(esi, Operand(ebx)); 9978 __ add(esi, Operand(ebx));
9978 9979
9979 // eax: result string 9980 // eax: result string
9980 // ecx: result length 9981 // ecx: result length
9981 // edx: original value of esi 9982 // edx: original value of esi
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
10103 10104
10104 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) 10105 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater)
10105 // tagged as a small integer. 10106 // tagged as a small integer.
10106 __ bind(&runtime); 10107 __ bind(&runtime);
10107 __ TailCallRuntime(ExternalReference(Runtime::kStringCompare), 2, 1); 10108 __ TailCallRuntime(ExternalReference(Runtime::kStringCompare), 2, 1);
10108 } 10109 }
10109 10110
10110 #undef __ 10111 #undef __
10111 10112
10112 } } // namespace v8::internal 10113 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698