OLD | NEW |
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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 // Update cache for entry hash(name, map). | 253 // Update cache for entry hash(name, map). |
254 Code* Set(String* name, Map* map, Code* code); | 254 Code* Set(String* name, Map* map, Code* code); |
255 | 255 |
256 // Clear the lookup table (@ mark compact collection). | 256 // Clear the lookup table (@ mark compact collection). |
257 void Clear(); | 257 void Clear(); |
258 | 258 |
259 // Collect all maps that match the name and flags. | 259 // Collect all maps that match the name and flags. |
260 void CollectMatchingMaps(SmallMapList* types, | 260 void CollectMatchingMaps(SmallMapList* types, |
261 String* name, | 261 String* name, |
262 Code::Flags flags, | 262 Code::Flags flags, |
263 Handle<Context> global_context); | 263 Handle<Context> global_context, |
| 264 Zone* zone); |
264 | 265 |
265 // Generate code for probing the stub cache table. | 266 // Generate code for probing the stub cache table. |
266 // Arguments extra, extra2 and extra3 may be used to pass additional scratch | 267 // Arguments extra, extra2 and extra3 may be used to pass additional scratch |
267 // registers. Set to no_reg if not needed. | 268 // registers. Set to no_reg if not needed. |
268 void GenerateProbe(MacroAssembler* masm, | 269 void GenerateProbe(MacroAssembler* masm, |
269 Code::Flags flags, | 270 Code::Flags flags, |
270 Register receiver, | 271 Register receiver, |
271 Register name, | 272 Register name, |
272 Register scratch, | 273 Register scratch, |
273 Register extra, | 274 Register extra, |
(...skipping 29 matching lines...) Expand all Loading... |
303 case StubCache::kPrimary: return StubCache::primary_; | 304 case StubCache::kPrimary: return StubCache::primary_; |
304 case StubCache::kSecondary: return StubCache::secondary_; | 305 case StubCache::kSecondary: return StubCache::secondary_; |
305 } | 306 } |
306 UNREACHABLE(); | 307 UNREACHABLE(); |
307 return NULL; | 308 return NULL; |
308 } | 309 } |
309 | 310 |
310 Isolate* isolate() { return isolate_; } | 311 Isolate* isolate() { return isolate_; } |
311 Heap* heap() { return isolate()->heap(); } | 312 Heap* heap() { return isolate()->heap(); } |
312 Factory* factory() { return isolate()->factory(); } | 313 Factory* factory() { return isolate()->factory(); } |
313 Zone* zone() const { return zone_; } | |
314 | 314 |
315 private: | 315 private: |
316 StubCache(Isolate* isolate, Zone* zone); | 316 StubCache(Isolate* isolate, Zone* zone); |
317 | 317 |
318 Handle<Code> ComputeCallInitialize(int argc, | 318 Handle<Code> ComputeCallInitialize(int argc, |
319 RelocInfo::Mode mode, | 319 RelocInfo::Mode mode, |
320 Code::Kind kind); | 320 Code::Kind kind); |
321 | 321 |
322 // The stub cache has a primary and secondary level. The two levels have | 322 // The stub cache has a primary and secondary level. The two levels have |
323 // different hashing algorithms in order to avoid simultaneous collisions | 323 // different hashing algorithms in order to avoid simultaneous collisions |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 } | 379 } |
380 | 380 |
381 static const int kPrimaryTableBits = 11; | 381 static const int kPrimaryTableBits = 11; |
382 static const int kPrimaryTableSize = (1 << kPrimaryTableBits); | 382 static const int kPrimaryTableSize = (1 << kPrimaryTableBits); |
383 static const int kSecondaryTableBits = 9; | 383 static const int kSecondaryTableBits = 9; |
384 static const int kSecondaryTableSize = (1 << kSecondaryTableBits); | 384 static const int kSecondaryTableSize = (1 << kSecondaryTableBits); |
385 | 385 |
386 Entry primary_[kPrimaryTableSize]; | 386 Entry primary_[kPrimaryTableSize]; |
387 Entry secondary_[kSecondaryTableSize]; | 387 Entry secondary_[kSecondaryTableSize]; |
388 Isolate* isolate_; | 388 Isolate* isolate_; |
389 Zone* zone_; | |
390 | 389 |
391 friend class Isolate; | 390 friend class Isolate; |
392 friend class SCTableReference; | 391 friend class SCTableReference; |
393 | 392 |
394 DISALLOW_COPY_AND_ASSIGN(StubCache); | 393 DISALLOW_COPY_AND_ASSIGN(StubCache); |
395 }; | 394 }; |
396 | 395 |
397 | 396 |
398 // ------------------------------------------------------------------------ | 397 // ------------------------------------------------------------------------ |
399 | 398 |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
915 Handle<JSFunction> constant_function_; | 914 Handle<JSFunction> constant_function_; |
916 bool is_simple_api_call_; | 915 bool is_simple_api_call_; |
917 Handle<FunctionTemplateInfo> expected_receiver_type_; | 916 Handle<FunctionTemplateInfo> expected_receiver_type_; |
918 Handle<CallHandlerInfo> api_call_info_; | 917 Handle<CallHandlerInfo> api_call_info_; |
919 }; | 918 }; |
920 | 919 |
921 | 920 |
922 } } // namespace v8::internal | 921 } } // namespace v8::internal |
923 | 922 |
924 #endif // V8_STUB_CACHE_H_ | 923 #endif // V8_STUB_CACHE_H_ |
OLD | NEW |