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

Unified Diff: src/handles.h

Issue 2866008: [Isolates] Move contents of Top into Isolate.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: ensure we're synced Created 10 years, 6 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/full-codegen.cc ('k') | src/handles.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/handles.h
===================================================================
--- src/handles.h (revision 4906)
+++ src/handles.h (working copy)
@@ -107,9 +107,7 @@
// for which the handle scope has been deleted is undefined.
class HandleScope {
public:
- HandleScope() : previous_(*Isolate::Current()->handle_scope_data()) {
- Isolate::Current()->handle_scope_data()->extensions = 0;
- }
+ inline HandleScope();
~HandleScope() {
Leave(&previous_);
@@ -120,22 +118,8 @@
// Creates a new handle with the given value.
template <typename T>
- static inline T** CreateHandle(T* value) {
- v8::ImplementationUtilities::HandleScopeData* current =
- Isolate::Current()->handle_scope_data();
+ static inline T** CreateHandle(T* value);
- internal::Object** cur = current->next;
- if (cur == current->limit) cur = Extend();
- // Update the current next field, set the value in the created
- // handle, and return the result.
- ASSERT(cur < current->limit);
- current->next = cur + 1;
-
- T** result = reinterpret_cast<T**>(cur);
- *result = value;
- return result;
- }
-
// Deallocates any extensions used by the current scope.
static void DeleteExtensions(Isolate* isolate);
@@ -153,29 +137,13 @@
const v8::ImplementationUtilities::HandleScopeData previous_;
// Pushes a fresh handle scope to be used when allocating new handles.
- static void Enter(
- v8::ImplementationUtilities::HandleScopeData* previous) {
- v8::ImplementationUtilities::HandleScopeData* current =
- Isolate::Current()->handle_scope_data();
- *previous = *current;
- current->extensions = 0;
- }
+ static inline void Enter(
+ v8::ImplementationUtilities::HandleScopeData* previous);
// Re-establishes the previous scope state. Should be called only
// once, and only for the current scope.
- static void Leave(
- const v8::ImplementationUtilities::HandleScopeData* previous) {
- Isolate* isolate = Isolate::Current();
- v8::ImplementationUtilities::HandleScopeData* current =
- isolate->handle_scope_data();
- if (current->extensions > 0) {
- DeleteExtensions(isolate);
- }
- *current = *previous;
-#ifdef DEBUG
- ZapRange(current->next, current->limit);
-#endif
- }
+ static inline void Leave(
+ const v8::ImplementationUtilities::HandleScopeData* previous);
// Extend the handle scope making room for more handles.
static internal::Object** Extend();
« no previous file with comments | « src/full-codegen.cc ('k') | src/handles.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698