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

Side by Side Diff: src/objects.h

Issue 1563005: Introduce fast native caches and use it in String.search. (Closed)
Patch Set: Last round :) Created 10 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/macros.py ('k') | src/runtime.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 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 // - FixedArray 69 // - FixedArray
70 // - DescriptorArray 70 // - DescriptorArray
71 // - HashTable 71 // - HashTable
72 // - Dictionary 72 // - Dictionary
73 // - SymbolTable 73 // - SymbolTable
74 // - CompilationCacheTable 74 // - CompilationCacheTable
75 // - CodeCacheHashTable 75 // - CodeCacheHashTable
76 // - MapCache 76 // - MapCache
77 // - Context 77 // - Context
78 // - GlobalContext 78 // - GlobalContext
79 // - JSFunctionResultCache
79 // - String 80 // - String
80 // - SeqString 81 // - SeqString
81 // - SeqAsciiString 82 // - SeqAsciiString
82 // - SeqTwoByteString 83 // - SeqTwoByteString
83 // - ConsString 84 // - ConsString
84 // - ExternalString 85 // - ExternalString
85 // - ExternalAsciiString 86 // - ExternalAsciiString
86 // - ExternalTwoByteString 87 // - ExternalTwoByteString
87 // - HeapNumber 88 // - HeapNumber
88 // - Code 89 // - Code
(...skipping 2211 matching lines...) Expand 10 before | Expand all | Expand 10 after
2300 // Remove all entries were key is a number and (from <= key && key < to). 2301 // Remove all entries were key is a number and (from <= key && key < to).
2301 void RemoveNumberEntries(uint32_t from, uint32_t to); 2302 void RemoveNumberEntries(uint32_t from, uint32_t to);
2302 2303
2303 // Bit masks. 2304 // Bit masks.
2304 static const int kRequiresSlowElementsMask = 1; 2305 static const int kRequiresSlowElementsMask = 1;
2305 static const int kRequiresSlowElementsTagSize = 1; 2306 static const int kRequiresSlowElementsTagSize = 1;
2306 static const uint32_t kRequiresSlowElementsLimit = (1 << 29) - 1; 2307 static const uint32_t kRequiresSlowElementsLimit = (1 << 29) - 1;
2307 }; 2308 };
2308 2309
2309 2310
2311 // JSFunctionResultCache caches results of some JSFunction invocation.
2312 // It is a fixed array with fixed structure:
2313 // [0]: factory function
2314 // [1]: finger index
2315 // [2]: current cache size
2316 // [3]: dummy field.
2317 // The rest of array are key/value pairs.
2318 class JSFunctionResultCache: public FixedArray {
2319 public:
2320 static const int kFactoryIndex = 0;
2321 static const int kFingerIndex = kFactoryIndex + 1;
2322 static const int kCacheSizeIndex = kFingerIndex + 1;
2323 static const int kDummyIndex = kCacheSizeIndex + 1;
2324 static const int kEntriesIndex = kDummyIndex + 1;
2325 };
2326
2327
2310 // ByteArray represents fixed sized byte arrays. Used by the outside world, 2328 // ByteArray represents fixed sized byte arrays. Used by the outside world,
2311 // such as PCRE, and also by the memory allocator and garbage collector to 2329 // such as PCRE, and also by the memory allocator and garbage collector to
2312 // fill in free blocks in the heap. 2330 // fill in free blocks in the heap.
2313 class ByteArray: public Array { 2331 class ByteArray: public Array {
2314 public: 2332 public:
2315 // Setter and getter. 2333 // Setter and getter.
2316 inline byte get(int index); 2334 inline byte get(int index);
2317 inline void set(int index, byte value); 2335 inline void set(int index, byte value);
2318 2336
2319 // Treat contents as an int array. 2337 // Treat contents as an int array.
(...skipping 2781 matching lines...) Expand 10 before | Expand all | Expand 10 after
5101 } else { 5119 } else {
5102 value &= ~(1 << bit_position); 5120 value &= ~(1 << bit_position);
5103 } 5121 }
5104 return value; 5122 return value;
5105 } 5123 }
5106 }; 5124 };
5107 5125
5108 } } // namespace v8::internal 5126 } } // namespace v8::internal
5109 5127
5110 #endif // V8_OBJECTS_H_ 5128 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/macros.py ('k') | src/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698