Ben Murdoch | 589d697 | 2011-11-30 16:04:58 +0000 | [diff] [blame] | 1 | // Copyright 2011 the V8 project authors. All rights reserved. |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 2 | // Redistribution and use in source and binary forms, with or without |
| 3 | // modification, are permitted provided that the following conditions are |
| 4 | // met: |
| 5 | // |
| 6 | // * Redistributions of source code must retain the above copyright |
| 7 | // notice, this list of conditions and the following disclaimer. |
| 8 | // * Redistributions in binary form must reproduce the above |
| 9 | // copyright notice, this list of conditions and the following |
| 10 | // disclaimer in the documentation and/or other materials provided |
| 11 | // with the distribution. |
| 12 | // * Neither the name of Google Inc. nor the names of its |
| 13 | // contributors may be used to endorse or promote products derived |
| 14 | // from this software without specific prior written permission. |
| 15 | // |
| 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 17 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 18 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 19 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 20 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 21 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 22 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 23 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 24 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | |
| 28 | #ifndef V8_D8_H_ |
| 29 | #define V8_D8_H_ |
| 30 | |
Ben Murdoch | 69a99ed | 2011-11-30 16:03:39 +0000 | [diff] [blame] | 31 | #ifndef V8_SHARED |
Ben Murdoch | 3fb3ca8 | 2011-12-02 17:19:32 +0000 | [diff] [blame] | 32 | #include "allocation.h" |
| 33 | #include "hashmap.h" |
Ben Murdoch | 589d697 | 2011-11-30 16:04:58 +0000 | [diff] [blame] | 34 | #include "smart-array-pointer.h" |
| 35 | #include "v8.h" |
Ben Murdoch | 3fb3ca8 | 2011-12-02 17:19:32 +0000 | [diff] [blame] | 36 | #else |
| 37 | #include "../include/v8.h" |
Ben Murdoch | 69a99ed | 2011-11-30 16:03:39 +0000 | [diff] [blame] | 38 | #endif // V8_SHARED |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 39 | |
| 40 | namespace v8 { |
| 41 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 42 | |
Ben Murdoch | 69a99ed | 2011-11-30 16:03:39 +0000 | [diff] [blame] | 43 | #ifndef V8_SHARED |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 44 | // A single counter in a counter collection. |
| 45 | class Counter { |
| 46 | public: |
| 47 | static const int kMaxNameSize = 64; |
| 48 | int32_t* Bind(const char* name, bool histogram); |
| 49 | int32_t* ptr() { return &count_; } |
| 50 | int32_t count() { return count_; } |
| 51 | int32_t sample_total() { return sample_total_; } |
| 52 | bool is_histogram() { return is_histogram_; } |
| 53 | void AddSample(int32_t sample); |
| 54 | private: |
| 55 | int32_t count_; |
| 56 | int32_t sample_total_; |
| 57 | bool is_histogram_; |
| 58 | uint8_t name_[kMaxNameSize]; |
| 59 | }; |
| 60 | |
| 61 | |
| 62 | // A set of counters and associated information. An instance of this |
| 63 | // class is stored directly in the memory-mapped counters file if |
| 64 | // the --map-counters options is used |
| 65 | class CounterCollection { |
| 66 | public: |
| 67 | CounterCollection(); |
| 68 | Counter* GetNextCounter(); |
| 69 | private: |
| 70 | static const unsigned kMaxCounters = 256; |
| 71 | uint32_t magic_number_; |
| 72 | uint32_t max_counters_; |
| 73 | uint32_t max_name_size_; |
| 74 | uint32_t counters_in_use_; |
| 75 | Counter counters_[kMaxCounters]; |
| 76 | }; |
| 77 | |
| 78 | |
| 79 | class CounterMap { |
| 80 | public: |
| 81 | CounterMap(): hash_map_(Match) { } |
| 82 | Counter* Lookup(const char* name) { |
| 83 | i::HashMap::Entry* answer = hash_map_.Lookup( |
| 84 | const_cast<char*>(name), |
| 85 | Hash(name), |
| 86 | false); |
| 87 | if (!answer) return NULL; |
| 88 | return reinterpret_cast<Counter*>(answer->value); |
| 89 | } |
| 90 | void Set(const char* name, Counter* value) { |
| 91 | i::HashMap::Entry* answer = hash_map_.Lookup( |
| 92 | const_cast<char*>(name), |
| 93 | Hash(name), |
| 94 | true); |
| 95 | ASSERT(answer != NULL); |
| 96 | answer->value = value; |
| 97 | } |
| 98 | class Iterator { |
| 99 | public: |
| 100 | explicit Iterator(CounterMap* map) |
| 101 | : map_(&map->hash_map_), entry_(map_->Start()) { } |
| 102 | void Next() { entry_ = map_->Next(entry_); } |
| 103 | bool More() { return entry_ != NULL; } |
| 104 | const char* CurrentKey() { return static_cast<const char*>(entry_->key); } |
| 105 | Counter* CurrentValue() { return static_cast<Counter*>(entry_->value); } |
| 106 | private: |
| 107 | i::HashMap* map_; |
| 108 | i::HashMap::Entry* entry_; |
| 109 | }; |
Ben Murdoch | 3fb3ca8 | 2011-12-02 17:19:32 +0000 | [diff] [blame] | 110 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 111 | private: |
| 112 | static int Hash(const char* name); |
| 113 | static bool Match(void* key1, void* key2); |
| 114 | i::HashMap hash_map_; |
| 115 | }; |
Ben Murdoch | 69a99ed | 2011-11-30 16:03:39 +0000 | [diff] [blame] | 116 | #endif // V8_SHARED |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 117 | |
| 118 | |
Ben Murdoch | 589d697 | 2011-11-30 16:04:58 +0000 | [diff] [blame] | 119 | #ifndef V8_SHARED |
| 120 | class LineEditor { |
| 121 | public: |
| 122 | enum Type { DUMB = 0, READLINE = 1 }; |
| 123 | LineEditor(Type type, const char* name); |
| 124 | virtual ~LineEditor() { } |
| 125 | |
| 126 | virtual i::SmartArrayPointer<char> Prompt(const char* prompt) = 0; |
| 127 | virtual bool Open() { return true; } |
| 128 | virtual bool Close() { return true; } |
| 129 | virtual void AddHistory(const char* str) { } |
| 130 | |
| 131 | const char* name() { return name_; } |
| 132 | static LineEditor* Get(); |
| 133 | private: |
| 134 | Type type_; |
| 135 | const char* name_; |
| 136 | LineEditor* next_; |
| 137 | static LineEditor* first_; |
| 138 | }; |
| 139 | #endif // V8_SHARED |
| 140 | |
| 141 | |
Ben Murdoch | 3fb3ca8 | 2011-12-02 17:19:32 +0000 | [diff] [blame] | 142 | class SourceGroup { |
| 143 | public: |
| 144 | SourceGroup() : |
Ben Murdoch | 69a99ed | 2011-11-30 16:03:39 +0000 | [diff] [blame] | 145 | #ifndef V8_SHARED |
Ben Murdoch | 3fb3ca8 | 2011-12-02 17:19:32 +0000 | [diff] [blame] | 146 | next_semaphore_(v8::internal::OS::CreateSemaphore(0)), |
| 147 | done_semaphore_(v8::internal::OS::CreateSemaphore(0)), |
| 148 | thread_(NULL), |
Ben Murdoch | 69a99ed | 2011-11-30 16:03:39 +0000 | [diff] [blame] | 149 | #endif // V8_SHARED |
Ben Murdoch | 3fb3ca8 | 2011-12-02 17:19:32 +0000 | [diff] [blame] | 150 | argv_(NULL), |
| 151 | begin_offset_(0), |
Ben Murdoch | 589d697 | 2011-11-30 16:04:58 +0000 | [diff] [blame] | 152 | end_offset_(0) {} |
| 153 | |
| 154 | ~SourceGroup(); |
Ben Murdoch | 3fb3ca8 | 2011-12-02 17:19:32 +0000 | [diff] [blame] | 155 | |
| 156 | void Begin(char** argv, int offset) { |
| 157 | argv_ = const_cast<const char**>(argv); |
| 158 | begin_offset_ = offset; |
| 159 | } |
| 160 | |
| 161 | void End(int offset) { end_offset_ = offset; } |
| 162 | |
| 163 | void Execute(); |
| 164 | |
Ben Murdoch | 69a99ed | 2011-11-30 16:03:39 +0000 | [diff] [blame] | 165 | #ifndef V8_SHARED |
Ben Murdoch | 3fb3ca8 | 2011-12-02 17:19:32 +0000 | [diff] [blame] | 166 | void StartExecuteInThread(); |
| 167 | void WaitForThread(); |
| 168 | |
| 169 | private: |
| 170 | class IsolateThread : public i::Thread { |
| 171 | public: |
| 172 | explicit IsolateThread(SourceGroup* group) |
| 173 | : i::Thread(GetThreadOptions()), group_(group) {} |
| 174 | |
| 175 | virtual void Run() { |
| 176 | group_->ExecuteInThread(); |
| 177 | } |
| 178 | |
| 179 | private: |
| 180 | SourceGroup* group_; |
| 181 | }; |
| 182 | |
| 183 | static i::Thread::Options GetThreadOptions(); |
| 184 | void ExecuteInThread(); |
| 185 | |
| 186 | i::Semaphore* next_semaphore_; |
| 187 | i::Semaphore* done_semaphore_; |
| 188 | i::Thread* thread_; |
Ben Murdoch | 69a99ed | 2011-11-30 16:03:39 +0000 | [diff] [blame] | 189 | #endif // V8_SHARED |
Ben Murdoch | 3fb3ca8 | 2011-12-02 17:19:32 +0000 | [diff] [blame] | 190 | |
| 191 | void ExitShell(int exit_code); |
| 192 | Handle<String> ReadFile(const char* name); |
| 193 | |
| 194 | const char** argv_; |
| 195 | int begin_offset_; |
| 196 | int end_offset_; |
| 197 | }; |
| 198 | |
| 199 | |
| 200 | class ShellOptions { |
| 201 | public: |
| 202 | ShellOptions() : |
Ben Murdoch | 69a99ed | 2011-11-30 16:03:39 +0000 | [diff] [blame] | 203 | #ifndef V8_SHARED |
Ben Murdoch | 3fb3ca8 | 2011-12-02 17:19:32 +0000 | [diff] [blame] | 204 | use_preemption(true), |
| 205 | preemption_interval(10), |
Ben Murdoch | 589d697 | 2011-11-30 16:04:58 +0000 | [diff] [blame] | 206 | num_parallel_files(0), |
Ben Murdoch | 3fb3ca8 | 2011-12-02 17:19:32 +0000 | [diff] [blame] | 207 | parallel_files(NULL), |
Ben Murdoch | 69a99ed | 2011-11-30 16:03:39 +0000 | [diff] [blame] | 208 | #endif // V8_SHARED |
Ben Murdoch | 3fb3ca8 | 2011-12-02 17:19:32 +0000 | [diff] [blame] | 209 | script_executed(false), |
| 210 | last_run(true), |
| 211 | stress_opt(false), |
| 212 | stress_deopt(false), |
| 213 | interactive_shell(false), |
| 214 | test_shell(false), |
| 215 | num_isolates(1), |
| 216 | isolate_sources(NULL) { } |
| 217 | |
Ben Murdoch | 589d697 | 2011-11-30 16:04:58 +0000 | [diff] [blame] | 218 | ~ShellOptions() { |
| 219 | #ifndef V8_SHARED |
| 220 | delete[] parallel_files; |
| 221 | #endif // V8_SHARED |
| 222 | delete[] isolate_sources; |
| 223 | } |
| 224 | |
Ben Murdoch | 69a99ed | 2011-11-30 16:03:39 +0000 | [diff] [blame] | 225 | #ifndef V8_SHARED |
Ben Murdoch | 3fb3ca8 | 2011-12-02 17:19:32 +0000 | [diff] [blame] | 226 | bool use_preemption; |
| 227 | int preemption_interval; |
Ben Murdoch | 589d697 | 2011-11-30 16:04:58 +0000 | [diff] [blame] | 228 | int num_parallel_files; |
| 229 | char** parallel_files; |
Ben Murdoch | 69a99ed | 2011-11-30 16:03:39 +0000 | [diff] [blame] | 230 | #endif // V8_SHARED |
Ben Murdoch | 3fb3ca8 | 2011-12-02 17:19:32 +0000 | [diff] [blame] | 231 | bool script_executed; |
| 232 | bool last_run; |
| 233 | bool stress_opt; |
| 234 | bool stress_deopt; |
| 235 | bool interactive_shell; |
| 236 | bool test_shell; |
| 237 | int num_isolates; |
| 238 | SourceGroup* isolate_sources; |
| 239 | }; |
| 240 | |
Ben Murdoch | 69a99ed | 2011-11-30 16:03:39 +0000 | [diff] [blame] | 241 | #ifdef V8_SHARED |
Ben Murdoch | 3fb3ca8 | 2011-12-02 17:19:32 +0000 | [diff] [blame] | 242 | class Shell { |
| 243 | #else |
| 244 | class Shell : public i::AllStatic { |
Ben Murdoch | 69a99ed | 2011-11-30 16:03:39 +0000 | [diff] [blame] | 245 | #endif // V8_SHARED |
Ben Murdoch | 589d697 | 2011-11-30 16:04:58 +0000 | [diff] [blame] | 246 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 247 | public: |
| 248 | static bool ExecuteString(Handle<String> source, |
| 249 | Handle<Value> name, |
| 250 | bool print_result, |
| 251 | bool report_exceptions); |
Steve Block | 6ded16b | 2010-05-10 14:33:55 +0100 | [diff] [blame] | 252 | static const char* ToCString(const v8::String::Utf8Value& value); |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 253 | static void ReportException(TryCatch* try_catch); |
Ben Murdoch | 3fb3ca8 | 2011-12-02 17:19:32 +0000 | [diff] [blame] | 254 | static Handle<String> ReadFile(const char* name); |
| 255 | static Persistent<Context> CreateEvaluationContext(); |
| 256 | static int RunMain(int argc, char* argv[]); |
| 257 | static int Main(int argc, char* argv[]); |
Ben Murdoch | 589d697 | 2011-11-30 16:04:58 +0000 | [diff] [blame] | 258 | static void Exit(int exit_code); |
Ben Murdoch | 3fb3ca8 | 2011-12-02 17:19:32 +0000 | [diff] [blame] | 259 | |
Ben Murdoch | 69a99ed | 2011-11-30 16:03:39 +0000 | [diff] [blame] | 260 | #ifndef V8_SHARED |
Ben Murdoch | 3fb3ca8 | 2011-12-02 17:19:32 +0000 | [diff] [blame] | 261 | static Handle<Array> GetCompletions(Handle<String> text, |
| 262 | Handle<String> full); |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 263 | static void OnExit(); |
| 264 | static int* LookupCounter(const char* name); |
| 265 | static void* CreateHistogram(const char* name, |
| 266 | int min, |
| 267 | int max, |
| 268 | size_t buckets); |
| 269 | static void AddHistogramSample(void* histogram, int sample); |
| 270 | static void MapCounters(const char* name); |
Ben Murdoch | 69a99ed | 2011-11-30 16:03:39 +0000 | [diff] [blame] | 271 | #endif // V8_SHARED |
Ben Murdoch | 3fb3ca8 | 2011-12-02 17:19:32 +0000 | [diff] [blame] | 272 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 273 | #ifdef ENABLE_DEBUGGER_SUPPORT |
| 274 | static Handle<Object> DebugMessageDetails(Handle<String> message); |
| 275 | static Handle<Value> DebugCommandToJSONRequest(Handle<String> command); |
| 276 | #endif |
| 277 | |
Ben Murdoch | b0fe162 | 2011-05-05 13:52:32 +0100 | [diff] [blame] | 278 | #ifdef WIN32 |
| 279 | #undef Yield |
| 280 | #endif |
| 281 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 282 | static Handle<Value> Print(const Arguments& args); |
| 283 | static Handle<Value> Write(const Arguments& args); |
| 284 | static Handle<Value> Yield(const Arguments& args); |
| 285 | static Handle<Value> Quit(const Arguments& args); |
| 286 | static Handle<Value> Version(const Arguments& args); |
Ben Murdoch | 589d697 | 2011-11-30 16:04:58 +0000 | [diff] [blame] | 287 | static Handle<Value> EnableProfiler(const Arguments& args); |
| 288 | static Handle<Value> DisableProfiler(const Arguments& args); |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 289 | static Handle<Value> Read(const Arguments& args); |
| 290 | static Handle<Value> ReadLine(const Arguments& args); |
| 291 | static Handle<Value> Load(const Arguments& args); |
Ben Murdoch | 3fb3ca8 | 2011-12-02 17:19:32 +0000 | [diff] [blame] | 292 | static Handle<Value> Int8Array(const Arguments& args); |
| 293 | static Handle<Value> Uint8Array(const Arguments& args); |
| 294 | static Handle<Value> Int16Array(const Arguments& args); |
| 295 | static Handle<Value> Uint16Array(const Arguments& args); |
| 296 | static Handle<Value> Int32Array(const Arguments& args); |
| 297 | static Handle<Value> Uint32Array(const Arguments& args); |
| 298 | static Handle<Value> Float32Array(const Arguments& args); |
| 299 | static Handle<Value> Float64Array(const Arguments& args); |
| 300 | static Handle<Value> PixelArray(const Arguments& args); |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 301 | // The OS object on the global object contains methods for performing |
| 302 | // operating system calls: |
| 303 | // |
| 304 | // os.system("program_name", ["arg1", "arg2", ...], timeout1, timeout2) will |
| 305 | // run the command, passing the arguments to the program. The standard output |
| 306 | // of the program will be picked up and returned as a multiline string. If |
| 307 | // timeout1 is present then it should be a number. -1 indicates no timeout |
| 308 | // and a positive number is used as a timeout in milliseconds that limits the |
| 309 | // time spent waiting between receiving output characters from the program. |
| 310 | // timeout2, if present, should be a number indicating the limit in |
| 311 | // milliseconds on the total running time of the program. Exceptions are |
| 312 | // thrown on timeouts or other errors or if the exit status of the program |
| 313 | // indicates an error. |
| 314 | // |
| 315 | // os.chdir(dir) changes directory to the given directory. Throws an |
| 316 | // exception/ on error. |
| 317 | // |
| 318 | // os.setenv(variable, value) sets an environment variable. Repeated calls to |
| 319 | // this method leak memory due to the API of setenv in the standard C library. |
| 320 | // |
| 321 | // os.umask(alue) calls the umask system call and returns the old umask. |
| 322 | // |
| 323 | // os.mkdirp(name, mask) creates a directory. The mask (if present) is anded |
| 324 | // with the current umask. Intermediate directories are created if necessary. |
| 325 | // An exception is not thrown if the directory already exists. Analogous to |
| 326 | // the "mkdir -p" command. |
| 327 | static Handle<Value> OSObject(const Arguments& args); |
| 328 | static Handle<Value> System(const Arguments& args); |
| 329 | static Handle<Value> ChangeDirectory(const Arguments& args); |
| 330 | static Handle<Value> SetEnvironment(const Arguments& args); |
Steve Block | 6ded16b | 2010-05-10 14:33:55 +0100 | [diff] [blame] | 331 | static Handle<Value> UnsetEnvironment(const Arguments& args); |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 332 | static Handle<Value> SetUMask(const Arguments& args); |
| 333 | static Handle<Value> MakeDirectory(const Arguments& args); |
| 334 | static Handle<Value> RemoveDirectory(const Arguments& args); |
| 335 | |
| 336 | static void AddOSMethods(Handle<ObjectTemplate> os_template); |
Ben Murdoch | 69a99ed | 2011-11-30 16:03:39 +0000 | [diff] [blame] | 337 | #ifndef V8_SHARED |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 338 | static const char* kHistoryFileName; |
Ben Murdoch | 589d697 | 2011-11-30 16:04:58 +0000 | [diff] [blame] | 339 | static const int kMaxHistoryEntries; |
| 340 | static LineEditor* console; |
Ben Murdoch | 69a99ed | 2011-11-30 16:03:39 +0000 | [diff] [blame] | 341 | #endif // V8_SHARED |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 342 | static const char* kPrompt; |
Ben Murdoch | 3fb3ca8 | 2011-12-02 17:19:32 +0000 | [diff] [blame] | 343 | static ShellOptions options; |
| 344 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 345 | private: |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 346 | static Persistent<Context> evaluation_context_; |
Ben Murdoch | 69a99ed | 2011-11-30 16:03:39 +0000 | [diff] [blame] | 347 | #ifndef V8_SHARED |
Ben Murdoch | 3fb3ca8 | 2011-12-02 17:19:32 +0000 | [diff] [blame] | 348 | static Persistent<Context> utility_context_; |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 349 | static CounterMap* counter_map_; |
| 350 | // We statically allocate a set of local counters to be used if we |
| 351 | // don't want to store the stats in a memory-mapped file |
| 352 | static CounterCollection local_counters_; |
| 353 | static CounterCollection* counters_; |
| 354 | static i::OS::MemoryMappedFile* counters_file_; |
Ben Murdoch | 3fb3ca8 | 2011-12-02 17:19:32 +0000 | [diff] [blame] | 355 | static i::Mutex* context_mutex_; |
| 356 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 357 | static Counter* GetCounter(const char* name, bool is_histogram); |
Ben Murdoch | 3fb3ca8 | 2011-12-02 17:19:32 +0000 | [diff] [blame] | 358 | static void InstallUtilityScript(); |
Ben Murdoch | 69a99ed | 2011-11-30 16:03:39 +0000 | [diff] [blame] | 359 | #endif // V8_SHARED |
Ben Murdoch | 3fb3ca8 | 2011-12-02 17:19:32 +0000 | [diff] [blame] | 360 | static void Initialize(); |
| 361 | static void RunShell(); |
| 362 | static bool SetOptions(int argc, char* argv[]); |
| 363 | static Handle<ObjectTemplate> CreateGlobalTemplate(); |
| 364 | static Handle<Value> CreateExternalArray(const Arguments& args, |
| 365 | ExternalArrayType type, |
| 366 | size_t element_size); |
| 367 | static void ExternalArrayWeakCallback(Persistent<Value> object, void* data); |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 368 | }; |
| 369 | |
| 370 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 371 | } // namespace v8 |
| 372 | |
| 373 | |
| 374 | #endif // V8_D8_H_ |