Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Side by Side Diff: include/v8.h

Issue 9227007: Version 3.8.6 (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ChangeLog ('k') | src/api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2830 matching lines...) Expand 10 before | Expand all | Expand 10 after
2841 char** raw_data; 2841 char** raw_data;
2842 }; 2842 };
2843 2843
2844 2844
2845 /** 2845 /**
2846 * EntropySource is used as a callback function when v8 needs a source 2846 * EntropySource is used as a callback function when v8 needs a source
2847 * of entropy. 2847 * of entropy.
2848 */ 2848 */
2849 typedef bool (*EntropySource)(unsigned char* buffer, size_t length); 2849 typedef bool (*EntropySource)(unsigned char* buffer, size_t length);
2850 2850
2851
2852 /**
2853 * Interface for iterating though all external resources in the heap.
2854 */
2855 class V8EXPORT ExternalResourceVisitor { // NOLINT
2856 public:
2857 virtual ~ExternalResourceVisitor() {}
2858 virtual void VisitExternalString(Handle<String> string) {}
2859 };
2860
2861
2851 /** 2862 /**
2852 * Container class for static utility functions. 2863 * Container class for static utility functions.
2853 */ 2864 */
2854 class V8EXPORT V8 { 2865 class V8EXPORT V8 {
2855 public: 2866 public:
2856 /** Set the callback to invoke in case of fatal errors. */ 2867 /** Set the callback to invoke in case of fatal errors. */
2857 static void SetFatalErrorHandler(FatalErrorCallback that); 2868 static void SetFatalErrorHandler(FatalErrorCallback that);
2858 2869
2859 /** 2870 /**
2860 * Set the callback to invoke to check if code generation from 2871 * Set the callback to invoke to check if code generation from
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
3197 * to use if the process needs the resources taken up by v8. 3208 * to use if the process needs the resources taken up by v8.
3198 */ 3209 */
3199 static bool Dispose(); 3210 static bool Dispose();
3200 3211
3201 /** 3212 /**
3202 * Get statistics about the heap memory usage. 3213 * Get statistics about the heap memory usage.
3203 */ 3214 */
3204 static void GetHeapStatistics(HeapStatistics* heap_statistics); 3215 static void GetHeapStatistics(HeapStatistics* heap_statistics);
3205 3216
3206 /** 3217 /**
3218 * Iterates through all external resources referenced from current isolate
3219 * heap. This method is not expected to be used except for debugging purposes
3220 * and may be quite slow.
3221 */
3222 static void VisitExternalResources(ExternalResourceVisitor* visitor);
3223
3224 /**
3207 * Optional notification that the embedder is idle. 3225 * Optional notification that the embedder is idle.
3208 * V8 uses the notification to reduce memory footprint. 3226 * V8 uses the notification to reduce memory footprint.
3209 * This call can be used repeatedly if the embedder remains idle. 3227 * This call can be used repeatedly if the embedder remains idle.
3210 * Returns true if the embedder should stop calling IdleNotification 3228 * Returns true if the embedder should stop calling IdleNotification
3211 * until real work has been done. This indicates that V8 has done 3229 * until real work has been done. This indicates that V8 has done
3212 * as much cleanup as it will be able to do. 3230 * as much cleanup as it will be able to do.
3213 * 3231 *
3214 * The hint argument specifies the amount of work to be done in the function 3232 * The hint argument specifies the amount of work to be done in the function
3215 * on scale from 1 to 1000. There is no guarantee that the actual work will 3233 * on scale from 1 to 1000. There is no guarantee that the actual work will
3216 * match the hint. 3234 * match the hint.
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
3809 static const int kHeapObjectMapOffset = 0; 3827 static const int kHeapObjectMapOffset = 0;
3810 static const int kMapInstanceTypeOffset = 1 * kApiPointerSize + kApiIntSize; 3828 static const int kMapInstanceTypeOffset = 1 * kApiPointerSize + kApiIntSize;
3811 static const int kStringResourceOffset = 3829 static const int kStringResourceOffset =
3812 InternalConstants<kApiPointerSize>::kStringResourceOffset; 3830 InternalConstants<kApiPointerSize>::kStringResourceOffset;
3813 3831
3814 static const int kForeignAddressOffset = kApiPointerSize; 3832 static const int kForeignAddressOffset = kApiPointerSize;
3815 static const int kJSObjectHeaderSize = 3 * kApiPointerSize; 3833 static const int kJSObjectHeaderSize = 3 * kApiPointerSize;
3816 static const int kFullStringRepresentationMask = 0x07; 3834 static const int kFullStringRepresentationMask = 0x07;
3817 static const int kExternalTwoByteRepresentationTag = 0x02; 3835 static const int kExternalTwoByteRepresentationTag = 0x02;
3818 3836
3819 static const int kJSObjectType = 0xa6; 3837 static const int kJSObjectType = 0xa7;
3820 static const int kFirstNonstringType = 0x80; 3838 static const int kFirstNonstringType = 0x80;
3821 static const int kForeignType = 0x85; 3839 static const int kForeignType = 0x85;
3822 3840
3823 static inline bool HasHeapObjectTag(internal::Object* value) { 3841 static inline bool HasHeapObjectTag(internal::Object* value) {
3824 return ((reinterpret_cast<intptr_t>(value) & kHeapObjectTagMask) == 3842 return ((reinterpret_cast<intptr_t>(value) & kHeapObjectTagMask) ==
3825 kHeapObjectTag); 3843 kHeapObjectTag);
3826 } 3844 }
3827 3845
3828 static inline bool HasSmiTag(internal::Object* value) { 3846 static inline bool HasSmiTag(internal::Object* value) {
3829 return ((reinterpret_cast<intptr_t>(value) & kSmiTagMask) == kSmiTag); 3847 return ((reinterpret_cast<intptr_t>(value) & kSmiTagMask) == kSmiTag);
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
4248 4266
4249 4267
4250 } // namespace v8 4268 } // namespace v8
4251 4269
4252 4270
4253 #undef V8EXPORT 4271 #undef V8EXPORT
4254 #undef TYPE_CHECK 4272 #undef TYPE_CHECK
4255 4273
4256 4274
4257 #endif // V8_H_ 4275 #endif // V8_H_
OLDNEW
« no previous file with comments | « ChangeLog ('k') | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698