OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 V(Map, fixed_double_array_map, FixedDoubleArrayMap) \ | 70 V(Map, fixed_double_array_map, FixedDoubleArrayMap) \ |
71 V(Object, no_interceptor_result_sentinel, NoInterceptorResultSentinel) \ | 71 V(Object, no_interceptor_result_sentinel, NoInterceptorResultSentinel) \ |
72 V(Map, meta_map, MetaMap) \ | 72 V(Map, meta_map, MetaMap) \ |
73 V(Map, hash_table_map, HashTableMap) \ | 73 V(Map, hash_table_map, HashTableMap) \ |
74 V(Smi, stack_limit, StackLimit) \ | 74 V(Smi, stack_limit, StackLimit) \ |
75 V(FixedArray, number_string_cache, NumberStringCache) \ | 75 V(FixedArray, number_string_cache, NumberStringCache) \ |
76 V(Object, instanceof_cache_function, InstanceofCacheFunction) \ | 76 V(Object, instanceof_cache_function, InstanceofCacheFunction) \ |
77 V(Object, instanceof_cache_map, InstanceofCacheMap) \ | 77 V(Object, instanceof_cache_map, InstanceofCacheMap) \ |
78 V(Object, instanceof_cache_answer, InstanceofCacheAnswer) \ | 78 V(Object, instanceof_cache_answer, InstanceofCacheAnswer) \ |
79 V(FixedArray, single_character_string_cache, SingleCharacterStringCache) \ | 79 V(FixedArray, single_character_string_cache, SingleCharacterStringCache) \ |
| 80 V(FixedArray, string_split_cache, StringSplitCache) \ |
80 V(Object, termination_exception, TerminationException) \ | 81 V(Object, termination_exception, TerminationException) \ |
81 V(FixedArray, empty_fixed_array, EmptyFixedArray) \ | 82 V(FixedArray, empty_fixed_array, EmptyFixedArray) \ |
82 V(ByteArray, empty_byte_array, EmptyByteArray) \ | 83 V(ByteArray, empty_byte_array, EmptyByteArray) \ |
83 V(FixedDoubleArray, empty_fixed_double_array, EmptyFixedDoubleArray) \ | 84 V(FixedDoubleArray, empty_fixed_double_array, EmptyFixedDoubleArray) \ |
84 V(String, empty_string, EmptyString) \ | 85 V(String, empty_string, EmptyString) \ |
85 V(DescriptorArray, empty_descriptor_array, EmptyDescriptorArray) \ | 86 V(DescriptorArray, empty_descriptor_array, EmptyDescriptorArray) \ |
86 V(Map, string_map, StringMap) \ | 87 V(Map, string_map, StringMap) \ |
87 V(Map, ascii_string_map, AsciiStringMap) \ | 88 V(Map, ascii_string_map, AsciiStringMap) \ |
88 V(Map, symbol_map, SymbolMap) \ | 89 V(Map, symbol_map, SymbolMap) \ |
89 V(Map, cons_string_map, ConsStringMap) \ | 90 V(Map, cons_string_map, ConsStringMap) \ |
(...skipping 2079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2169 // previous collection and the beginning of the current one. | 2170 // previous collection and the beginning of the current one. |
2170 double spent_in_mutator_; | 2171 double spent_in_mutator_; |
2171 | 2172 |
2172 // Size of objects promoted during the current collection. | 2173 // Size of objects promoted during the current collection. |
2173 intptr_t promoted_objects_size_; | 2174 intptr_t promoted_objects_size_; |
2174 | 2175 |
2175 Heap* heap_; | 2176 Heap* heap_; |
2176 }; | 2177 }; |
2177 | 2178 |
2178 | 2179 |
| 2180 class StringSplitCache { |
| 2181 public: |
| 2182 static Object* Lookup(FixedArray* cache, String* string, String* pattern); |
| 2183 static void Enter(Heap* heap, |
| 2184 FixedArray* cache, |
| 2185 String* string, |
| 2186 String* pattern, |
| 2187 FixedArray* array); |
| 2188 static void Clear(FixedArray* cache); |
| 2189 static const int kStringSplitCacheSize = 0x100; |
| 2190 |
| 2191 private: |
| 2192 static const int kArrayEntriesPerCacheEntry = 4; |
| 2193 static const int kStringOffset = 0; |
| 2194 static const int kPatternOffset = 1; |
| 2195 static const int kArrayOffset = 2; |
| 2196 |
| 2197 static MaybeObject* WrapFixedArrayInJSArray(Object* fixed_array); |
| 2198 }; |
| 2199 |
| 2200 |
2179 class TranscendentalCache { | 2201 class TranscendentalCache { |
2180 public: | 2202 public: |
2181 enum Type {ACOS, ASIN, ATAN, COS, EXP, LOG, SIN, TAN, kNumberOfCaches}; | 2203 enum Type {ACOS, ASIN, ATAN, COS, EXP, LOG, SIN, TAN, kNumberOfCaches}; |
2182 static const int kTranscendentalTypeBits = 3; | 2204 static const int kTranscendentalTypeBits = 3; |
2183 STATIC_ASSERT((1 << kTranscendentalTypeBits) >= kNumberOfCaches); | 2205 STATIC_ASSERT((1 << kTranscendentalTypeBits) >= kNumberOfCaches); |
2184 | 2206 |
2185 // Returns a heap number with f(input), where f is a math function specified | 2207 // Returns a heap number with f(input), where f is a math function specified |
2186 // by the 'type' argument. | 2208 // by the 'type' argument. |
2187 MUST_USE_RESULT inline MaybeObject* Get(Type type, double input); | 2209 MUST_USE_RESULT inline MaybeObject* Get(Type type, double input); |
2188 | 2210 |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2319 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2341 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
2320 }; | 2342 }; |
2321 #endif // DEBUG || LIVE_OBJECT_LIST | 2343 #endif // DEBUG || LIVE_OBJECT_LIST |
2322 | 2344 |
2323 | 2345 |
2324 } } // namespace v8::internal | 2346 } } // namespace v8::internal |
2325 | 2347 |
2326 #undef HEAP | 2348 #undef HEAP |
2327 | 2349 |
2328 #endif // V8_HEAP_H_ | 2350 #endif // V8_HEAP_H_ |
OLD | NEW |