diff options
Diffstat (limited to 'deps/v8/src/d8.h')
-rw-r--r-- | deps/v8/src/d8.h | 43 |
1 files changed, 12 insertions, 31 deletions
diff --git a/deps/v8/src/d8.h b/deps/v8/src/d8.h index 0e365a52dd..32a7d25c2f 100644 --- a/deps/v8/src/d8.h +++ b/deps/v8/src/d8.h @@ -5,15 +5,13 @@ #ifndef V8_D8_H_ #define V8_D8_H_ -#ifndef V8_SHARED +#include <map> +#include <string> + #include "src/allocation.h" #include "src/base/hashmap.h" #include "src/base/platform/time.h" #include "src/list.h" -#else -#include "include/v8.h" -#include "src/base/compiler-specific.h" -#endif // !V8_SHARED #include "src/base/once.h" @@ -21,7 +19,6 @@ namespace v8 { -#ifndef V8_SHARED // A single counter in a counter collection. class Counter { public: @@ -81,26 +78,23 @@ class CounterMap { const char* CurrentKey() { return static_cast<const char*>(entry_->key); } Counter* CurrentValue() { return static_cast<Counter*>(entry_->value); } private: - base::HashMap* map_; - base::HashMap::Entry* entry_; + base::CustomMatcherHashMap* map_; + base::CustomMatcherHashMap::Entry* entry_; }; private: static int Hash(const char* name); static bool Match(void* key1, void* key2); - base::HashMap hash_map_; + base::CustomMatcherHashMap hash_map_; }; -#endif // !V8_SHARED class SourceGroup { public: SourceGroup() : -#ifndef V8_SHARED next_semaphore_(0), done_semaphore_(0), thread_(NULL), -#endif // !V8_SHARED argv_(NULL), begin_offset_(0), end_offset_(0) {} @@ -116,7 +110,6 @@ class SourceGroup { void Execute(Isolate* isolate); -#ifndef V8_SHARED void StartExecuteInThread(); void WaitForThread(); void JoinThread(); @@ -141,7 +134,6 @@ class SourceGroup { base::Semaphore next_semaphore_; base::Semaphore done_semaphore_; base::Thread* thread_; -#endif // !V8_SHARED void ExitShell(int exit_code); Local<String> ReadFile(Isolate* isolate, const char* name); @@ -151,7 +143,6 @@ class SourceGroup { int end_offset_; }; -#ifndef V8_SHARED enum SerializationTag { kSerializationTagUndefined, kSerializationTagNull, @@ -267,7 +258,6 @@ class Worker { char* script_; base::Atomic32 running_; }; -#endif // !V8_SHARED class ShellOptions { @@ -324,23 +314,15 @@ class ShellOptions { const char* trace_config; }; -#ifdef V8_SHARED -class Shell { -#else class Shell : public i::AllStatic { -#endif // V8_SHARED - public: - enum SourceType { SCRIPT, MODULE }; - static MaybeLocal<Script> CompileString( Isolate* isolate, Local<String> source, Local<Value> name, - v8::ScriptCompiler::CompileOptions compile_options, - SourceType source_type); + v8::ScriptCompiler::CompileOptions compile_options); static bool ExecuteString(Isolate* isolate, Local<String> source, Local<Value> name, bool print_result, - bool report_exceptions, - SourceType source_type = SCRIPT); + bool report_exceptions); + static bool ExecuteModule(Isolate* isolate, const char* file_name); static const char* ToCString(const v8::String::Utf8Value& value); static void ReportException(Isolate* isolate, TryCatch* try_catch); static Local<String> ReadFile(Isolate* isolate, const char* name); @@ -352,7 +334,6 @@ class Shell : public i::AllStatic { static void CollectGarbage(Isolate* isolate); static void EmptyMessageQueues(Isolate* isolate); -#ifndef V8_SHARED // TODO(binji): stupid implementation for now. Is there an easy way to hash an // object for use in base::HashMap? By pointer? typedef i::List<Local<Object>> ObjectList; @@ -373,7 +354,6 @@ class Shell : public i::AllStatic { static void MapCounters(v8::Isolate* isolate, const char* name); static void PerformanceNow(const v8::FunctionCallbackInfo<v8::Value>& args); -#endif // !V8_SHARED static void RealmCurrent(const v8::FunctionCallbackInfo<v8::Value>& args); static void RealmOwner(const v8::FunctionCallbackInfo<v8::Value>& args); @@ -451,7 +431,6 @@ class Shell : public i::AllStatic { private: static Global<Context> evaluation_context_; static base::OnceType quit_once_; -#ifndef V8_SHARED static Global<Function> stringify_function_; static CounterMap* counter_map_; // We statically allocate a set of local counters to be used if we @@ -470,13 +449,15 @@ class Shell : public i::AllStatic { static void WriteIgnitionDispatchCountersFile(v8::Isolate* isolate); static Counter* GetCounter(const char* name, bool is_histogram); static Local<String> Stringify(Isolate* isolate, Local<Value> value); -#endif // !V8_SHARED static void Initialize(Isolate* isolate); static void RunShell(Isolate* isolate); static bool SetOptions(int argc, char* argv[]); static Local<ObjectTemplate> CreateGlobalTemplate(Isolate* isolate); static MaybeLocal<Context> CreateRealm( const v8::FunctionCallbackInfo<v8::Value>& args); + static MaybeLocal<Module> FetchModuleTree( + Isolate* isolate, const std::string& file_name, + std::map<std::string, Global<Module>>* module_map); }; |