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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 static const int kSecondaryTableSize = 512; | 350 static const int kSecondaryTableSize = 512; |
351 Entry primary_[kPrimaryTableSize]; | 351 Entry primary_[kPrimaryTableSize]; |
352 Entry secondary_[kSecondaryTableSize]; | 352 Entry secondary_[kSecondaryTableSize]; |
353 | 353 |
354 // Computes the hashed offsets for primary and secondary caches. | 354 // Computes the hashed offsets for primary and secondary caches. |
355 static int PrimaryOffset(String* name, Code::Flags flags, Map* map) { | 355 static int PrimaryOffset(String* name, Code::Flags flags, Map* map) { |
356 // This works well because the heap object tag size and the hash | 356 // This works well because the heap object tag size and the hash |
357 // shift are equal. Shifting down the length field to get the | 357 // shift are equal. Shifting down the length field to get the |
358 // hash code would effectively throw away two bits of the hash | 358 // hash code would effectively throw away two bits of the hash |
359 // code. | 359 // code. |
360 ASSERT(kHeapObjectTagSize == String::kHashShift); | 360 STATIC_ASSERT(kHeapObjectTagSize == String::kHashShift); |
361 // Compute the hash of the name (use entire hash field). | 361 // Compute the hash of the name (use entire hash field). |
362 ASSERT(name->HasHashCode()); | 362 ASSERT(name->HasHashCode()); |
363 uint32_t field = name->hash_field(); | 363 uint32_t field = name->hash_field(); |
364 // Using only the low bits in 64-bit mode is unlikely to increase the | 364 // Using only the low bits in 64-bit mode is unlikely to increase the |
365 // risk of collision even if the heap is spread over an area larger than | 365 // risk of collision even if the heap is spread over an area larger than |
366 // 4Gb (and not at all if it isn't). | 366 // 4Gb (and not at all if it isn't). |
367 uint32_t map_low32bits = | 367 uint32_t map_low32bits = |
368 static_cast<uint32_t>(reinterpret_cast<uintptr_t>(map)); | 368 static_cast<uint32_t>(reinterpret_cast<uintptr_t>(map)); |
369 // We always set the in_loop bit to zero when generating the lookup code | 369 // We always set the in_loop bit to zero when generating the lookup code |
370 // so do it here too so the hash codes match. | 370 // so do it here too so the hash codes match. |
(...skipping 532 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 |