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

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

Issue 14509012: HasOnlyAsciiChars can return incorrect results. Fixup usages and rename. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fixed typo Created 7 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
« include/v8.h ('K') | « src/heap.cc ('k') | src/log.cc » ('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 5810 matching lines...) Expand 10 before | Expand all | Expand 10 after
5821 __ mov(FieldOperand(ecx, ConsString::kLengthOffset), ebx); 5821 __ mov(FieldOperand(ecx, ConsString::kLengthOffset), ebx);
5822 __ mov(FieldOperand(ecx, ConsString::kHashFieldOffset), 5822 __ mov(FieldOperand(ecx, ConsString::kHashFieldOffset),
5823 Immediate(String::kEmptyHashField)); 5823 Immediate(String::kEmptyHashField));
5824 __ mov(FieldOperand(ecx, ConsString::kFirstOffset), eax); 5824 __ mov(FieldOperand(ecx, ConsString::kFirstOffset), eax);
5825 __ mov(FieldOperand(ecx, ConsString::kSecondOffset), edx); 5825 __ mov(FieldOperand(ecx, ConsString::kSecondOffset), edx);
5826 __ mov(eax, ecx); 5826 __ mov(eax, ecx);
5827 __ IncrementCounter(counters->string_add_native(), 1); 5827 __ IncrementCounter(counters->string_add_native(), 1);
5828 __ ret(2 * kPointerSize); 5828 __ ret(2 * kPointerSize);
5829 __ bind(&non_ascii); 5829 __ bind(&non_ascii);
5830 // At least one of the strings is two-byte. Check whether it happens 5830 // At least one of the strings is two-byte. Check whether it happens
5831 // to contain only ASCII characters. 5831 // to contain only one byte characters.
5832 // ecx: first instance type AND second instance type. 5832 // ecx: first instance type AND second instance type.
5833 // edi: second instance type. 5833 // edi: second instance type.
5834 __ test(ecx, Immediate(kAsciiDataHintMask)); 5834 __ test(ecx, Immediate(kOneByteDataHintMask));
5835 __ j(not_zero, &ascii_data); 5835 __ j(not_zero, &ascii_data);
5836 __ mov(ecx, FieldOperand(eax, HeapObject::kMapOffset)); 5836 __ mov(ecx, FieldOperand(eax, HeapObject::kMapOffset));
5837 __ movzx_b(ecx, FieldOperand(ecx, Map::kInstanceTypeOffset)); 5837 __ movzx_b(ecx, FieldOperand(ecx, Map::kInstanceTypeOffset));
5838 __ xor_(edi, ecx); 5838 __ xor_(edi, ecx);
5839 STATIC_ASSERT(kOneByteStringTag != 0 && kAsciiDataHintTag != 0); 5839 STATIC_ASSERT(kOneByteStringTag != 0 && kOneByteDataHintTag != 0);
5840 __ and_(edi, kOneByteStringTag | kAsciiDataHintTag); 5840 __ and_(edi, kOneByteStringTag | kOneByteDataHintTag);
5841 __ cmp(edi, kOneByteStringTag | kAsciiDataHintTag); 5841 __ cmp(edi, kOneByteStringTag | kOneByteDataHintTag);
5842 __ j(equal, &ascii_data); 5842 __ j(equal, &ascii_data);
5843 // Allocate a two byte cons string. 5843 // Allocate a two byte cons string.
5844 __ AllocateTwoByteConsString(ecx, edi, no_reg, &call_runtime); 5844 __ AllocateTwoByteConsString(ecx, edi, no_reg, &call_runtime);
5845 __ jmp(&allocated); 5845 __ jmp(&allocated);
5846 5846
5847 // We cannot encounter sliced strings or cons strings here since: 5847 // We cannot encounter sliced strings or cons strings here since:
5848 STATIC_ASSERT(SlicedString::kMinLength >= ConsString::kMinLength); 5848 STATIC_ASSERT(SlicedString::kMinLength >= ConsString::kMinLength);
5849 // Handle creating a flat result from either external or sequential strings. 5849 // Handle creating a flat result from either external or sequential strings.
5850 // Locate the first characters' locations. 5850 // Locate the first characters' locations.
5851 // eax: first string 5851 // eax: first string
(...skipping 2074 matching lines...) Expand 10 before | Expand all | Expand 10 after
7926 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET); 7926 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET);
7927 } 7927 }
7928 } 7928 }
7929 7929
7930 7930
7931 #undef __ 7931 #undef __
7932 7932
7933 } } // namespace v8::internal 7933 } } // namespace v8::internal
7934 7934
7935 #endif // V8_TARGET_ARCH_IA32 7935 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« include/v8.h ('K') | « src/heap.cc ('k') | src/log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698