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

Unified Diff: src/bootstrapper.h

Issue 2861017: [Isolates] Make statics from BootstrapperActive to be instance members (Closed)
Patch Set: 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/arm/codegen-arm.cc ('k') | src/bootstrapper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.h
diff --git a/src/bootstrapper.h b/src/bootstrapper.h
index 5a4eca597b9b73551c97b118e12d241b067a5772..616f38e46db8d99128886b10f30cabca56b7cac6 100644
--- a/src/bootstrapper.h
+++ b/src/bootstrapper.h
@@ -33,23 +33,6 @@ namespace v8 {
namespace internal {
-class BootstrapperActive BASE_EMBEDDED {
- public:
- BootstrapperActive() { nesting_++; }
- ~BootstrapperActive() { nesting_--; }
-
- // Support for thread preemption.
- static int ArchiveSpacePerThread();
- static char* ArchiveState(char* to);
- static char* RestoreState(char* from);
-
- private:
- static bool IsActive() { return nesting_ != 0; }
- static int nesting_;
- friend class Bootstrapper;
-};
-
-
// The Boostrapper is the public interface for creating a JavaScript global
// context.
class Bootstrapper {
@@ -78,7 +61,7 @@ class Bootstrapper {
static Handle<String> NativesSourceLookup(int index);
// Tells whether bootstrapping is active.
- static bool IsActive() { return BootstrapperActive::IsActive(); }
+ bool IsActive() const { return nesting_ != 0; }
// Support for thread preemption.
RLYSTC int ArchiveSpacePerThread();
@@ -95,13 +78,33 @@ class Bootstrapper {
v8::ExtensionConfiguration* extensions);
private:
+ typedef int NestingCounterType;
+ NestingCounterType nesting_;
+
+ friend class BootstrapperActive;
friend class Isolate;
+
Bootstrapper();
DISALLOW_COPY_AND_ASSIGN(Bootstrapper);
};
+class BootstrapperActive BASE_EMBEDDED {
+ public:
+ BootstrapperActive() {
+ ++Isolate::Current()->bootstrapper()->nesting_;
+ }
+
+ ~BootstrapperActive() {
+ --Isolate::Current()->bootstrapper()->nesting_;
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(BootstrapperActive);
+};
+
+
class NativesExternalStringResource
: public v8::String::ExternalAsciiStringResource {
public:
« no previous file with comments | « src/arm/codegen-arm.cc ('k') | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698