OLD | NEW |
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_STUB_CACHE_H_ | 5 #ifndef V8_STUB_CACHE_H_ |
6 #define V8_STUB_CACHE_H_ | 6 #define V8_STUB_CACHE_H_ |
7 | 7 |
8 #include "src/macro-assembler.h" | 8 #include "src/macro-assembler.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 17 matching lines...) Expand all Loading... |
28 Address address_; | 28 Address address_; |
29 | 29 |
30 friend class StubCache; | 30 friend class StubCache; |
31 }; | 31 }; |
32 | 32 |
33 | 33 |
34 class StubCache { | 34 class StubCache { |
35 public: | 35 public: |
36 struct Entry { | 36 struct Entry { |
37 Name* key; | 37 Name* key; |
38 Code* value; | 38 Object* value; |
39 Map* map; | 39 Map* map; |
40 }; | 40 }; |
41 | 41 |
42 void Initialize(); | 42 void Initialize(); |
43 // Access cache for entry hash(name, map). | 43 // Access cache for entry hash(name, map). |
44 Code* Set(Name* name, Map* map, Code* code); | 44 Object* Set(Name* name, Map* map, Object* handler); |
45 Code* Get(Name* name, Map* map); | 45 Object* Get(Name* name, Map* map); |
46 // Clear the lookup table (@ mark compact collection). | 46 // Clear the lookup table (@ mark compact collection). |
47 void Clear(); | 47 void Clear(); |
48 // Collect all maps that match the name. | 48 // Collect all maps that match the name. |
49 void CollectMatchingMaps(SmallMapList* types, Handle<Name> name, | 49 void CollectMatchingMaps(SmallMapList* types, Handle<Name> name, |
50 Handle<Context> native_context, Zone* zone); | 50 Handle<Context> native_context, Zone* zone); |
51 // Generate code for probing the stub cache table. | 51 // Generate code for probing the stub cache table. |
52 // Arguments extra, extra2 and extra3 may be used to pass additional scratch | 52 // Arguments extra, extra2 and extra3 may be used to pass additional scratch |
53 // registers. Set to no_reg if not needed. | 53 // registers. Set to no_reg if not needed. |
54 // If leave_frame is true, then exit a frame before the tail call. | 54 // If leave_frame is true, then exit a frame before the tail call. |
55 void GenerateProbe(MacroAssembler* masm, Register receiver, Register name, | 55 void GenerateProbe(MacroAssembler* masm, Register receiver, Register name, |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 | 168 |
169 friend class Isolate; | 169 friend class Isolate; |
170 friend class SCTableReference; | 170 friend class SCTableReference; |
171 | 171 |
172 DISALLOW_COPY_AND_ASSIGN(StubCache); | 172 DISALLOW_COPY_AND_ASSIGN(StubCache); |
173 }; | 173 }; |
174 } // namespace internal | 174 } // namespace internal |
175 } // namespace v8 | 175 } // namespace v8 |
176 | 176 |
177 #endif // V8_STUB_CACHE_H_ | 177 #endif // V8_STUB_CACHE_H_ |
OLD | NEW |