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

Side by Side Diff: src/objects.h

Issue 257633002: HashTable::New() handlified. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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/heap.cc ('k') | 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 // 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 3709 matching lines...) Expand 10 before | Expand all | Expand 10 after
3720 // a hash table. 3720 // a hash table.
3721 void ElementRemoved() { 3721 void ElementRemoved() {
3722 SetNumberOfElements(NumberOfElements() - 1); 3722 SetNumberOfElements(NumberOfElements() - 1);
3723 SetNumberOfDeletedElements(NumberOfDeletedElements() + 1); 3723 SetNumberOfDeletedElements(NumberOfDeletedElements() + 1);
3724 } 3724 }
3725 void ElementsRemoved(int n) { 3725 void ElementsRemoved(int n) {
3726 SetNumberOfElements(NumberOfElements() - n); 3726 SetNumberOfElements(NumberOfElements() - n);
3727 SetNumberOfDeletedElements(NumberOfDeletedElements() + n); 3727 SetNumberOfDeletedElements(NumberOfDeletedElements() + n);
3728 } 3728 }
3729 3729
3730 // Returns a new HashTable object. Might return Failure.
3731 // TODO(ishell): this will be eventually replaced by New().
3732 MUST_USE_RESULT static MaybeObject* Allocate(
3733 Heap* heap,
3734 int at_least_space_for,
3735 MinimumCapacity capacity_option = USE_DEFAULT_MINIMUM_CAPACITY,
3736 PretenureFlag pretenure = NOT_TENURED);
3737
3738 // Returns a new HashTable object. 3730 // Returns a new HashTable object.
3739 MUST_USE_RESULT static Handle<Derived> New( 3731 MUST_USE_RESULT static Handle<Derived> New(
3740 Isolate* isolate, 3732 Isolate* isolate,
3741 int at_least_space_for, 3733 int at_least_space_for,
3742 MinimumCapacity capacity_option = USE_DEFAULT_MINIMUM_CAPACITY, 3734 MinimumCapacity capacity_option = USE_DEFAULT_MINIMUM_CAPACITY,
3743 PretenureFlag pretenure = NOT_TENURED); 3735 PretenureFlag pretenure = NOT_TENURED);
3744 3736
3745 // Computes the required capacity for a table holding the given 3737 // Computes the required capacity for a table holding the given
3746 // number of elements. May be more than HashTable::kMaxCapacity. 3738 // number of elements. May be more than HashTable::kMaxCapacity.
3747 static int ComputeCapacity(int at_least_space_for); 3739 static int ComputeCapacity(int at_least_space_for);
(...skipping 7541 matching lines...) Expand 10 before | Expand all | Expand 10 after
11289 } else { 11281 } else {
11290 value &= ~(1 << bit_position); 11282 value &= ~(1 << bit_position);
11291 } 11283 }
11292 return value; 11284 return value;
11293 } 11285 }
11294 }; 11286 };
11295 11287
11296 } } // namespace v8::internal 11288 } } // namespace v8::internal
11297 11289
11298 #endif // V8_OBJECTS_H_ 11290 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698