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

Side by Side Diff: src/heap.h

Issue 10837290: Cache results in SearchRegExpMultiple. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Actually set a limit. Created 8 years, 4 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
« no previous file with comments | « include/v8.h ('k') | src/heap.cc » ('j') | src/runtime.cc » ('J')
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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 V(Oddball, arguments_marker, ArgumentsMarker) \ 80 V(Oddball, arguments_marker, ArgumentsMarker) \
81 /* The first 32 roots above this line should be boring from a GC point of */ \ 81 /* The first 32 roots above this line should be boring from a GC point of */ \
82 /* view. This means they are never in new space and never on a page that */ \ 82 /* view. This means they are never in new space and never on a page that */ \
83 /* is being compacted. */ \ 83 /* is being compacted. */ \
84 V(FixedArray, number_string_cache, NumberStringCache) \ 84 V(FixedArray, number_string_cache, NumberStringCache) \
85 V(Object, instanceof_cache_function, InstanceofCacheFunction) \ 85 V(Object, instanceof_cache_function, InstanceofCacheFunction) \
86 V(Object, instanceof_cache_map, InstanceofCacheMap) \ 86 V(Object, instanceof_cache_map, InstanceofCacheMap) \
87 V(Object, instanceof_cache_answer, InstanceofCacheAnswer) \ 87 V(Object, instanceof_cache_answer, InstanceofCacheAnswer) \
88 V(FixedArray, single_character_string_cache, SingleCharacterStringCache) \ 88 V(FixedArray, single_character_string_cache, SingleCharacterStringCache) \
89 V(FixedArray, string_split_cache, StringSplitCache) \ 89 V(FixedArray, string_split_cache, StringSplitCache) \
90 V(FixedArray, regexp_multiple_cache, RegExpMultipleCache) \
90 V(Object, termination_exception, TerminationException) \ 91 V(Object, termination_exception, TerminationException) \
91 V(Smi, hash_seed, HashSeed) \ 92 V(Smi, hash_seed, HashSeed) \
92 V(Map, string_map, StringMap) \ 93 V(Map, string_map, StringMap) \
93 V(Map, symbol_map, SymbolMap) \ 94 V(Map, symbol_map, SymbolMap) \
94 V(Map, cons_string_map, ConsStringMap) \ 95 V(Map, cons_string_map, ConsStringMap) \
95 V(Map, cons_ascii_string_map, ConsAsciiStringMap) \ 96 V(Map, cons_ascii_string_map, ConsAsciiStringMap) \
96 V(Map, sliced_string_map, SlicedStringMap) \ 97 V(Map, sliced_string_map, SlicedStringMap) \
97 V(Map, sliced_ascii_string_map, SlicedAsciiStringMap) \ 98 V(Map, sliced_ascii_string_map, SlicedAsciiStringMap) \
98 V(Map, cons_symbol_map, ConsSymbolMap) \ 99 V(Map, cons_symbol_map, ConsSymbolMap) \
99 V(Map, cons_ascii_symbol_map, ConsAsciiSymbolMap) \ 100 V(Map, cons_ascii_symbol_map, ConsAsciiSymbolMap) \
(...skipping 2464 matching lines...) Expand 10 before | Expand all | Expand 10 after
2564 int steps_count_since_last_gc_; 2565 int steps_count_since_last_gc_;
2565 double steps_took_since_last_gc_; 2566 double steps_took_since_last_gc_;
2566 2567
2567 Heap* heap_; 2568 Heap* heap_;
2568 2569
2569 const char* gc_reason_; 2570 const char* gc_reason_;
2570 const char* collector_reason_; 2571 const char* collector_reason_;
2571 }; 2572 };
2572 2573
2573 2574
2574 class StringSplitCache { 2575 class RegExpResultsCache {
ulan 2012/08/28 08:44:03 Can we introduce a parameter for this class or its
2575 public: 2576 public:
2576 static Object* Lookup(FixedArray* cache, String* string, String* pattern); 2577 static Object* Lookup(FixedArray* cache, String* string, Object* pattern);
2577 static void Enter(Heap* heap, 2578 static void Enter(Heap* heap,
ulan 2012/08/28 08:44:03 Can we add high level comments for these functions
2578 FixedArray* cache, 2579 FixedArray* cache,
2579 String* string, 2580 String* string,
2580 String* pattern, 2581 Object* pattern,
2581 FixedArray* array); 2582 FixedArray* array);
2582 static void Clear(FixedArray* cache); 2583 static void Clear(FixedArray* cache);
2583 static const int kStringSplitCacheSize = 0x100; 2584 static const int kRegExpResultsCacheSize = 0x100;
2584 2585
2585 private: 2586 private:
2586 static const int kArrayEntriesPerCacheEntry = 4; 2587 static const int kArrayEntriesPerCacheEntry = 4;
2587 static const int kStringOffset = 0; 2588 static const int kStringOffset = 0;
2588 static const int kPatternOffset = 1; 2589 static const int kPatternOffset = 1;
2589 static const int kArrayOffset = 2; 2590 static const int kArrayOffset = 2;
2590
2591 static MaybeObject* WrapFixedArrayInJSArray(Object* fixed_array);
2592 }; 2591 };
2593 2592
2594 2593
2595 class TranscendentalCache { 2594 class TranscendentalCache {
2596 public: 2595 public:
2597 enum Type {ACOS, ASIN, ATAN, COS, EXP, LOG, SIN, TAN, kNumberOfCaches}; 2596 enum Type {ACOS, ASIN, ATAN, COS, EXP, LOG, SIN, TAN, kNumberOfCaches};
2598 static const int kTranscendentalTypeBits = 3; 2597 static const int kTranscendentalTypeBits = 3;
2599 STATIC_ASSERT((1 << kTranscendentalTypeBits) >= kNumberOfCaches); 2598 STATIC_ASSERT((1 << kTranscendentalTypeBits) >= kNumberOfCaches);
2600 2599
2601 // Returns a heap number with f(input), where f is a math function specified 2600 // Returns a heap number with f(input), where f is a math function specified
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
2773 AssertNoAllocation no_alloc; // i.e. no gc allowed. 2772 AssertNoAllocation no_alloc; // i.e. no gc allowed.
2774 2773
2775 private: 2774 private:
2776 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 2775 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
2777 }; 2776 };
2778 #endif // DEBUG || LIVE_OBJECT_LIST 2777 #endif // DEBUG || LIVE_OBJECT_LIST
2779 2778
2780 } } // namespace v8::internal 2779 } } // namespace v8::internal
2781 2780
2782 #endif // V8_HEAP_H_ 2781 #endif // V8_HEAP_H_
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/heap.cc » ('j') | src/runtime.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698