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