OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 27 matching lines...) Expand all Loading... | |
38 class ScriptDataImpl; | 38 class ScriptDataImpl; |
39 | 39 |
40 // CompilationInfo encapsulates some information known at compile time. It | 40 // CompilationInfo encapsulates some information known at compile time. It |
41 // is constructed based on the resources available at compile-time. | 41 // is constructed based on the resources available at compile-time. |
42 class CompilationInfo BASE_EMBEDDED { | 42 class CompilationInfo BASE_EMBEDDED { |
43 public: | 43 public: |
44 CompilationInfo(Handle<Script> script, Zone* zone); | 44 CompilationInfo(Handle<Script> script, Zone* zone); |
45 CompilationInfo(Handle<SharedFunctionInfo> shared_info, Zone* zone); | 45 CompilationInfo(Handle<SharedFunctionInfo> shared_info, Zone* zone); |
46 CompilationInfo(Handle<JSFunction> closure, Zone* zone); | 46 CompilationInfo(Handle<JSFunction> closure, Zone* zone); |
47 | 47 |
48 ~CompilationInfo(); | |
49 | |
48 Isolate* isolate() { | 50 Isolate* isolate() { |
49 ASSERT(Isolate::Current() == isolate_); | 51 ASSERT(Isolate::Current() == isolate_); |
50 return isolate_; | 52 return isolate_; |
51 } | 53 } |
52 Zone* zone() { | 54 Zone* zone() { |
53 return zone_; | 55 return zone_; |
54 } | 56 } |
55 bool is_lazy() const { return IsLazy::decode(flags_); } | 57 bool is_lazy() const { return IsLazy::decode(flags_); } |
56 bool is_eval() const { return IsEval::decode(flags_); } | 58 bool is_eval() const { return IsEval::decode(flags_); } |
57 bool is_global() const { return IsGlobal::decode(flags_); } | 59 bool is_global() const { return IsGlobal::decode(flags_); } |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
166 flags_ |= SupportsDeoptimization::encode(true); | 168 flags_ |= SupportsDeoptimization::encode(true); |
167 } | 169 } |
168 | 170 |
169 // Determines whether or not to insert a self-optimization header. | 171 // Determines whether or not to insert a self-optimization header. |
170 bool ShouldSelfOptimize(); | 172 bool ShouldSelfOptimize(); |
171 | 173 |
172 // Disable all optimization attempts of this info for the rest of the | 174 // Disable all optimization attempts of this info for the rest of the |
173 // current compilation pipeline. | 175 // current compilation pipeline. |
174 void AbortOptimization(); | 176 void AbortOptimization(); |
175 | 177 |
178 void RememberHiddenExtensions( | |
Erik Corry
2012/06/22 11:08:36
Could be called StorePersistentExtensions.
sanjoy
2012/06/22 20:08:10
Fixed.
| |
179 HandleScopeImplementer::HiddenExtensions* extensions) { | |
180 ASSERT(!hidden_extensions_); | |
181 hidden_extensions_ = extensions; | |
182 } | |
183 | |
176 private: | 184 private: |
177 Isolate* isolate_; | 185 Isolate* isolate_; |
178 | 186 |
179 // Compilation mode. | 187 // Compilation mode. |
180 // BASE is generated by the full codegen, optionally prepared for bailouts. | 188 // BASE is generated by the full codegen, optionally prepared for bailouts. |
181 // OPTIMIZE is optimized code generated by the Hydrogen-based backend. | 189 // OPTIMIZE is optimized code generated by the Hydrogen-based backend. |
182 // NONOPT is generated by the full codegen and is not prepared for | 190 // NONOPT is generated by the full codegen and is not prepared for |
183 // recompilation/bailouts. These functions are never recompiled. | 191 // recompilation/bailouts. These functions are never recompiled. |
184 enum Mode { | 192 enum Mode { |
185 BASE, | 193 BASE, |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
252 Handle<Context> calling_context_; | 260 Handle<Context> calling_context_; |
253 | 261 |
254 // Compilation mode flag and whether deoptimization is allowed. | 262 // Compilation mode flag and whether deoptimization is allowed. |
255 Mode mode_; | 263 Mode mode_; |
256 int osr_ast_id_; | 264 int osr_ast_id_; |
257 | 265 |
258 // The zone from which the compilation pipeline working on this | 266 // The zone from which the compilation pipeline working on this |
259 // CompilationInfo allocates. | 267 // CompilationInfo allocates. |
260 Zone* zone_; | 268 Zone* zone_; |
261 | 269 |
270 HandleScopeImplementer::HiddenExtensions* hidden_extensions_; | |
271 | |
262 DISALLOW_COPY_AND_ASSIGN(CompilationInfo); | 272 DISALLOW_COPY_AND_ASSIGN(CompilationInfo); |
263 }; | 273 }; |
264 | 274 |
265 | 275 |
266 // Exactly like a CompilationInfo, except also creates and enters a | 276 // Exactly like a CompilationInfo, except also creates and enters a |
267 // Zone on construction and deallocates it on exit. | 277 // Zone on construction and deallocates it on exit. |
268 class CompilationInfoWithZone: public CompilationInfo { | 278 class CompilationInfoWithZone: public CompilationInfo { |
269 public: | 279 public: |
270 explicit CompilationInfoWithZone(Handle<Script> script) | 280 explicit CompilationInfoWithZone(Handle<Script> script) |
271 : CompilationInfo(script, &zone_), | 281 : CompilationInfo(script, &zone_), |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
350 | 360 |
351 static void RecordFunctionCompilation(Logger::LogEventsAndTags tag, | 361 static void RecordFunctionCompilation(Logger::LogEventsAndTags tag, |
352 CompilationInfo* info, | 362 CompilationInfo* info, |
353 Handle<SharedFunctionInfo> shared); | 363 Handle<SharedFunctionInfo> shared); |
354 }; | 364 }; |
355 | 365 |
356 | 366 |
357 } } // namespace v8::internal | 367 } } // namespace v8::internal |
358 | 368 |
359 #endif // V8_COMPILER_H_ | 369 #endif // V8_COMPILER_H_ |
OLD | NEW |