| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 | 45 |
| 46 private: | 46 private: |
| 47 static bool IsActive() { return nesting_ != 0; } | 47 static bool IsActive() { return nesting_ != 0; } |
| 48 static int nesting_; | 48 static int nesting_; |
| 49 friend class Bootstrapper; | 49 friend class Bootstrapper; |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 | 52 |
| 53 // The Boostrapper is the public interface for creating a JavaScript global | 53 // The Boostrapper is the public interface for creating a JavaScript global |
| 54 // context. | 54 // context. |
| 55 class Bootstrapper : public AllStatic { | 55 class Bootstrapper { |
| 56 public: | 56 public: |
| 57 // Requires: Heap::Setup has been called. | 57 // Requires: Heap::Setup has been called. |
| 58 static void Initialize(bool create_heap_objects); | 58 static void Initialize(bool create_heap_objects); |
| 59 static void TearDown(); | 59 static void TearDown(); |
| 60 | 60 |
| 61 // Creates a JavaScript Global Context with initial object graph. | 61 // Creates a JavaScript Global Context with initial object graph. |
| 62 // The returned value is a global handle casted to V8Environment*. | 62 // The returned value is a global handle casted to V8Environment*. |
| 63 static Handle<Context> CreateEnvironment( | 63 static Handle<Context> CreateEnvironment( |
| 64 Handle<Object> global_object, | 64 Handle<Object> global_object, |
| 65 v8::Handle<v8::ObjectTemplate> global_template, | 65 v8::Handle<v8::ObjectTemplate> global_template, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 86 static char* RestoreState(char* from); | 86 static char* RestoreState(char* from); |
| 87 static void FreeThreadResources(); | 87 static void FreeThreadResources(); |
| 88 | 88 |
| 89 // This will allocate a char array that is deleted when V8 is shut down. | 89 // This will allocate a char array that is deleted when V8 is shut down. |
| 90 // It should only be used for strictly finite allocations. | 90 // It should only be used for strictly finite allocations. |
| 91 static char* AllocateAutoDeletedArray(int bytes); | 91 static char* AllocateAutoDeletedArray(int bytes); |
| 92 | 92 |
| 93 // Used for new context creation. | 93 // Used for new context creation. |
| 94 static bool InstallExtensions(Handle<Context> global_context, | 94 static bool InstallExtensions(Handle<Context> global_context, |
| 95 v8::ExtensionConfiguration* extensions); | 95 v8::ExtensionConfiguration* extensions); |
| 96 |
| 97 private: |
| 98 friend class Isolate; |
| 99 Bootstrapper(); |
| 100 |
| 101 DISALLOW_COPY_AND_ASSIGN(Bootstrapper); |
| 96 }; | 102 }; |
| 97 | 103 |
| 98 | 104 |
| 99 class NativesExternalStringResource | 105 class NativesExternalStringResource |
| 100 : public v8::String::ExternalAsciiStringResource { | 106 : public v8::String::ExternalAsciiStringResource { |
| 101 public: | 107 public: |
| 102 explicit NativesExternalStringResource(const char* source); | 108 explicit NativesExternalStringResource(const char* source); |
| 103 | 109 |
| 104 const char* data() const { | 110 const char* data() const { |
| 105 return data_; | 111 return data_; |
| 106 } | 112 } |
| 107 | 113 |
| 108 size_t length() const { | 114 size_t length() const { |
| 109 return length_; | 115 return length_; |
| 110 } | 116 } |
| 111 private: | 117 private: |
| 112 const char* data_; | 118 const char* data_; |
| 113 size_t length_; | 119 size_t length_; |
| 114 }; | 120 }; |
| 115 | 121 |
| 116 }} // namespace v8::internal | 122 }} // namespace v8::internal |
| 117 | 123 |
| 118 #endif // V8_BOOTSTRAPPER_H_ | 124 #endif // V8_BOOTSTRAPPER_H_ |
| OLD | NEW |