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

Side by Side Diff: src/arm/code-stubs-arm.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, 7 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/api.cc ('k') | src/heap.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 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 5932 matching lines...) Expand 10 before | Expand all | Expand 10 after
5943 // Fill the fields of the cons string. 5943 // Fill the fields of the cons string.
5944 __ str(r0, FieldMemOperand(r7, ConsString::kFirstOffset)); 5944 __ str(r0, FieldMemOperand(r7, ConsString::kFirstOffset));
5945 __ str(r1, FieldMemOperand(r7, ConsString::kSecondOffset)); 5945 __ str(r1, FieldMemOperand(r7, ConsString::kSecondOffset));
5946 __ mov(r0, Operand(r7)); 5946 __ mov(r0, Operand(r7));
5947 __ IncrementCounter(counters->string_add_native(), 1, r2, r3); 5947 __ IncrementCounter(counters->string_add_native(), 1, r2, r3);
5948 __ add(sp, sp, Operand(2 * kPointerSize)); 5948 __ add(sp, sp, Operand(2 * kPointerSize));
5949 __ Ret(); 5949 __ Ret();
5950 5950
5951 __ bind(&non_ascii); 5951 __ bind(&non_ascii);
5952 // At least one of the strings is two-byte. Check whether it happens 5952 // At least one of the strings is two-byte. Check whether it happens
5953 // to contain only ASCII characters. 5953 // to contain only one byte characters.
5954 // r4: first instance type. 5954 // r4: first instance type.
5955 // r5: second instance type. 5955 // r5: second instance type.
5956 __ tst(r4, Operand(kAsciiDataHintMask)); 5956 __ tst(r4, Operand(kOneByteDataHintMask));
5957 __ tst(r5, Operand(kAsciiDataHintMask), ne); 5957 __ tst(r5, Operand(kOneByteDataHintMask), ne);
5958 __ b(ne, &ascii_data); 5958 __ b(ne, &ascii_data);
5959 __ eor(r4, r4, Operand(r5)); 5959 __ eor(r4, r4, Operand(r5));
5960 STATIC_ASSERT(kOneByteStringTag != 0 && kAsciiDataHintTag != 0); 5960 STATIC_ASSERT(kOneByteStringTag != 0 && kOneByteDataHintTag != 0);
5961 __ and_(r4, r4, Operand(kOneByteStringTag | kAsciiDataHintTag)); 5961 __ and_(r4, r4, Operand(kOneByteStringTag | kOneByteDataHintTag));
5962 __ cmp(r4, Operand(kOneByteStringTag | kAsciiDataHintTag)); 5962 __ cmp(r4, Operand(kOneByteStringTag | kOneByteDataHintTag));
5963 __ b(eq, &ascii_data); 5963 __ b(eq, &ascii_data);
5964 5964
5965 // Allocate a two byte cons string. 5965 // Allocate a two byte cons string.
5966 __ AllocateTwoByteConsString(r7, r6, r4, r5, &call_runtime); 5966 __ AllocateTwoByteConsString(r7, r6, r4, r5, &call_runtime);
5967 __ jmp(&allocated); 5967 __ jmp(&allocated);
5968 5968
5969 // We cannot encounter sliced strings or cons strings here since: 5969 // We cannot encounter sliced strings or cons strings here since:
5970 STATIC_ASSERT(SlicedString::kMinLength >= ConsString::kMinLength); 5970 STATIC_ASSERT(SlicedString::kMinLength >= ConsString::kMinLength);
5971 // Handle creating a flat result from either external or sequential strings. 5971 // Handle creating a flat result from either external or sequential strings.
5972 // Locate the first characters' locations. 5972 // Locate the first characters' locations.
(...skipping 1388 matching lines...) Expand 10 before | Expand all | Expand 10 after
7361 __ Jump(generic_construct_stub, RelocInfo::CODE_TARGET); 7361 __ Jump(generic_construct_stub, RelocInfo::CODE_TARGET);
7362 } 7362 }
7363 } 7363 }
7364 7364
7365 7365
7366 #undef __ 7366 #undef __
7367 7367
7368 } } // namespace v8::internal 7368 } } // namespace v8::internal
7369 7369
7370 #endif // V8_TARGET_ARCH_ARM 7370 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« include/v8.h ('K') | « src/api.cc ('k') | src/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698