OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
315 static Handle<Value> Load(const Arguments& args); | 315 static Handle<Value> Load(const Arguments& args); |
316 static Handle<Value> ArrayBuffer(const Arguments& args); | 316 static Handle<Value> ArrayBuffer(const Arguments& args); |
317 static Handle<Value> Int8Array(const Arguments& args); | 317 static Handle<Value> Int8Array(const Arguments& args); |
318 static Handle<Value> Uint8Array(const Arguments& args); | 318 static Handle<Value> Uint8Array(const Arguments& args); |
319 static Handle<Value> Int16Array(const Arguments& args); | 319 static Handle<Value> Int16Array(const Arguments& args); |
320 static Handle<Value> Uint16Array(const Arguments& args); | 320 static Handle<Value> Uint16Array(const Arguments& args); |
321 static Handle<Value> Int32Array(const Arguments& args); | 321 static Handle<Value> Int32Array(const Arguments& args); |
322 static Handle<Value> Uint32Array(const Arguments& args); | 322 static Handle<Value> Uint32Array(const Arguments& args); |
323 static Handle<Value> Float32Array(const Arguments& args); | 323 static Handle<Value> Float32Array(const Arguments& args); |
324 static Handle<Value> Float64Array(const Arguments& args); | 324 static Handle<Value> Float64Array(const Arguments& args); |
325 static Handle<Value> PixelArray(const Arguments& args); | 325 static Handle<Value> Uint8ClampedArray(const Arguments& args); |
326 static Handle<Value> SubArray(const Arguments& args); | |
326 // The OS object on the global object contains methods for performing | 327 // The OS object on the global object contains methods for performing |
327 // operating system calls: | 328 // operating system calls: |
328 // | 329 // |
329 // os.system("program_name", ["arg1", "arg2", ...], timeout1, timeout2) will | 330 // os.system("program_name", ["arg1", "arg2", ...], timeout1, timeout2) will |
330 // run the command, passing the arguments to the program. The standard output | 331 // run the command, passing the arguments to the program. The standard output |
331 // of the program will be picked up and returned as a multiline string. If | 332 // of the program will be picked up and returned as a multiline string. If |
332 // timeout1 is present then it should be a number. -1 indicates no timeout | 333 // timeout1 is present then it should be a number. -1 indicates no timeout |
333 // and a positive number is used as a timeout in milliseconds that limits the | 334 // and a positive number is used as a timeout in milliseconds that limits the |
334 // time spent waiting between receiving output characters from the program. | 335 // time spent waiting between receiving output characters from the program. |
335 // timeout2, if present, should be a number indicating the limit in | 336 // timeout2, if present, should be a number indicating the limit in |
(...skipping 23 matching lines...) Expand all Loading... | |
359 static Handle<Value> RemoveDirectory(const Arguments& args); | 360 static Handle<Value> RemoveDirectory(const Arguments& args); |
360 | 361 |
361 static void AddOSMethods(Handle<ObjectTemplate> os_template); | 362 static void AddOSMethods(Handle<ObjectTemplate> os_template); |
362 | 363 |
363 static LineEditor* console; | 364 static LineEditor* console; |
364 static const char* kPrompt; | 365 static const char* kPrompt; |
365 static ShellOptions options; | 366 static ShellOptions options; |
366 | 367 |
367 private: | 368 private: |
368 static Persistent<Context> evaluation_context_; | 369 static Persistent<Context> evaluation_context_; |
370 static Persistent<FunctionTemplate> array_buffer_template_; | |
369 #ifndef V8_SHARED | 371 #ifndef V8_SHARED |
370 static Persistent<Context> utility_context_; | 372 static Persistent<Context> utility_context_; |
371 static CounterMap* counter_map_; | 373 static CounterMap* counter_map_; |
372 // We statically allocate a set of local counters to be used if we | 374 // We statically allocate a set of local counters to be used if we |
373 // don't want to store the stats in a memory-mapped file | 375 // don't want to store the stats in a memory-mapped file |
374 static CounterCollection local_counters_; | 376 static CounterCollection local_counters_; |
375 static CounterCollection* counters_; | 377 static CounterCollection* counters_; |
376 static i::OS::MemoryMappedFile* counters_file_; | 378 static i::OS::MemoryMappedFile* counters_file_; |
377 static i::Mutex* context_mutex_; | 379 static i::Mutex* context_mutex_; |
378 | 380 |
379 static Counter* GetCounter(const char* name, bool is_histogram); | 381 static Counter* GetCounter(const char* name, bool is_histogram); |
380 static void InstallUtilityScript(); | 382 static void InstallUtilityScript(); |
381 #endif // V8_SHARED | 383 #endif // V8_SHARED |
382 static void Initialize(); | 384 static void Initialize(); |
383 static void RunShell(); | 385 static void RunShell(); |
384 static bool SetOptions(int argc, char* argv[]); | 386 static bool SetOptions(int argc, char* argv[]); |
385 static Handle<ObjectTemplate> CreateGlobalTemplate(); | 387 static Handle<ObjectTemplate> CreateGlobalTemplate(); |
386 static Handle<Value> CreateExternalArrayBuffer(int32_t size); | 388 static Handle<FunctionTemplate> CreateArrayTemplate(InvocationCallback); |
387 static Handle<Value> CreateExternalArrayBuffer(const Arguments& args); | 389 static Handle<Value> CreateExternalArrayBuffer(Handle<Object> buffer, |
390 int32_t size); | |
391 static Handle<Object> CreateExternalArray(Handle<Object> array, | |
392 Handle<Object> buffer, | |
393 ExternalArrayType type, | |
394 int32_t length, | |
395 int32_t byteLength, | |
396 int32_t byteOffset, | |
397 int32_t element_size); | |
388 static Handle<Value> CreateExternalArray(const Arguments& args, | 398 static Handle<Value> CreateExternalArray(const Arguments& args, |
Michael Starzinger
2012/06/25 09:56:45
Shouldn't this one actually return Handle<Object>
rossberg
2012/06/28 16:23:34
Can't unfortunately, because ThrowException return
| |
389 ExternalArrayType type, | 399 ExternalArrayType type, |
390 int32_t element_size); | 400 int32_t element_size); |
391 static void ExternalArrayWeakCallback(Persistent<Value> object, void* data); | 401 static void ExternalArrayWeakCallback(Persistent<Value> object, void* data); |
392 }; | 402 }; |
393 | 403 |
394 | 404 |
395 } // namespace v8 | 405 } // namespace v8 |
396 | 406 |
397 | 407 |
398 #endif // V8_D8_H_ | 408 #endif // V8_D8_H_ |
OLD | NEW |