Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(169)

Side by Side Diff: src/stub-cache.h

Issue 7787028: Use the BitField class for Code::Flags. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/safepoint-table.cc ('k') | src/stub-cache.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « src/safepoint-table.cc ('k') | src/stub-cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698