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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 }; | 86 }; |
87 | 87 |
88 private: | 88 private: |
89 static int Hash(const char* name); | 89 static int Hash(const char* name); |
90 static bool Match(void* key1, void* key2); | 90 static bool Match(void* key1, void* key2); |
91 i::HashMap hash_map_; | 91 i::HashMap hash_map_; |
92 }; | 92 }; |
93 #endif // !V8_SHARED | 93 #endif // !V8_SHARED |
94 | 94 |
95 | 95 |
96 class LineEditor { | |
97 public: | |
98 enum Type { DUMB = 0, READLINE = 1 }; | |
99 LineEditor(Type type, const char* name); | |
100 virtual ~LineEditor() { } | |
101 | |
102 virtual Local<String> Prompt(const char* prompt) = 0; | |
103 virtual bool Open(Isolate* isolate) { return true; } | |
104 virtual bool Close() { return true; } | |
105 virtual void AddHistory(const char* str) { } | |
106 | |
107 const char* name() { return name_; } | |
108 static LineEditor* Get() { return current_; } | |
109 private: | |
110 Type type_; | |
111 const char* name_; | |
112 static LineEditor* current_; | |
113 }; | |
114 | |
115 | |
116 class SourceGroup { | 96 class SourceGroup { |
117 public: | 97 public: |
118 SourceGroup() : | 98 SourceGroup() : |
119 #ifndef V8_SHARED | 99 #ifndef V8_SHARED |
120 next_semaphore_(0), | 100 next_semaphore_(0), |
121 done_semaphore_(0), | 101 done_semaphore_(0), |
122 thread_(NULL), | 102 thread_(NULL), |
123 #endif // !V8_SHARED | 103 #endif // !V8_SHARED |
124 argv_(NULL), | 104 argv_(NULL), |
125 begin_offset_(0), | 105 begin_offset_(0), |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 // object for use in i::HashMap? By pointer? | 353 // object for use in i::HashMap? By pointer? |
374 typedef i::List<Local<Object>> ObjectList; | 354 typedef i::List<Local<Object>> ObjectList; |
375 static bool SerializeValue(Isolate* isolate, Local<Value> value, | 355 static bool SerializeValue(Isolate* isolate, Local<Value> value, |
376 const ObjectList& to_transfer, | 356 const ObjectList& to_transfer, |
377 ObjectList* seen_objects, | 357 ObjectList* seen_objects, |
378 SerializationData* out_data); | 358 SerializationData* out_data); |
379 static MaybeLocal<Value> DeserializeValue(Isolate* isolate, | 359 static MaybeLocal<Value> DeserializeValue(Isolate* isolate, |
380 const SerializationData& data, | 360 const SerializationData& data, |
381 int* offset); | 361 int* offset); |
382 static void CleanupWorkers(); | 362 static void CleanupWorkers(); |
383 static Local<Array> GetCompletions(Isolate* isolate, Local<String> text, | |
384 Local<String> full); | |
385 static int* LookupCounter(const char* name); | 363 static int* LookupCounter(const char* name); |
386 static void* CreateHistogram(const char* name, | 364 static void* CreateHistogram(const char* name, |
387 int min, | 365 int min, |
388 int max, | 366 int max, |
389 size_t buckets); | 367 size_t buckets); |
390 static void AddHistogramSample(void* histogram, int sample); | 368 static void AddHistogramSample(void* histogram, int sample); |
391 static void MapCounters(v8::Isolate* isolate, const char* name); | 369 static void MapCounters(v8::Isolate* isolate, const char* name); |
392 | 370 |
393 static void PerformanceNow(const v8::FunctionCallbackInfo<v8::Value>& args); | 371 static void PerformanceNow(const v8::FunctionCallbackInfo<v8::Value>& args); |
394 #endif // !V8_SHARED | 372 #endif // !V8_SHARED |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 static void RunShell(Isolate* isolate); | 468 static void RunShell(Isolate* isolate); |
491 static bool SetOptions(int argc, char* argv[]); | 469 static bool SetOptions(int argc, char* argv[]); |
492 static Local<ObjectTemplate> CreateGlobalTemplate(Isolate* isolate); | 470 static Local<ObjectTemplate> CreateGlobalTemplate(Isolate* isolate); |
493 }; | 471 }; |
494 | 472 |
495 | 473 |
496 } // namespace v8 | 474 } // namespace v8 |
497 | 475 |
498 | 476 |
499 #endif // V8_D8_H_ | 477 #endif // V8_D8_H_ |
OLD | NEW |