| 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 // generator 'caller' to build the boilerplate. | 113 // generator 'caller' to build the boilerplate. |
| 114 static Handle<JSFunction> BuildBoilerplate(FunctionLiteral* node, | 114 static Handle<JSFunction> BuildBoilerplate(FunctionLiteral* node, |
| 115 Handle<Script> script, | 115 Handle<Script> script, |
| 116 AstVisitor* caller); | 116 AstVisitor* caller); |
| 117 | 117 |
| 118 // Set the function info for a newly compiled function. | 118 // Set the function info for a newly compiled function. |
| 119 static void SetFunctionInfo(Handle<JSFunction> fun, | 119 static void SetFunctionInfo(Handle<JSFunction> fun, |
| 120 FunctionLiteral* lit, | 120 FunctionLiteral* lit, |
| 121 bool is_toplevel, | 121 bool is_toplevel, |
| 122 Handle<Script> script); | 122 Handle<Script> script); |
| 123 |
| 124 private: |
| 125 |
| 126 #if defined ENABLE_LOGGING_AND_PROFILING || defined ENABLE_OPROFILE_AGENT |
| 127 static void LogCodeCreateEvent(Logger::LogEventsAndTags tag, |
| 128 Handle<String> name, |
| 129 Handle<String> inferred_name, |
| 130 int start_position, |
| 131 Handle<Script> script, |
| 132 Handle<Code> code); |
| 133 #endif |
| 123 }; | 134 }; |
| 124 | 135 |
| 125 | 136 |
| 126 // During compilation we need a global list of handles to constants | 137 // During compilation we need a global list of handles to constants |
| 127 // for frame elements. When the zone gets deleted, we make sure to | 138 // for frame elements. When the zone gets deleted, we make sure to |
| 128 // clear this list of handles as well. | 139 // clear this list of handles as well. |
| 129 class CompilationZoneScope : public ZoneScope { | 140 class CompilationZoneScope : public ZoneScope { |
| 130 public: | 141 public: |
| 131 explicit CompilationZoneScope(ZoneScopeMode mode) : ZoneScope(mode) { } | 142 explicit CompilationZoneScope(ZoneScopeMode mode) : ZoneScope(mode) { } |
| 132 virtual ~CompilationZoneScope() { | 143 virtual ~CompilationZoneScope() { |
| 133 if (ShouldDeleteOnExit()) { | 144 if (ShouldDeleteOnExit()) { |
| 134 FrameElement::ClearConstantList(); | 145 FrameElement::ClearConstantList(); |
| 135 Result::ClearConstantList(); | 146 Result::ClearConstantList(); |
| 136 } | 147 } |
| 137 } | 148 } |
| 138 }; | 149 }; |
| 139 | 150 |
| 140 | 151 |
| 141 } } // namespace v8::internal | 152 } } // namespace v8::internal |
| 142 | 153 |
| 143 #endif // V8_COMPILER_H_ | 154 #endif // V8_COMPILER_H_ |
| OLD | NEW |