| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 bool is_extended_mode() const { return language_mode() == EXTENDED_MODE; } | 70 bool is_extended_mode() const { return language_mode() == EXTENDED_MODE; } |
| 71 LanguageMode language_mode() const { | 71 LanguageMode language_mode() const { |
| 72 return LanguageModeField::decode(flags_); | 72 return LanguageModeField::decode(flags_); |
| 73 } | 73 } |
| 74 bool is_in_loop() const { return IsInLoop::decode(flags_); } | 74 bool is_in_loop() const { return IsInLoop::decode(flags_); } |
| 75 FunctionLiteral* function() const { return function_; } | 75 FunctionLiteral* function() const { return function_; } |
| 76 Scope* scope() const { return scope_; } | 76 Scope* scope() const { return scope_; } |
| 77 Scope* global_scope() const { return global_scope_; } | 77 Scope* global_scope() const { return global_scope_; } |
| 78 Handle<Code> code() const { return code_; } | 78 Handle<Code> code() const { return code_; } |
| 79 Handle<JSFunction> closure() const { return closure_; } | 79 Handle<JSFunction> closure() const { return closure_; } |
| 80 Handle<Object> closure_code_object() const { return closure_code_object_; } |
| 80 Handle<SharedFunctionInfo> shared_info() const { return shared_info_; } | 81 Handle<SharedFunctionInfo> shared_info() const { return shared_info_; } |
| 81 Handle<Script> script() const { return script_; } | 82 Handle<Script> script() const { return script_; } |
| 82 HydrogenCodeStub* code_stub() const {return code_stub_; } | 83 HydrogenCodeStub* code_stub() const {return code_stub_; } |
| 83 v8::Extension* extension() const { return extension_; } | 84 v8::Extension* extension() const { return extension_; } |
| 84 ScriptDataImpl* pre_parse_data() const { return pre_parse_data_; } | 85 ScriptDataImpl* pre_parse_data() const { return pre_parse_data_; } |
| 85 Handle<Context> context() const { return context_; } | 86 Handle<Context> context() const { return context_; } |
| 86 BailoutId osr_ast_id() const { return osr_ast_id_; } | 87 BailoutId osr_ast_id() const { return osr_ast_id_; } |
| 87 uint32_t osr_pc_offset() const { return osr_pc_offset_; } | 88 uint32_t osr_pc_offset() const { return osr_pc_offset_; } |
| 88 Handle<Code> osr_patched_code() const { return osr_patched_code_; } | 89 Handle<Code> osr_patched_code() const { return osr_patched_code_; } |
| 89 int opt_count() const { return opt_count_; } | 90 int opt_count() const { return opt_count_; } |
| 90 int num_parameters() const; | 91 int num_parameters() const; |
| 91 int num_heap_slots() const; | 92 int num_heap_slots() const; |
| 92 Code::Flags flags() const; | 93 Code::Flags flags() const; |
| 93 | 94 |
| 95 void CreateCodeObject(); |
| 94 void MarkAsEval() { | 96 void MarkAsEval() { |
| 95 ASSERT(!is_lazy()); | 97 ASSERT(!is_lazy()); |
| 96 flags_ |= IsEval::encode(true); | 98 flags_ |= IsEval::encode(true); |
| 97 } | 99 } |
| 98 void MarkAsGlobal() { | 100 void MarkAsGlobal() { |
| 99 ASSERT(!is_lazy()); | 101 ASSERT(!is_lazy()); |
| 100 flags_ |= IsGlobal::encode(true); | 102 flags_ |= IsGlobal::encode(true); |
| 101 } | 103 } |
| 102 void set_parameter_count(int parameter_count) { | 104 void set_parameter_count(int parameter_count) { |
| 103 ASSERT(IsStub()); | 105 ASSERT(IsStub()); |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 // For compiled stubs, the stub object | 400 // For compiled stubs, the stub object |
| 399 HydrogenCodeStub* code_stub_; | 401 HydrogenCodeStub* code_stub_; |
| 400 // The compiled code. | 402 // The compiled code. |
| 401 Handle<Code> code_; | 403 Handle<Code> code_; |
| 402 | 404 |
| 403 // Possible initial inputs to the compilation process. | 405 // Possible initial inputs to the compilation process. |
| 404 Handle<JSFunction> closure_; | 406 Handle<JSFunction> closure_; |
| 405 Handle<SharedFunctionInfo> shared_info_; | 407 Handle<SharedFunctionInfo> shared_info_; |
| 406 Handle<Script> script_; | 408 Handle<Script> script_; |
| 407 | 409 |
| 410 // Placeholder for self calls |
| 411 Handle<Object> closure_code_object_; |
| 412 |
| 408 // Fields possibly needed for eager compilation, NULL by default. | 413 // Fields possibly needed for eager compilation, NULL by default. |
| 409 v8::Extension* extension_; | 414 v8::Extension* extension_; |
| 410 ScriptDataImpl* pre_parse_data_; | 415 ScriptDataImpl* pre_parse_data_; |
| 411 | 416 |
| 412 // The context of the caller for eval code, and the global context for a | 417 // The context of the caller for eval code, and the global context for a |
| 413 // global script. Will be a null handle otherwise. | 418 // global script. Will be a null handle otherwise. |
| 414 Handle<Context> context_; | 419 Handle<Context> context_; |
| 415 | 420 |
| 416 // Compilation mode flag and whether deoptimization is allowed. | 421 // Compilation mode flag and whether deoptimization is allowed. |
| 417 Mode mode_; | 422 Mode mode_; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 431 // CompilationInfo allocates. | 436 // CompilationInfo allocates. |
| 432 Zone* zone_; | 437 Zone* zone_; |
| 433 | 438 |
| 434 DeferredHandles* deferred_handles_; | 439 DeferredHandles* deferred_handles_; |
| 435 | 440 |
| 436 ZoneList<Handle<HeapObject> >* dependencies_[DependentCode::kGroupCount]; | 441 ZoneList<Handle<HeapObject> >* dependencies_[DependentCode::kGroupCount]; |
| 437 | 442 |
| 438 template<typename T> | 443 template<typename T> |
| 439 void SaveHandle(Handle<T> *object) { | 444 void SaveHandle(Handle<T> *object) { |
| 440 if (!object->is_null()) { | 445 if (!object->is_null()) { |
| 441 Handle<T> handle(*(*object)); | 446 Handle<T> handle(*(*object), isolate()); |
| 442 *object = handle; | 447 *object = handle; |
| 443 } | 448 } |
| 444 } | 449 } |
| 445 | 450 |
| 446 BailoutReason bailout_reason_; | 451 BailoutReason bailout_reason_; |
| 447 | 452 |
| 448 int prologue_offset_; | 453 int prologue_offset_; |
| 449 | 454 |
| 450 List<OffsetRange>* no_frame_ranges_; | 455 List<OffsetRange>* no_frame_ranges_; |
| 451 | 456 |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 unsigned info_zone_start_allocation_size_; | 684 unsigned info_zone_start_allocation_size_; |
| 680 ElapsedTimer timer_; | 685 ElapsedTimer timer_; |
| 681 | 686 |
| 682 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); | 687 DISALLOW_COPY_AND_ASSIGN(CompilationPhase); |
| 683 }; | 688 }; |
| 684 | 689 |
| 685 | 690 |
| 686 } } // namespace v8::internal | 691 } } // namespace v8::internal |
| 687 | 692 |
| 688 #endif // V8_COMPILER_H_ | 693 #endif // V8_COMPILER_H_ |
| OLD | NEW |