OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 static Persistent<Context> evaluation_context_; | 212 static Persistent<Context> evaluation_context_; |
213 static CounterMap* counter_map_; | 213 static CounterMap* counter_map_; |
214 // We statically allocate a set of local counters to be used if we | 214 // We statically allocate a set of local counters to be used if we |
215 // don't want to store the stats in a memory-mapped file | 215 // don't want to store the stats in a memory-mapped file |
216 static CounterCollection local_counters_; | 216 static CounterCollection local_counters_; |
217 static CounterCollection* counters_; | 217 static CounterCollection* counters_; |
218 static i::OS::MemoryMappedFile* counters_file_; | 218 static i::OS::MemoryMappedFile* counters_file_; |
219 static Counter* GetCounter(const char* name, bool is_histogram); | 219 static Counter* GetCounter(const char* name, bool is_histogram); |
220 static Handle<Value> CreateExternalArray(const Arguments& args, | 220 static Handle<Value> CreateExternalArray(const Arguments& args, |
221 ExternalArrayType type, | 221 ExternalArrayType type, |
222 int element_size); | 222 size_t element_size); |
223 static void ExternalArrayWeakCallback(Persistent<Value> object, void* data); | 223 static void ExternalArrayWeakCallback(Persistent<Value> object, void* data); |
224 }; | 224 }; |
225 | 225 |
226 | 226 |
227 class LineEditor { | 227 class LineEditor { |
228 public: | 228 public: |
229 enum Type { DUMB = 0, READLINE = 1 }; | 229 enum Type { DUMB = 0, READLINE = 1 }; |
230 LineEditor(Type type, const char* name); | 230 LineEditor(Type type, const char* name); |
231 virtual ~LineEditor() { } | 231 virtual ~LineEditor() { } |
232 | 232 |
233 virtual i::SmartPointer<char> Prompt(const char* prompt) = 0; | 233 virtual i::SmartPointer<char> Prompt(const char* prompt) = 0; |
234 virtual bool Open() { return true; } | 234 virtual bool Open() { return true; } |
235 virtual bool Close() { return true; } | 235 virtual bool Close() { return true; } |
236 virtual void AddHistory(const char* str) { } | 236 virtual void AddHistory(const char* str) { } |
237 | 237 |
238 const char* name() { return name_; } | 238 const char* name() { return name_; } |
239 static LineEditor* Get(); | 239 static LineEditor* Get(); |
240 private: | 240 private: |
241 Type type_; | 241 Type type_; |
242 const char* name_; | 242 const char* name_; |
243 LineEditor* next_; | 243 LineEditor* next_; |
244 static LineEditor* first_; | 244 static LineEditor* first_; |
245 }; | 245 }; |
246 | 246 |
247 | 247 |
248 } // namespace v8 | 248 } // namespace v8 |
249 | 249 |
250 | 250 |
251 #endif // V8_D8_H_ | 251 #endif // V8_D8_H_ |
OLD | NEW |