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

Side by Side Diff: src/heap.cc

Issue 491004: Reapply keyed load cache probing in generated code. I introduced a... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years 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/heap.h ('k') | src/ia32/ic-ia32.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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 3945 matching lines...) Expand 10 before | Expand all | Expand 10 after
3956 return MarkCompactCollector::HasCompacted() ? "Mark-compact" 3956 return MarkCompactCollector::HasCompacted() ? "Mark-compact"
3957 : "Mark-sweep"; 3957 : "Mark-sweep";
3958 } 3958 }
3959 return "Unknown GC"; 3959 return "Unknown GC";
3960 } 3960 }
3961 3961
3962 3962
3963 int KeyedLookupCache::Hash(Map* map, String* name) { 3963 int KeyedLookupCache::Hash(Map* map, String* name) {
3964 // Uses only lower 32 bits if pointers are larger. 3964 // Uses only lower 32 bits if pointers are larger.
3965 uintptr_t addr_hash = 3965 uintptr_t addr_hash =
3966 static_cast<uint32_t>(reinterpret_cast<uintptr_t>(map)) >> 2; 3966 static_cast<uint32_t>(reinterpret_cast<uintptr_t>(map)) >> kMapHashShift;
3967 return (addr_hash ^ name->Hash()) % kLength; 3967 return (addr_hash ^ name->Hash()) & kCapacityMask;
3968 } 3968 }
3969 3969
3970 3970
3971 int KeyedLookupCache::Lookup(Map* map, String* name) { 3971 int KeyedLookupCache::Lookup(Map* map, String* name) {
3972 int index = Hash(map, name); 3972 int index = Hash(map, name);
3973 Key& key = keys_[index]; 3973 Key& key = keys_[index];
3974 if ((key.map == map) && key.name->Equals(name)) { 3974 if ((key.map == map) && key.name->Equals(name)) {
3975 return field_offsets_[index]; 3975 return field_offsets_[index];
3976 } 3976 }
3977 return -1; 3977 return -1;
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
4072 void ExternalStringTable::TearDown() { 4072 void ExternalStringTable::TearDown() {
4073 new_space_strings_.Free(); 4073 new_space_strings_.Free();
4074 old_space_strings_.Free(); 4074 old_space_strings_.Free();
4075 } 4075 }
4076 4076
4077 4077
4078 List<Object*> ExternalStringTable::new_space_strings_; 4078 List<Object*> ExternalStringTable::new_space_strings_;
4079 List<Object*> ExternalStringTable::old_space_strings_; 4079 List<Object*> ExternalStringTable::old_space_strings_;
4080 4080
4081 } } // namespace v8::internal 4081 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.h ('k') | src/ia32/ic-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698