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

Side by Side Diff: src/api.cc

Issue 22384003: expose eternal handle api (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: added uninitialized constant 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « include/v8.h ('k') | src/global-handles.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 658 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 void V8::ClearWeak(i::Object** obj) { 669 void V8::ClearWeak(i::Object** obj) {
670 i::GlobalHandles::ClearWeakness(obj); 670 i::GlobalHandles::ClearWeakness(obj);
671 } 671 }
672 672
673 673
674 void V8::DisposeGlobal(i::Object** obj) { 674 void V8::DisposeGlobal(i::Object** obj) {
675 i::GlobalHandles::Destroy(obj); 675 i::GlobalHandles::Destroy(obj);
676 } 676 }
677 677
678 678
679 int V8::Eternalize(i::Isolate* isolate, i::Object** handle) {
680 return isolate->eternal_handles()->Create(isolate, *handle);
681 }
682
683
684 i::Object** V8::GetEternal(i::Isolate* isolate, int index) {
685 return isolate->eternal_handles()->Get(index).location();
686 }
687
688
679 // --- H a n d l e s --- 689 // --- H a n d l e s ---
680 690
681 691
682 HandleScope::HandleScope() { 692 HandleScope::HandleScope() {
683 Initialize(reinterpret_cast<Isolate*>(i::Isolate::Current())); 693 Initialize(reinterpret_cast<Isolate*>(i::Isolate::Current()));
684 } 694 }
685 695
686 696
687 HandleScope::HandleScope(Isolate* isolate) { 697 HandleScope::HandleScope(Isolate* isolate) {
688 Initialize(isolate); 698 Initialize(isolate);
(...skipping 7471 matching lines...) Expand 10 before | Expand all | Expand 10 after
8160 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 8170 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
8161 Address callback_address = 8171 Address callback_address =
8162 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8172 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8163 VMState<EXTERNAL> state(isolate); 8173 VMState<EXTERNAL> state(isolate);
8164 ExternalCallbackScope call_scope(isolate, callback_address); 8174 ExternalCallbackScope call_scope(isolate, callback_address);
8165 return callback(info); 8175 return callback(info);
8166 } 8176 }
8167 8177
8168 8178
8169 } } // namespace v8::internal 8179 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/global-handles.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698