Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 3955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3966 | 3966 |
| 3967 private: | 3967 private: |
| 3968 Isolate* const isolate_; | 3968 Isolate* const isolate_; |
| 3969 | 3969 |
| 3970 // Prevent copying of Scope objects. | 3970 // Prevent copying of Scope objects. |
| 3971 Scope(const Scope&); | 3971 Scope(const Scope&); |
| 3972 Scope& operator=(const Scope&); | 3972 Scope& operator=(const Scope&); |
| 3973 }; | 3973 }; |
| 3974 | 3974 |
| 3975 /** | 3975 /** |
| 3976 * Types of garbage collections that can be requested via | |
| 3977 * RequestGarbageCollection. | |
| 3978 */ | |
| 3979 enum GarbageCollectionType { | |
| 3980 kFullGarbageCollection, | |
| 3981 kMinorGarbageCollection | |
| 3982 }; | |
| 3983 | |
| 3984 /** | |
| 3976 * Creates a new isolate. Does not change the currently entered | 3985 * Creates a new isolate. Does not change the currently entered |
| 3977 * isolate. | 3986 * isolate. |
| 3978 * | 3987 * |
| 3979 * When an isolate is no longer used its resources should be freed | 3988 * When an isolate is no longer used its resources should be freed |
| 3980 * by calling Dispose(). Using the delete operator is not allowed. | 3989 * by calling Dispose(). Using the delete operator is not allowed. |
| 3981 */ | 3990 */ |
| 3982 static Isolate* New(); | 3991 static Isolate* New(); |
| 3983 | 3992 |
| 3984 /** | 3993 /** |
| 3985 * Returns the entered isolate for the current thread or NULL in | 3994 * Returns the entered isolate for the current thread or NULL in |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4177 * Registered |callback| must not reenter interrupted Isolate. | 4186 * Registered |callback| must not reenter interrupted Isolate. |
| 4178 */ | 4187 */ |
| 4179 void RequestInterrupt(InterruptCallback callback, void* data); | 4188 void RequestInterrupt(InterruptCallback callback, void* data); |
| 4180 | 4189 |
| 4181 /** | 4190 /** |
| 4182 * Clear interrupt request created by |RequestInterrupt|. | 4191 * Clear interrupt request created by |RequestInterrupt|. |
| 4183 * Can be called from another thread without acquiring a |Locker|. | 4192 * Can be called from another thread without acquiring a |Locker|. |
| 4184 */ | 4193 */ |
| 4185 void ClearInterrupt(); | 4194 void ClearInterrupt(); |
| 4186 | 4195 |
| 4196 /** | |
| 4197 * Request garbage collection in this Isolate. If |minor| is true, a | |
| 4198 * minor garbage collection is performed. | |
| 4199 */ | |
| 4200 void RequestGarbageCollection(GarbageCollectionType type); | |
|
Michael Starzinger
2014/01/13 10:13:24
I don't like exposing this through the API at all.
| |
| 4201 | |
| 4187 private: | 4202 private: |
| 4188 Isolate(); | 4203 Isolate(); |
| 4189 Isolate(const Isolate&); | 4204 Isolate(const Isolate&); |
| 4190 ~Isolate(); | 4205 ~Isolate(); |
| 4191 Isolate& operator=(const Isolate&); | 4206 Isolate& operator=(const Isolate&); |
| 4192 void* operator new(size_t size); | 4207 void* operator new(size_t size); |
| 4193 void operator delete(void*, size_t); | 4208 void operator delete(void*, size_t); |
| 4194 | 4209 |
| 4195 void SetObjectGroupId(internal::Object** object, UniqueId id); | 4210 void SetObjectGroupId(internal::Object** object, UniqueId id); |
| 4196 void SetReferenceFromGroup(UniqueId id, internal::Object** object); | 4211 void SetReferenceFromGroup(UniqueId id, internal::Object** object); |
| (...skipping 2231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6428 */ | 6443 */ |
| 6429 | 6444 |
| 6430 | 6445 |
| 6431 } // namespace v8 | 6446 } // namespace v8 |
| 6432 | 6447 |
| 6433 | 6448 |
| 6434 #undef TYPE_CHECK | 6449 #undef TYPE_CHECK |
| 6435 | 6450 |
| 6436 | 6451 |
| 6437 #endif // V8_H_ | 6452 #endif // V8_H_ |
| OLD | NEW |