| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_D8_H_ | 5 #ifndef V8_D8_H_ |
| 6 #define V8_D8_H_ | 6 #define V8_D8_H_ |
| 7 | 7 |
| 8 #ifndef V8_SHARED | 8 #ifndef V8_SHARED |
| 9 #include "src/allocation.h" | 9 #include "src/allocation.h" |
| 10 #include "src/hashmap.h" | 10 #include "src/hashmap.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 | 134 |
| 135 void End(int offset) { end_offset_ = offset; } | 135 void End(int offset) { end_offset_ = offset; } |
| 136 | 136 |
| 137 void Execute(Isolate* isolate); | 137 void Execute(Isolate* isolate); |
| 138 | 138 |
| 139 #ifndef V8_SHARED | 139 #ifndef V8_SHARED |
| 140 void StartExecuteInThread(); | 140 void StartExecuteInThread(); |
| 141 void WaitForThread(); | 141 void WaitForThread(); |
| 142 | 142 |
| 143 private: | 143 private: |
| 144 class IsolateThread : public i::Thread { | 144 class IsolateThread : public base::Thread { |
| 145 public: | 145 public: |
| 146 explicit IsolateThread(SourceGroup* group) | 146 explicit IsolateThread(SourceGroup* group) |
| 147 : i::Thread(GetThreadOptions()), group_(group) {} | 147 : base::Thread(GetThreadOptions()), group_(group) {} |
| 148 | 148 |
| 149 virtual void Run() { | 149 virtual void Run() { |
| 150 group_->ExecuteInThread(); | 150 group_->ExecuteInThread(); |
| 151 } | 151 } |
| 152 | 152 |
| 153 private: | 153 private: |
| 154 SourceGroup* group_; | 154 SourceGroup* group_; |
| 155 }; | 155 }; |
| 156 | 156 |
| 157 static i::Thread::Options GetThreadOptions(); | 157 static base::Thread::Options GetThreadOptions(); |
| 158 void ExecuteInThread(); | 158 void ExecuteInThread(); |
| 159 | 159 |
| 160 i::Semaphore next_semaphore_; | 160 base::Semaphore next_semaphore_; |
| 161 i::Semaphore done_semaphore_; | 161 base::Semaphore done_semaphore_; |
| 162 i::Thread* thread_; | 162 base::Thread* thread_; |
| 163 #endif // !V8_SHARED | 163 #endif // !V8_SHARED |
| 164 | 164 |
| 165 void ExitShell(int exit_code); | 165 void ExitShell(int exit_code); |
| 166 Handle<String> ReadFile(Isolate* isolate, const char* name); | 166 Handle<String> ReadFile(Isolate* isolate, const char* name); |
| 167 | 167 |
| 168 const char** argv_; | 168 const char** argv_; |
| 169 int begin_offset_; | 169 int begin_offset_; |
| 170 int end_offset_; | 170 int end_offset_; |
| 171 }; | 171 }; |
| 172 | 172 |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 | 360 |
| 361 private: | 361 private: |
| 362 static Persistent<Context> evaluation_context_; | 362 static Persistent<Context> evaluation_context_; |
| 363 #ifndef V8_SHARED | 363 #ifndef V8_SHARED |
| 364 static Persistent<Context> utility_context_; | 364 static Persistent<Context> utility_context_; |
| 365 static CounterMap* counter_map_; | 365 static CounterMap* counter_map_; |
| 366 // We statically allocate a set of local counters to be used if we | 366 // We statically allocate a set of local counters to be used if we |
| 367 // don't want to store the stats in a memory-mapped file | 367 // don't want to store the stats in a memory-mapped file |
| 368 static CounterCollection local_counters_; | 368 static CounterCollection local_counters_; |
| 369 static CounterCollection* counters_; | 369 static CounterCollection* counters_; |
| 370 static i::OS::MemoryMappedFile* counters_file_; | 370 static base::OS::MemoryMappedFile* counters_file_; |
| 371 static i::Mutex context_mutex_; | 371 static base::Mutex context_mutex_; |
| 372 static const i::TimeTicks kInitialTicks; | 372 static const base::TimeTicks kInitialTicks; |
| 373 | 373 |
| 374 static Counter* GetCounter(const char* name, bool is_histogram); | 374 static Counter* GetCounter(const char* name, bool is_histogram); |
| 375 static void InstallUtilityScript(Isolate* isolate); | 375 static void InstallUtilityScript(Isolate* isolate); |
| 376 #endif // !V8_SHARED | 376 #endif // !V8_SHARED |
| 377 static void Initialize(Isolate* isolate); | 377 static void Initialize(Isolate* isolate); |
| 378 static void InitializeDebugger(Isolate* isolate); | 378 static void InitializeDebugger(Isolate* isolate); |
| 379 static void RunShell(Isolate* isolate); | 379 static void RunShell(Isolate* isolate); |
| 380 static bool SetOptions(int argc, char* argv[]); | 380 static bool SetOptions(int argc, char* argv[]); |
| 381 static Handle<ObjectTemplate> CreateGlobalTemplate(Isolate* isolate); | 381 static Handle<ObjectTemplate> CreateGlobalTemplate(Isolate* isolate); |
| 382 static Handle<FunctionTemplate> CreateArrayBufferTemplate(FunctionCallback); | 382 static Handle<FunctionTemplate> CreateArrayBufferTemplate(FunctionCallback); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 399 static void ExternalArrayWeakCallback(Isolate* isolate, | 399 static void ExternalArrayWeakCallback(Isolate* isolate, |
| 400 Persistent<Object>* object, | 400 Persistent<Object>* object, |
| 401 uint8_t* data); | 401 uint8_t* data); |
| 402 }; | 402 }; |
| 403 | 403 |
| 404 | 404 |
| 405 } // namespace v8 | 405 } // namespace v8 |
| 406 | 406 |
| 407 | 407 |
| 408 #endif // V8_D8_H_ | 408 #endif // V8_D8_H_ |
| OLD | NEW |