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

Unified Diff: src/global-handles.h

Issue 22795004: abstract eternal into class (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: comments addressed Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/api.cc ('k') | src/global-handles.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/global-handles.h
diff --git a/src/global-handles.h b/src/global-handles.h
index 5a4ad13e2f59c3b8342a6b03328f2336f4bcb06f..57cf70eea4713790ae50fda0d7fca3592e42bd25 100644
--- a/src/global-handles.h
+++ b/src/global-handles.h
@@ -346,8 +346,8 @@ class EternalHandles {
int NumberOfHandles() { return size_; }
- // Create an EternalHandle, returning the index.
- int Create(Isolate* isolate, Object* object);
+ // Create an EternalHandle, overwriting the index.
+ void Create(Isolate* isolate, Object* object, int* index);
// Grab the handle for an existing EternalHandle.
inline Handle<Object> Get(int index) {
@@ -369,8 +369,7 @@ class EternalHandles {
Handle<Object> CreateSingleton(Isolate* isolate,
Object* object,
SingletonHandle singleton) {
- ASSERT(singleton_handles_[singleton] == kInvalidIndex);
- singleton_handles_[singleton] = Create(isolate, object);
+ Create(isolate, object, &singleton_handles_[singleton]);
return Get(singleton_handles_[singleton]);
}
« no previous file with comments | « src/api.cc ('k') | src/global-handles.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698