| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 static Object* FillHeapNumberWithRandom(Object* heap_number, | 114 static Object* FillHeapNumberWithRandom(Object* heap_number, |
| 115 Context* context); | 115 Context* context); |
| 116 | 116 |
| 117 // Idle notification directly from the API. | 117 // Idle notification directly from the API. |
| 118 static bool IdleNotification(int hint); | 118 static bool IdleNotification(int hint); |
| 119 | 119 |
| 120 static void AddCallCompletedCallback(CallCompletedCallback callback); | 120 static void AddCallCompletedCallback(CallCompletedCallback callback); |
| 121 static void RemoveCallCompletedCallback(CallCompletedCallback callback); | 121 static void RemoveCallCompletedCallback(CallCompletedCallback callback); |
| 122 static void FireCallCompletedCallback(Isolate* isolate); | 122 static void FireCallCompletedCallback(Isolate* isolate); |
| 123 | 123 |
| 124 static v8::ArrayBuffer::Allocator* ArrayBufferAllocator() { |
| 125 return array_buffer_allocator_; |
| 126 } |
| 127 |
| 128 static void SetArrayBufferAllocator(v8::ArrayBuffer::Allocator *allocator) { |
| 129 CHECK_EQ(NULL, array_buffer_allocator_); |
| 130 array_buffer_allocator_ = allocator; |
| 131 } |
| 132 |
| 124 private: | 133 private: |
| 125 static void InitializeOncePerProcessImpl(); | 134 static void InitializeOncePerProcessImpl(); |
| 126 static void InitializeOncePerProcess(); | 135 static void InitializeOncePerProcess(); |
| 127 | 136 |
| 128 // True if engine is currently running | 137 // True if engine is currently running |
| 129 static bool is_running_; | 138 static bool is_running_; |
| 130 // True if V8 has ever been run | 139 // True if V8 has ever been run |
| 131 static bool has_been_set_up_; | 140 static bool has_been_set_up_; |
| 132 // True if error has been signaled for current engine | 141 // True if error has been signaled for current engine |
| 133 // (reset to false if engine is restarted) | 142 // (reset to false if engine is restarted) |
| 134 static bool has_fatal_error_; | 143 static bool has_fatal_error_; |
| 135 // True if engine has been shut down | 144 // True if engine has been shut down |
| 136 // (reset if engine is restarted) | 145 // (reset if engine is restarted) |
| 137 static bool has_been_disposed_; | 146 static bool has_been_disposed_; |
| 138 // True if we are using the crankshaft optimizing compiler. | 147 // True if we are using the crankshaft optimizing compiler. |
| 139 static bool use_crankshaft_; | 148 static bool use_crankshaft_; |
| 140 // List of callbacks when a Call completes. | 149 // List of callbacks when a Call completes. |
| 141 static List<CallCompletedCallback>* call_completed_callbacks_; | 150 static List<CallCompletedCallback>* call_completed_callbacks_; |
| 151 // Allocator for external array buffers. |
| 152 static v8::ArrayBuffer::Allocator* array_buffer_allocator_; |
| 142 }; | 153 }; |
| 143 | 154 |
| 144 | 155 |
| 145 // JavaScript defines two kinds of 'nil'. | 156 // JavaScript defines two kinds of 'nil'. |
| 146 enum NilValue { kNullValue, kUndefinedValue }; | 157 enum NilValue { kNullValue, kUndefinedValue }; |
| 147 | 158 |
| 148 | 159 |
| 149 // JavaScript defines two kinds of equality. | 160 // JavaScript defines two kinds of equality. |
| 150 enum EqualityKind { kStrictEquality, kNonStrictEquality }; | 161 enum EqualityKind { kStrictEquality, kNonStrictEquality }; |
| 151 | 162 |
| 152 | 163 |
| 153 } } // namespace v8::internal | 164 } } // namespace v8::internal |
| 154 | 165 |
| 155 namespace i = v8::internal; | 166 namespace i = v8::internal; |
| 156 | 167 |
| 157 #endif // V8_V8_H_ | 168 #endif // V8_V8_H_ |
| OLD | NEW |