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

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

Issue 7776010: Convert a bunch of ASSERTs to STATIC_ASSERTs (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/scanner-base.h ('k') | src/x64/builtins-x64.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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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/scanner-base.h ('k') | src/x64/builtins-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698