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

Side by Side Diff: src/heap/heap.h

Issue 1288413002: Make some foo.h headers usable without foo-inl.h header. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments. Created 5 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
« no previous file with comments | « no previous file | src/heap/heap-inl.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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_HEAP_HEAP_H_ 5 #ifndef V8_HEAP_HEAP_H_
6 #define V8_HEAP_HEAP_H_ 6 #define V8_HEAP_HEAP_H_
7 7
8 #include <cmath> 8 #include <cmath>
9 #include <map> 9 #include <map>
10 10
(...skipping 2611 matching lines...) Expand 10 before | Expand all | Expand 10 after
2622 2622
2623 2623
2624 // Cache for mapping (map, property name) into descriptor index. 2624 // Cache for mapping (map, property name) into descriptor index.
2625 // The cache contains both positive and negative results. 2625 // The cache contains both positive and negative results.
2626 // Descriptor index equals kNotFound means the property is absent. 2626 // Descriptor index equals kNotFound means the property is absent.
2627 // Cleared at startup and prior to any gc. 2627 // Cleared at startup and prior to any gc.
2628 class DescriptorLookupCache { 2628 class DescriptorLookupCache {
2629 public: 2629 public:
2630 // Lookup descriptor index for (map, name). 2630 // Lookup descriptor index for (map, name).
2631 // If absent, kAbsent is returned. 2631 // If absent, kAbsent is returned.
2632 int Lookup(Map* source, Name* name) { 2632 inline int Lookup(Map* source, Name* name);
2633 if (!name->IsUniqueName()) return kAbsent;
2634 int index = Hash(source, name);
2635 Key& key = keys_[index];
2636 if ((key.source == source) && (key.name == name)) return results_[index];
2637 return kAbsent;
2638 }
2639 2633
2640 // Update an element in the cache. 2634 // Update an element in the cache.
2641 void Update(Map* source, Name* name, int result) { 2635 inline void Update(Map* source, Name* name, int result);
2642 DCHECK(result != kAbsent);
2643 if (name->IsUniqueName()) {
2644 int index = Hash(source, name);
2645 Key& key = keys_[index];
2646 key.source = source;
2647 key.name = name;
2648 results_[index] = result;
2649 }
2650 }
2651 2636
2652 // Clear the cache. 2637 // Clear the cache.
2653 void Clear(); 2638 void Clear();
2654 2639
2655 static const int kAbsent = -2; 2640 static const int kAbsent = -2;
2656 2641
2657 private: 2642 private:
2658 DescriptorLookupCache() { 2643 DescriptorLookupCache() {
2659 for (int i = 0; i < kLength; ++i) { 2644 for (int i = 0; i < kLength; ++i) {
2660 keys_[i].source = NULL; 2645 keys_[i].source = NULL;
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
2778 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. 2763 DisallowHeapAllocation no_allocation; // i.e. no gc allowed.
2779 2764
2780 private: 2765 private:
2781 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 2766 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
2782 }; 2767 };
2783 #endif // DEBUG 2768 #endif // DEBUG
2784 } 2769 }
2785 } // namespace v8::internal 2770 } // namespace v8::internal
2786 2771
2787 #endif // V8_HEAP_HEAP_H_ 2772 #endif // V8_HEAP_HEAP_H_
OLDNEW
« no previous file with comments | « no previous file | src/heap/heap-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698