| 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 } | 171 } |
| 172 | 172 |
| 173 ParseRestriction parse_restriction() const { | 173 ParseRestriction parse_restriction() const { |
| 174 return ParseRestricitonField::decode(flags_); | 174 return ParseRestricitonField::decode(flags_); |
| 175 } | 175 } |
| 176 | 176 |
| 177 void SetFunction(FunctionLiteral* literal) { | 177 void SetFunction(FunctionLiteral* literal) { |
| 178 ASSERT(function_ == NULL); | 178 ASSERT(function_ == NULL); |
| 179 function_ = literal; | 179 function_ = literal; |
| 180 } | 180 } |
| 181 // When the scope is applied, we may have deferred work to do on the function. | |
| 182 void PrepareForCompilation(Scope* scope); | 181 void PrepareForCompilation(Scope* scope); |
| 183 void SetGlobalScope(Scope* global_scope) { | 182 void SetGlobalScope(Scope* global_scope) { |
| 184 ASSERT(global_scope_ == NULL); | 183 ASSERT(global_scope_ == NULL); |
| 185 global_scope_ = global_scope; | 184 global_scope_ = global_scope; |
| 186 } | 185 } |
| 186 Handle<FixedArray> feedback_vector() const { |
| 187 return feedback_vector_; |
| 188 } |
| 187 void SetCode(Handle<Code> code) { code_ = code; } | 189 void SetCode(Handle<Code> code) { code_ = code; } |
| 188 void SetExtension(v8::Extension* extension) { | 190 void SetExtension(v8::Extension* extension) { |
| 189 ASSERT(!is_lazy()); | 191 ASSERT(!is_lazy()); |
| 190 extension_ = extension; | 192 extension_ = extension; |
| 191 } | 193 } |
| 192 void SetCachedData(ScriptData** cached_data, | 194 void SetCachedData(ScriptData** cached_data, |
| 193 CachedDataMode cached_data_mode) { | 195 CachedDataMode cached_data_mode) { |
| 194 cached_data_mode_ = cached_data_mode; | 196 cached_data_mode_ = cached_data_mode; |
| 195 if (cached_data_mode == NO_CACHED_DATA) { | 197 if (cached_data_mode == NO_CACHED_DATA) { |
| 196 cached_data_ = NULL; | 198 cached_data_ = NULL; |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 | 414 |
| 413 // Fields possibly needed for eager compilation, NULL by default. | 415 // Fields possibly needed for eager compilation, NULL by default. |
| 414 v8::Extension* extension_; | 416 v8::Extension* extension_; |
| 415 ScriptData** cached_data_; | 417 ScriptData** cached_data_; |
| 416 CachedDataMode cached_data_mode_; | 418 CachedDataMode cached_data_mode_; |
| 417 | 419 |
| 418 // The context of the caller for eval code, and the global context for a | 420 // The context of the caller for eval code, and the global context for a |
| 419 // global script. Will be a null handle otherwise. | 421 // global script. Will be a null handle otherwise. |
| 420 Handle<Context> context_; | 422 Handle<Context> context_; |
| 421 | 423 |
| 424 // Used by codegen, ultimately kept rooted by the SharedFunctionInfo. |
| 425 Handle<FixedArray> feedback_vector_; |
| 426 |
| 422 // Compilation mode flag and whether deoptimization is allowed. | 427 // Compilation mode flag and whether deoptimization is allowed. |
| 423 Mode mode_; | 428 Mode mode_; |
| 424 BailoutId osr_ast_id_; | 429 BailoutId osr_ast_id_; |
| 425 // The unoptimized code we patched for OSR may not be the shared code | 430 // The unoptimized code we patched for OSR may not be the shared code |
| 426 // afterwards, since we may need to compile it again to include deoptimization | 431 // afterwards, since we may need to compile it again to include deoptimization |
| 427 // data. Keep track which code we patched. | 432 // data. Keep track which code we patched. |
| 428 Handle<Code> unoptimized_code_; | 433 Handle<Code> unoptimized_code_; |
| 429 | 434 |
| 430 // Flag whether compilation needs to be aborted due to dependency change. | 435 // Flag whether compilation needs to be aborted due to dependency change. |
| 431 bool abort_due_to_dependency_; | 436 bool abort_due_to_dependency_; |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 692 unsigned info_zone_start_allocation_size_; | 697 unsigned info_zone_start_allocation_size_; |
| 693 ElapsedTimer timer_; | 698 ElapsedTimer timer_; |
| 694 | 699 |
| 695 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); | 700 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); |
| 696 }; | 701 }; |
| 697 | 702 |
| 698 | 703 |
| 699 } } // namespace v8::internal | 704 } } // namespace v8::internal |
| 700 | 705 |
| 701 #endif // V8_COMPILER_H_ | 706 #endif // V8_COMPILER_H_ |
| OLD | NEW |