00001 // Copyright 2006-2008 the V8 project authors. All rights reserved. 00002 // Redistribution and use in source and binary forms, with or without 00003 // modification, are permitted provided that the following conditions are 00004 // met: 00005 // 00006 // * Redistributions of source code must retain the above copyright 00007 // notice, this list of conditions and the following disclaimer. 00008 // * Redistributions in binary form must reproduce the above 00009 // copyright notice, this list of conditions and the following 00010 // disclaimer in the documentation and/or other materials provided 00011 // with the distribution. 00012 // * Neither the name of Google Inc. nor the names of its 00013 // contributors may be used to endorse or promote products derived 00014 // from this software without specific prior written permission. 00015 // 00016 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00017 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00018 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 00019 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 00020 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00021 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00022 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00023 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00024 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00025 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00026 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00027 00028 // 00029 // Top include for all V8 .cc files. 00030 // 00031 00032 #ifndef V8_V8_H_ 00033 #define V8_V8_H_ 00034 00035 #if defined(GOOGLE3) 00036 // Google3 special flag handling. 00037 #if defined(DEBUG) && defined(NDEBUG) 00038 // If both are defined in Google3, then we are building an optimized v8 with 00039 // assertions enabled. 00040 #undef NDEBUG 00041 #endif 00042 #endif // defined(GOOGLE3) 00043 00044 // V8 only uses DEBUG, but included external files 00045 // may use NDEBUG - make sure they are consistent. 00046 #if defined(DEBUG) && defined(NDEBUG) 00047 #error both DEBUG and NDEBUG are set 00048 #endif 00049 00050 // Basic includes 00051 #include "../include/v8.h" 00052 #include "globals.h" 00053 #include "checks.h" 00054 #include "allocation.h" 00055 #include "utils.h" 00056 #include "flags.h" 00057 00058 // Objects & heap 00059 #include "objects.h" 00060 #include "spaces.h" 00061 #include "heap.h" 00062 #include "objects-inl.h" 00063 #include "spaces-inl.h" 00064 #include "heap-inl.h" 00065 #include "messages.h" 00066 00067 namespace v8 { namespace internal { 00068 00069 class V8 : public AllStatic { 00070 public: 00071 // Global actions. 00072 00073 // If Initialize is called with des == NULL, the 00074 // initial state is created from scratch. If a non-null Deserializer 00075 // is given, the initial state is created by reading the 00076 // deserialized data into an empty heap. 00077 static bool Initialize(Deserializer* des); 00078 static void TearDown(); 00079 static bool HasBeenSetup() { return has_been_setup_; } 00080 static bool HasBeenDisposed() { return has_been_disposed_; } 00081 00082 // Report process out of memory. Implementation found in api.cc. 00083 static void FatalProcessOutOfMemory(const char* location); 00084 private: 00085 static bool has_been_setup_; 00086 static bool has_been_disposed_; 00087 }; 00088 00089 } } // namespace v8::internal 00090 00091 #endif // V8_V8_H_