OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 return key & ((kPrimaryTableSize - 1) << kHeapObjectTagSize); | 375 return key & ((kPrimaryTableSize - 1) << kHeapObjectTagSize); |
376 } | 376 } |
377 | 377 |
378 static int SecondaryOffset(String* name, Code::Flags flags, int seed) { | 378 static int SecondaryOffset(String* name, Code::Flags flags, int seed) { |
379 // Use the seed from the primary cache in the secondary cache. | 379 // Use the seed from the primary cache in the secondary cache. |
380 uint32_t string_low32bits = | 380 uint32_t string_low32bits = |
381 static_cast<uint32_t>(reinterpret_cast<uintptr_t>(name)); | 381 static_cast<uint32_t>(reinterpret_cast<uintptr_t>(name)); |
382 // We always set the in_loop bit to zero when generating the lookup code | 382 // We always set the in_loop bit to zero when generating the lookup code |
383 // so do it here too so the hash codes match. | 383 // so do it here too so the hash codes match. |
384 uint32_t iflags = | 384 uint32_t iflags = |
385 (static_cast<uint32_t>(flags) & ~Code::kFlagsICInLoopMask); | 385 (static_cast<uint32_t>(flags) & ~Code::ICInLoopField::kMask); |
386 uint32_t key = seed - string_low32bits + iflags; | 386 uint32_t key = seed - string_low32bits + iflags; |
387 return key & ((kSecondaryTableSize - 1) << kHeapObjectTagSize); | 387 return key & ((kSecondaryTableSize - 1) << kHeapObjectTagSize); |
388 } | 388 } |
389 | 389 |
390 // Compute the entry for a given offset in exactly the same way as | 390 // Compute the entry for a given offset in exactly the same way as |
391 // we do in generated code. We generate an hash code that already | 391 // we do in generated code. We generate an hash code that already |
392 // ends in String::kHashShift 0s. Then we shift it so it is a multiple | 392 // ends in String::kHashShift 0s. Then we shift it so it is a multiple |
393 // of sizeof(Entry). This makes it easier to avoid making mistakes | 393 // of sizeof(Entry). This makes it easier to avoid making mistakes |
394 // in the hashed offset computations. | 394 // in the hashed offset computations. |
395 static Entry* entry(Entry* table, int offset) { | 395 static Entry* entry(Entry* table, int offset) { |
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
903 JSFunction* constant_function_; | 903 JSFunction* constant_function_; |
904 bool is_simple_api_call_; | 904 bool is_simple_api_call_; |
905 FunctionTemplateInfo* expected_receiver_type_; | 905 FunctionTemplateInfo* expected_receiver_type_; |
906 CallHandlerInfo* api_call_info_; | 906 CallHandlerInfo* api_call_info_; |
907 }; | 907 }; |
908 | 908 |
909 | 909 |
910 } } // namespace v8::internal | 910 } } // namespace v8::internal |
911 | 911 |
912 #endif // V8_STUB_CACHE_H_ | 912 #endif // V8_STUB_CACHE_H_ |
OLD | NEW |