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

Side by Side Diff: src/assembler.cc

Issue 2814373002: [string] Widen StringIndexOf fast path (Closed)
Patch Set: Address comments Created 3 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
« no previous file with comments | « src/assembler.h ('k') | src/builtins/builtins-string-gen.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 (c) 1994-2006 Sun Microsystems Inc. 1 // Copyright (c) 1994-2006 Sun Microsystems Inc.
2 // All Rights Reserved. 2 // All Rights Reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // - Redistributions of source code must retain the above copyright notice, 8 // - Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer. 9 // this list of conditions and the following disclaimer.
10 // 10 //
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 #include "src/ic/stub-cache.h" 56 #include "src/ic/stub-cache.h"
57 #include "src/interpreter/interpreter.h" 57 #include "src/interpreter/interpreter.h"
58 #include "src/ostreams.h" 58 #include "src/ostreams.h"
59 #include "src/regexp/jsregexp.h" 59 #include "src/regexp/jsregexp.h"
60 #include "src/regexp/regexp-macro-assembler.h" 60 #include "src/regexp/regexp-macro-assembler.h"
61 #include "src/regexp/regexp-stack.h" 61 #include "src/regexp/regexp-stack.h"
62 #include "src/register-configuration.h" 62 #include "src/register-configuration.h"
63 #include "src/runtime/runtime.h" 63 #include "src/runtime/runtime.h"
64 #include "src/simulator.h" // For flushing instruction cache. 64 #include "src/simulator.h" // For flushing instruction cache.
65 #include "src/snapshot/serializer-common.h" 65 #include "src/snapshot/serializer-common.h"
66 #include "src/string-search.h"
66 #include "src/wasm/wasm-external-refs.h" 67 #include "src/wasm/wasm-external-refs.h"
67 68
68 // Include native regexp-macro-assembler. 69 // Include native regexp-macro-assembler.
69 #ifndef V8_INTERPRETED_REGEXP 70 #ifndef V8_INTERPRETED_REGEXP
70 #if V8_TARGET_ARCH_IA32 71 #if V8_TARGET_ARCH_IA32
71 #include "src/regexp/ia32/regexp-macro-assembler-ia32.h" // NOLINT 72 #include "src/regexp/ia32/regexp-macro-assembler-ia32.h" // NOLINT
72 #elif V8_TARGET_ARCH_X64 73 #elif V8_TARGET_ARCH_X64
73 #include "src/regexp/x64/regexp-macro-assembler-x64.h" // NOLINT 74 #include "src/regexp/x64/regexp-macro-assembler-x64.h" // NOLINT
74 #elif V8_TARGET_ARCH_ARM64 75 #elif V8_TARGET_ARCH_ARM64
75 #include "src/regexp/arm64/regexp-macro-assembler-arm64.h" // NOLINT 76 #include "src/regexp/arm64/regexp-macro-assembler-arm64.h" // NOLINT
(...skipping 1479 matching lines...) Expand 10 before | Expand all | Expand 10 after
1555 1556
1556 void* libc_memset(void* dest, int byte, size_t n) { 1557 void* libc_memset(void* dest, int byte, size_t n) {
1557 DCHECK_EQ(static_cast<char>(byte), byte); 1558 DCHECK_EQ(static_cast<char>(byte), byte);
1558 return memset(dest, byte, n); 1559 return memset(dest, byte, n);
1559 } 1560 }
1560 1561
1561 ExternalReference ExternalReference::libc_memset_function(Isolate* isolate) { 1562 ExternalReference ExternalReference::libc_memset_function(Isolate* isolate) {
1562 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(libc_memset))); 1563 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(libc_memset)));
1563 } 1564 }
1564 1565
1566 template <typename SubjectChar, typename PatternChar>
1567 ExternalReference ExternalReference::search_string_raw(Isolate* isolate) {
1568 auto f = SearchStringRaw<SubjectChar, PatternChar>;
1569 return ExternalReference(Redirect(isolate, FUNCTION_ADDR(f)));
1570 }
1571
1565 ExternalReference ExternalReference::try_internalize_string_function( 1572 ExternalReference ExternalReference::try_internalize_string_function(
1566 Isolate* isolate) { 1573 Isolate* isolate) {
1567 return ExternalReference(Redirect( 1574 return ExternalReference(Redirect(
1568 isolate, FUNCTION_ADDR(StringTable::LookupStringIfExists_NoAllocate))); 1575 isolate, FUNCTION_ADDR(StringTable::LookupStringIfExists_NoAllocate)));
1569 } 1576 }
1570 1577
1578 // Explicit instantiations for all combinations of 1- and 2-byte strings.
1579 template ExternalReference
1580 ExternalReference::search_string_raw<const uint8_t, const uint8_t>(Isolate*);
1581 template ExternalReference
1582 ExternalReference::search_string_raw<const uint8_t, const uc16>(Isolate*);
1583 template ExternalReference
1584 ExternalReference::search_string_raw<const uc16, const uint8_t>(Isolate*);
1585 template ExternalReference
1586 ExternalReference::search_string_raw<const uc16, const uc16>(Isolate*);
1587
1571 ExternalReference ExternalReference::page_flags(Page* page) { 1588 ExternalReference ExternalReference::page_flags(Page* page) {
1572 return ExternalReference(reinterpret_cast<Address>(page) + 1589 return ExternalReference(reinterpret_cast<Address>(page) +
1573 MemoryChunk::kFlagsOffset); 1590 MemoryChunk::kFlagsOffset);
1574 } 1591 }
1575 1592
1576 1593
1577 ExternalReference ExternalReference::ForDeoptEntry(Address entry) { 1594 ExternalReference ExternalReference::ForDeoptEntry(Address entry) {
1578 return ExternalReference(entry); 1595 return ExternalReference(entry);
1579 } 1596 }
1580 1597
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
1948 1965
1949 1966
1950 void Assembler::DataAlign(int m) { 1967 void Assembler::DataAlign(int m) {
1951 DCHECK(m >= 2 && base::bits::IsPowerOfTwo32(m)); 1968 DCHECK(m >= 2 && base::bits::IsPowerOfTwo32(m));
1952 while ((pc_offset() & (m - 1)) != 0) { 1969 while ((pc_offset() & (m - 1)) != 0) {
1953 db(0); 1970 db(0);
1954 } 1971 }
1955 } 1972 }
1956 } // namespace internal 1973 } // namespace internal
1957 } // namespace v8 1974 } // namespace v8
OLDNEW
« no previous file with comments | « src/assembler.h ('k') | src/builtins/builtins-string-gen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698