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 30 matching lines...) Expand all Loading... |
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 Object* Set(Name* name, Map* map, Object* handler); | 44 Object* Set(Name* name, Map* map, Object* handler); |
45 Object* 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. | |
52 // Arguments extra, extra2 and extra3 may be used to pass additional scratch | |
53 // registers. Set to no_reg if not needed. | |
54 // If leave_frame is true, then exit a frame before the tail call. | |
55 void GenerateProbe(MacroAssembler* masm, Register receiver, Register name, | |
56 Register scratch, Register extra, Register extra2 = no_reg, | |
57 Register extra3 = no_reg); | |
58 | 51 |
59 enum Table { kPrimary, kSecondary }; | 52 enum Table { kPrimary, kSecondary }; |
60 | 53 |
61 SCTableReference key_reference(StubCache::Table table) { | 54 SCTableReference key_reference(StubCache::Table table) { |
62 return SCTableReference( | 55 return SCTableReference( |
63 reinterpret_cast<Address>(&first_entry(table)->key)); | 56 reinterpret_cast<Address>(&first_entry(table)->key)); |
64 } | 57 } |
65 | 58 |
66 SCTableReference map_reference(StubCache::Table table) { | 59 SCTableReference map_reference(StubCache::Table table) { |
67 return SCTableReference( | 60 return SCTableReference( |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 | 161 |
169 friend class Isolate; | 162 friend class Isolate; |
170 friend class SCTableReference; | 163 friend class SCTableReference; |
171 | 164 |
172 DISALLOW_COPY_AND_ASSIGN(StubCache); | 165 DISALLOW_COPY_AND_ASSIGN(StubCache); |
173 }; | 166 }; |
174 } // namespace internal | 167 } // namespace internal |
175 } // namespace v8 | 168 } // namespace v8 |
176 | 169 |
177 #endif // V8_STUB_CACHE_H_ | 170 #endif // V8_STUB_CACHE_H_ |
OLD | NEW |