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

Unified Diff: src/handles.h

Issue 1417013007: Revert of Canonicalize handles for optimized compilation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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/compiler.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
diff --git a/src/handles.h b/src/handles.h
index 356df3aa1ff845da35bba3abdffce5e4530db7bc..85fa839f3f3981758ac28b8f7d934e210d2a75ba 100644
--- a/src/handles.h
+++ b/src/handles.h
@@ -10,7 +10,6 @@
#include "src/base/macros.h"
#include "src/checks.h"
#include "src/globals.h"
-#include "src/zone.h"
namespace v8 {
namespace internal {
@@ -93,9 +92,6 @@
V8_INLINE explicit Handle(T* object) : Handle(object, object->GetIsolate()) {}
V8_INLINE Handle(T* object, Isolate* isolate) : HandleBase(object, isolate) {}
- // Allocate a new handle for the object, do not canonicalize.
- V8_INLINE static Handle<T> New(T* object, Isolate* isolate);
-
// Constructor for handling automatic up casting.
// Ex. Handle<JSFunction> can be passed when Handle<Object> is expected.
template <typename S>
@@ -258,11 +254,9 @@
// Counts the number of allocated handles.
static int NumberOfHandles(Isolate* isolate);
- // Create a new handle or lookup a canonical handle.
- static inline Object** GetHandle(Isolate* isolate, Object* value);
-
// Creates a new handle with the given value.
- static inline Object** CreateHandle(Isolate* isolate, Object* value);
+ template <typename T>
+ static inline T** CreateHandle(Isolate* isolate, T* value);
// Deallocates any extensions used by the current scope.
static void DeleteExtensions(Isolate* isolate);
@@ -311,41 +305,8 @@
friend class v8::HandleScope;
friend class DeferredHandles;
- friend class DeferredHandleScope;
friend class HandleScopeImplementer;
friend class Isolate;
-};
-
-
-// Forward declarations for CanonicalHandleScope.
-template <typename V>
-class IdentityMap;
-class RootIndexMap;
-
-
-// A CanonicalHandleScope does not open a new HandleScope. It changes the
-// existing HandleScope so that Handles created within are canonicalized.
-// This does not apply to nested inner HandleScopes unless a nested
-// CanonicalHandleScope is introduced. Handles are only canonicalized within
-// the same CanonicalHandleScope, but not across nested ones.
-class CanonicalHandleScope final {
- public:
- explicit CanonicalHandleScope(Isolate* isolate);
- ~CanonicalHandleScope();
-
- private:
- Object** Lookup(Object* object);
-
- Isolate* isolate_;
- Zone zone_;
- RootIndexMap* root_index_map_;
- IdentityMap<Object**>* identity_map_;
- // Ordinary nested handle scopes within the current one are not canonical.
- int canonical_level_;
- // We may have nested canonical scopes. Handles are canonical within each one.
- CanonicalHandleScope* prev_canonical_scope_;
-
- friend class HandleScope;
};
@@ -384,8 +345,8 @@
inline ~SealHandleScope();
private:
Isolate* isolate_;
- Object** prev_limit_;
- int prev_sealed_level_;
+ Object** limit_;
+ int level_;
#endif
};
@@ -394,13 +355,10 @@
Object** next;
Object** limit;
int level;
- int sealed_level;
- CanonicalHandleScope* canonical_scope;
void Initialize() {
next = limit = NULL;
- sealed_level = level = 0;
- canonical_scope = NULL;
+ level = 0;
}
};
« no previous file with comments | « src/compiler.cc ('k') | src/handles.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698