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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 void SetFunction(FunctionLiteral* literal) { | 168 void SetFunction(FunctionLiteral* literal) { |
169 ASSERT(function_ == NULL); | 169 ASSERT(function_ == NULL); |
170 function_ = literal; | 170 function_ = literal; |
171 } | 171 } |
172 // When the scope is applied, we may have deferred work to do on the function. | 172 // When the scope is applied, we may have deferred work to do on the function. |
173 void PrepareForCompilation(Scope* scope); | 173 void PrepareForCompilation(Scope* scope); |
174 void SetGlobalScope(Scope* global_scope) { | 174 void SetGlobalScope(Scope* global_scope) { |
175 ASSERT(global_scope_ == NULL); | 175 ASSERT(global_scope_ == NULL); |
176 global_scope_ = global_scope; | 176 global_scope_ = global_scope; |
177 } | 177 } |
| 178 Handle<FixedArray> feedback_vector() const { |
| 179 return feedback_vector_; |
| 180 } |
178 void SetCode(Handle<Code> code) { code_ = code; } | 181 void SetCode(Handle<Code> code) { code_ = code; } |
179 void SetExtension(v8::Extension* extension) { | 182 void SetExtension(v8::Extension* extension) { |
180 ASSERT(!is_lazy()); | 183 ASSERT(!is_lazy()); |
181 extension_ = extension; | 184 extension_ = extension; |
182 } | 185 } |
183 void SetPreParseData(ScriptDataImpl* pre_parse_data) { | 186 void SetPreParseData(ScriptDataImpl* pre_parse_data) { |
184 ASSERT(!is_lazy()); | 187 ASSERT(!is_lazy()); |
185 pre_parse_data_ = pre_parse_data; | 188 pre_parse_data_ = pre_parse_data; |
186 } | 189 } |
187 void SetContext(Handle<Context> context) { | 190 void SetContext(Handle<Context> context) { |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 Handle<Script> script_; | 399 Handle<Script> script_; |
397 | 400 |
398 // Fields possibly needed for eager compilation, NULL by default. | 401 // Fields possibly needed for eager compilation, NULL by default. |
399 v8::Extension* extension_; | 402 v8::Extension* extension_; |
400 ScriptDataImpl* pre_parse_data_; | 403 ScriptDataImpl* pre_parse_data_; |
401 | 404 |
402 // The context of the caller for eval code, and the global context for a | 405 // The context of the caller for eval code, and the global context for a |
403 // global script. Will be a null handle otherwise. | 406 // global script. Will be a null handle otherwise. |
404 Handle<Context> context_; | 407 Handle<Context> context_; |
405 | 408 |
| 409 // Used by codegen, ultimately kept rooted by the SharedFunctionInfo. |
| 410 Handle<FixedArray> feedback_vector_; |
| 411 |
406 // Compilation mode flag and whether deoptimization is allowed. | 412 // Compilation mode flag and whether deoptimization is allowed. |
407 Mode mode_; | 413 Mode mode_; |
408 BailoutId osr_ast_id_; | 414 BailoutId osr_ast_id_; |
409 // The unoptimized code we patched for OSR may not be the shared code | 415 // The unoptimized code we patched for OSR may not be the shared code |
410 // afterwards, since we may need to compile it again to include deoptimization | 416 // afterwards, since we may need to compile it again to include deoptimization |
411 // data. Keep track which code we patched. | 417 // data. Keep track which code we patched. |
412 Handle<Code> unoptimized_code_; | 418 Handle<Code> unoptimized_code_; |
413 | 419 |
414 // Flag whether compilation needs to be aborted due to dependency change. | 420 // Flag whether compilation needs to be aborted due to dependency change. |
415 bool abort_due_to_dependency_; | 421 bool abort_due_to_dependency_; |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
672 unsigned info_zone_start_allocation_size_; | 678 unsigned info_zone_start_allocation_size_; |
673 ElapsedTimer timer_; | 679 ElapsedTimer timer_; |
674 | 680 |
675 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); | 681 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); |
676 }; | 682 }; |
677 | 683 |
678 | 684 |
679 } } // namespace v8::internal | 685 } } // namespace v8::internal |
680 | 686 |
681 #endif // V8_COMPILER_H_ | 687 #endif // V8_COMPILER_H_ |
OLD | NEW |