| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 // Compile a String source within a context. | 54 // Compile a String source within a context. |
| 55 static Handle<JSFunction> Compile(Handle<String> source, | 55 static Handle<JSFunction> Compile(Handle<String> source, |
| 56 Handle<Object> script_name, | 56 Handle<Object> script_name, |
| 57 int line_offset, int column_offset, | 57 int line_offset, int column_offset, |
| 58 v8::Extension* extension, | 58 v8::Extension* extension, |
| 59 ScriptDataImpl* script_Data); | 59 ScriptDataImpl* script_Data); |
| 60 | 60 |
| 61 // Compile a String source within a context for Eval. | 61 // Compile a String source within a context for Eval. |
| 62 static Handle<JSFunction> CompileEval(Handle<String> source, | 62 static Handle<JSFunction> CompileEval(Handle<String> source, |
| 63 Handle<Context> context, | 63 Handle<Context> context, |
| 64 int line_offset, | |
| 65 bool is_global, | 64 bool is_global, |
| 66 bool is_json); | 65 bool is_json); |
| 67 | 66 |
| 68 // Compile from function info (used for lazy compilation). Returns | 67 // Compile from function info (used for lazy compilation). Returns |
| 69 // true on success and false if the compilation resulted in a stack | 68 // true on success and false if the compilation resulted in a stack |
| 70 // overflow. | 69 // overflow. |
| 71 static bool CompileLazy(Handle<SharedFunctionInfo> shared, int loop_nesting); | 70 static bool CompileLazy(Handle<SharedFunctionInfo> shared, int loop_nesting); |
| 72 }; | 71 }; |
| 73 | 72 |
| 74 | 73 |
| 75 // During compilation we need a global list of handles to constants | 74 // During compilation we need a global list of handles to constants |
| 76 // for frame elements. When the zone gets deleted, we make sure to | 75 // for frame elements. When the zone gets deleted, we make sure to |
| 77 // clear this list of handles as well. | 76 // clear this list of handles as well. |
| 78 class CompilationZoneScope : public ZoneScope { | 77 class CompilationZoneScope : public ZoneScope { |
| 79 public: | 78 public: |
| 80 explicit CompilationZoneScope(ZoneScopeMode mode) : ZoneScope(mode) { } | 79 explicit CompilationZoneScope(ZoneScopeMode mode) : ZoneScope(mode) { } |
| 81 virtual ~CompilationZoneScope() { | 80 virtual ~CompilationZoneScope() { |
| 82 if (ShouldDeleteOnExit()) { | 81 if (ShouldDeleteOnExit()) { |
| 83 FrameElement::ClearConstantList(); | 82 FrameElement::ClearConstantList(); |
| 84 Result::ClearConstantList(); | 83 Result::ClearConstantList(); |
| 85 } | 84 } |
| 86 } | 85 } |
| 87 }; | 86 }; |
| 88 | 87 |
| 89 | 88 |
| 90 } } // namespace v8::internal | 89 } } // namespace v8::internal |
| 91 | 90 |
| 92 #endif // V8_COMPILER_H_ | 91 #endif // V8_COMPILER_H_ |
| OLD | NEW |