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

Side by Side Diff: src/objects.h

Issue 373323002: Avoid unnecessary hashing in OrderedHashTable (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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 | « no previous file | src/objects.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_OBJECTS_H_ 5 #ifndef V8_OBJECTS_H_
6 #define V8_OBJECTS_H_ 6 #define V8_OBJECTS_H_
7 7
8 #include "src/allocation.h" 8 #include "src/allocation.h"
9 #include "src/assert-scope.h" 9 #include "src/assert-scope.h"
10 #include "src/builtins.h" 10 #include "src/builtins.h"
(...skipping 4333 matching lines...) Expand 10 before | Expand all | Expand 10 after
4344 // Returns a new empty OrderedHashTable and records the clearing so that 4344 // Returns a new empty OrderedHashTable and records the clearing so that
4345 // exisiting iterators can be updated. 4345 // exisiting iterators can be updated.
4346 static Handle<Derived> Clear(Handle<Derived> table); 4346 static Handle<Derived> Clear(Handle<Derived> table);
4347 4347
4348 // Returns an OrderedHashTable (possibly |table|) where |key| has been 4348 // Returns an OrderedHashTable (possibly |table|) where |key| has been
4349 // removed. 4349 // removed.
4350 static Handle<Derived> Remove(Handle<Derived> table, Handle<Object> key, 4350 static Handle<Derived> Remove(Handle<Derived> table, Handle<Object> key,
4351 bool* was_present); 4351 bool* was_present);
4352 4352
4353 // Returns kNotFound if the key isn't present. 4353 // Returns kNotFound if the key isn't present.
4354 int FindEntry(Handle<Object> key, int hash);
4355
4356 // Like the above, but doesn't require the caller to provide a hash.
4354 int FindEntry(Handle<Object> key); 4357 int FindEntry(Handle<Object> key);
4355 4358
4356 int NumberOfElements() { 4359 int NumberOfElements() {
4357 return Smi::cast(get(kNumberOfElementsIndex))->value(); 4360 return Smi::cast(get(kNumberOfElementsIndex))->value();
4358 } 4361 }
4359 4362
4360 int NumberOfDeletedElements() { 4363 int NumberOfDeletedElements() {
4361 return Smi::cast(get(kNumberOfDeletedElementsIndex))->value(); 4364 return Smi::cast(get(kNumberOfDeletedElementsIndex))->value();
4362 } 4365 }
4363 4366
(...skipping 6851 matching lines...) Expand 10 before | Expand all | Expand 10 after
11215 } else { 11218 } else {
11216 value &= ~(1 << bit_position); 11219 value &= ~(1 << bit_position);
11217 } 11220 }
11218 return value; 11221 return value;
11219 } 11222 }
11220 }; 11223 };
11221 11224
11222 } } // namespace v8::internal 11225 } } // namespace v8::internal
11223 11226
11224 #endif // V8_OBJECTS_H_ 11227 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « no previous file | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698