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

Unified Diff: src/api.cc

Issue 2751263003: Give v8::Eternal a direct reference to the handle. (Closed)
Patch Set: Merge branch 'master' into slim-eternal Created 3 years, 9 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 | « include/v8.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 3333a06b92706098123903d671b1e3a39f00c260..cf3765c108a20a761e2cabf3312ac7523a3cb0f6 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -948,17 +948,13 @@ void V8::DisposeGlobal(i::Object** location) {
i::GlobalHandles::Destroy(location);
}
-
-void V8::Eternalize(Isolate* v8_isolate, Value* value, int* index) {
+Value* V8::Eternalize(Isolate* v8_isolate, Value* value) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
i::Object* object = *Utils::OpenHandle(value);
- isolate->eternal_handles()->Create(isolate, object, index);
-}
-
-
-Local<Value> V8::GetEternal(Isolate* v8_isolate, int index) {
- i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
- return Utils::ToLocal(isolate->eternal_handles()->Get(index));
+ int index = -1;
+ isolate->eternal_handles()->Create(isolate, object, &index);
+ return reinterpret_cast<Value*>(
+ isolate->eternal_handles()->Get(index).location());
}
« no previous file with comments | « include/v8.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698