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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 case StubCache::kPrimary: return StubCache::primary_; | 298 case StubCache::kPrimary: return StubCache::primary_; |
299 case StubCache::kSecondary: return StubCache::secondary_; | 299 case StubCache::kSecondary: return StubCache::secondary_; |
300 } | 300 } |
301 UNREACHABLE(); | 301 UNREACHABLE(); |
302 return NULL; | 302 return NULL; |
303 } | 303 } |
304 | 304 |
305 Isolate* isolate() { return isolate_; } | 305 Isolate* isolate() { return isolate_; } |
306 Heap* heap() { return isolate()->heap(); } | 306 Heap* heap() { return isolate()->heap(); } |
307 Factory* factory() { return isolate()->factory(); } | 307 Factory* factory() { return isolate()->factory(); } |
| 308 Zone* zone() const { return zone_; } |
308 | 309 |
309 private: | 310 private: |
310 explicit StubCache(Isolate* isolate); | 311 StubCache(Isolate* isolate, Zone* zone); |
311 | 312 |
312 Handle<Code> ComputeCallInitialize(int argc, | 313 Handle<Code> ComputeCallInitialize(int argc, |
313 RelocInfo::Mode mode, | 314 RelocInfo::Mode mode, |
314 Code::Kind kind); | 315 Code::Kind kind); |
315 | 316 |
316 // The stub cache has a primary and secondary level. The two levels have | 317 // The stub cache has a primary and secondary level. The two levels have |
317 // different hashing algorithms in order to avoid simultaneous collisions | 318 // different hashing algorithms in order to avoid simultaneous collisions |
318 // in both caches. Unlike a probing strategy (quadratic or otherwise) the | 319 // in both caches. Unlike a probing strategy (quadratic or otherwise) the |
319 // update strategy on updates is fairly clear and simple: Any existing entry | 320 // update strategy on updates is fairly clear and simple: Any existing entry |
320 // in the primary cache is moved to the secondary cache, and secondary cache | 321 // in the primary cache is moved to the secondary cache, and secondary cache |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 } | 374 } |
374 | 375 |
375 static const int kPrimaryTableBits = 11; | 376 static const int kPrimaryTableBits = 11; |
376 static const int kPrimaryTableSize = (1 << kPrimaryTableBits); | 377 static const int kPrimaryTableSize = (1 << kPrimaryTableBits); |
377 static const int kSecondaryTableBits = 9; | 378 static const int kSecondaryTableBits = 9; |
378 static const int kSecondaryTableSize = (1 << kSecondaryTableBits); | 379 static const int kSecondaryTableSize = (1 << kSecondaryTableBits); |
379 | 380 |
380 Entry primary_[kPrimaryTableSize]; | 381 Entry primary_[kPrimaryTableSize]; |
381 Entry secondary_[kSecondaryTableSize]; | 382 Entry secondary_[kSecondaryTableSize]; |
382 Isolate* isolate_; | 383 Isolate* isolate_; |
| 384 Zone* zone_; |
383 | 385 |
384 friend class Isolate; | 386 friend class Isolate; |
385 friend class SCTableReference; | 387 friend class SCTableReference; |
386 | 388 |
387 DISALLOW_COPY_AND_ASSIGN(StubCache); | 389 DISALLOW_COPY_AND_ASSIGN(StubCache); |
388 }; | 390 }; |
389 | 391 |
390 | 392 |
391 // ------------------------------------------------------------------------ | 393 // ------------------------------------------------------------------------ |
392 | 394 |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
904 Handle<JSFunction> constant_function_; | 906 Handle<JSFunction> constant_function_; |
905 bool is_simple_api_call_; | 907 bool is_simple_api_call_; |
906 Handle<FunctionTemplateInfo> expected_receiver_type_; | 908 Handle<FunctionTemplateInfo> expected_receiver_type_; |
907 Handle<CallHandlerInfo> api_call_info_; | 909 Handle<CallHandlerInfo> api_call_info_; |
908 }; | 910 }; |
909 | 911 |
910 | 912 |
911 } } // namespace v8::internal | 913 } } // namespace v8::internal |
912 | 914 |
913 #endif // V8_STUB_CACHE_H_ | 915 #endif // V8_STUB_CACHE_H_ |
OLD | NEW |