Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 11 matching lines...) Expand all Loading... | |
| 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | 27 |
| 28 #ifndef V8_COMPILER_H_ | 28 #ifndef V8_COMPILER_H_ |
| 29 #define V8_COMPILER_H_ | 29 #define V8_COMPILER_H_ |
| 30 | 30 |
| 31 #include "parser.h" | 31 #include "parser.h" |
| 32 #include "zone.h" | |
| 33 #include "frame-element.h" | |
|
Kevin Millikin (Chromium)
2009/05/14 11:29:02
Is it OK to alphabetize these?
Mads Ager (chromium)
2009/05/14 11:42:40
It is. Done.
| |
| 32 | 34 |
| 33 namespace v8 { namespace internal { | 35 namespace v8 { namespace internal { |
| 34 | 36 |
| 35 // The V8 compiler | 37 // The V8 compiler |
| 36 // | 38 // |
| 37 // General strategy: Source code is translated into an anonymous function w/o | 39 // General strategy: Source code is translated into an anonymous function w/o |
| 38 // parameters which then can be executed. If the source code contains other | 40 // parameters which then can be executed. If the source code contains other |
| 39 // functions, they will be compiled and allocated as part of the compilation | 41 // functions, they will be compiled and allocated as part of the compilation |
| 40 // of the source code. | 42 // of the source code. |
| 41 | 43 |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 62 int line_offset, | 64 int line_offset, |
| 63 bool is_global, | 65 bool is_global, |
| 64 bool is_json); | 66 bool is_json); |
| 65 | 67 |
| 66 // Compile from function info (used for lazy compilation). Returns | 68 // Compile from function info (used for lazy compilation). Returns |
| 67 // true on success and false if the compilation resulted in a stack | 69 // true on success and false if the compilation resulted in a stack |
| 68 // overflow. | 70 // overflow. |
| 69 static bool CompileLazy(Handle<SharedFunctionInfo> shared, int loop_nesting); | 71 static bool CompileLazy(Handle<SharedFunctionInfo> shared, int loop_nesting); |
| 70 }; | 72 }; |
| 71 | 73 |
| 74 | |
| 75 // During compilation we need a global list of handles to constants | |
| 76 // for frame elements. When the zone gets deleted, we make sure to | |
| 77 // clear this list of handles as well. | |
| 78 class CompilationZoneScope : public ZoneScope { | |
| 79 public: | |
| 80 CompilationZoneScope(ZoneScopeMode mode) : ZoneScope(mode) { }; | |
| 81 virtual ~CompilationZoneScope() { | |
| 82 if (ShouldDeleteOnExit()) FrameElement::ClearConstantList(); | |
| 83 }; | |
| 84 }; | |
| 85 | |
| 86 | |
| 72 } } // namespace v8::internal | 87 } } // namespace v8::internal |
| 73 | 88 |
| 74 #endif // V8_COMPILER_H_ | 89 #endif // V8_COMPILER_H_ |
| OLD | NEW |