| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 | 51 |
| 52 | 52 |
| 53 CompilationInfo::CompilationInfo(Handle<Script> script) | 53 CompilationInfo::CompilationInfo(Handle<Script> script) |
| 54 : flags_(0), | 54 : flags_(0), |
| 55 function_(NULL), | 55 function_(NULL), |
| 56 scope_(NULL), | 56 scope_(NULL), |
| 57 script_(script), | 57 script_(script), |
| 58 extension_(NULL), | 58 extension_(NULL), |
| 59 pre_parse_data_(NULL), | 59 pre_parse_data_(NULL), |
| 60 supports_deoptimization_(false), | 60 supports_deoptimization_(false), |
| 61 osr_ast_id_(AstNode::kNoNumber) { | 61 osr_ast_id_(kNoAstId) { |
| 62 Initialize(NONOPT); | 62 Initialize(NONOPT); |
| 63 } | 63 } |
| 64 | 64 |
| 65 | 65 |
| 66 CompilationInfo::CompilationInfo(Handle<SharedFunctionInfo> shared_info) | 66 CompilationInfo::CompilationInfo(Handle<SharedFunctionInfo> shared_info) |
| 67 : flags_(IsLazy::encode(true)), | 67 : flags_(IsLazy::encode(true)), |
| 68 function_(NULL), | 68 function_(NULL), |
| 69 scope_(NULL), | 69 scope_(NULL), |
| 70 shared_info_(shared_info), | 70 shared_info_(shared_info), |
| 71 script_(Handle<Script>(Script::cast(shared_info->script()))), | 71 script_(Handle<Script>(Script::cast(shared_info->script()))), |
| 72 extension_(NULL), | 72 extension_(NULL), |
| 73 pre_parse_data_(NULL), | 73 pre_parse_data_(NULL), |
| 74 supports_deoptimization_(false), | 74 supports_deoptimization_(false), |
| 75 osr_ast_id_(AstNode::kNoNumber) { | 75 osr_ast_id_(kNoAstId) { |
| 76 Initialize(BASE); | 76 Initialize(BASE); |
| 77 } | 77 } |
| 78 | 78 |
| 79 | 79 |
| 80 CompilationInfo::CompilationInfo(Handle<JSFunction> closure) | 80 CompilationInfo::CompilationInfo(Handle<JSFunction> closure) |
| 81 : flags_(IsLazy::encode(true)), | 81 : flags_(IsLazy::encode(true)), |
| 82 function_(NULL), | 82 function_(NULL), |
| 83 scope_(NULL), | 83 scope_(NULL), |
| 84 closure_(closure), | 84 closure_(closure), |
| 85 shared_info_(Handle<SharedFunctionInfo>(closure->shared())), | 85 shared_info_(Handle<SharedFunctionInfo>(closure->shared())), |
| 86 script_(Handle<Script>(Script::cast(shared_info_->script()))), | 86 script_(Handle<Script>(Script::cast(shared_info_->script()))), |
| 87 extension_(NULL), | 87 extension_(NULL), |
| 88 pre_parse_data_(NULL), | 88 pre_parse_data_(NULL), |
| 89 supports_deoptimization_(false), | 89 supports_deoptimization_(false), |
| 90 osr_ast_id_(AstNode::kNoNumber) { | 90 osr_ast_id_(kNoAstId) { |
| 91 Initialize(BASE); | 91 Initialize(BASE); |
| 92 } | 92 } |
| 93 | 93 |
| 94 | 94 |
| 95 // Determine whether to use the full compiler for all code. If the flag | 95 // Determine whether to use the full compiler for all code. If the flag |
| 96 // --always-full-compiler is specified this is the case. For the virtual frame | 96 // --always-full-compiler is specified this is the case. For the virtual frame |
| 97 // based compiler the full compiler is also used if a debugger is connected, as | 97 // based compiler the full compiler is also used if a debugger is connected, as |
| 98 // the code from the full compiler supports mode precise break points. For the | 98 // the code from the full compiler supports mode precise break points. For the |
| 99 // crankshaft adaptive compiler debugging the optimized code is not possible at | 99 // crankshaft adaptive compiler debugging the optimized code is not possible at |
| 100 // all. However crankshaft support recompilation of functions, so in this case | 100 // all. However crankshaft support recompilation of functions, so in this case |
| (...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 601 // Check the function has compiled code. | 601 // Check the function has compiled code. |
| 602 ASSERT(shared->is_compiled()); | 602 ASSERT(shared->is_compiled()); |
| 603 shared->set_code_age(0); | 603 shared->set_code_age(0); |
| 604 | 604 |
| 605 if (V8::UseCrankshaft() && info->AllowOptimize()) { | 605 if (V8::UseCrankshaft() && info->AllowOptimize()) { |
| 606 // If we're asked to always optimize, we compile the optimized | 606 // If we're asked to always optimize, we compile the optimized |
| 607 // version of the function right away - unless the debugger is | 607 // version of the function right away - unless the debugger is |
| 608 // active as it makes no sense to compile optimized code then. | 608 // active as it makes no sense to compile optimized code then. |
| 609 if (FLAG_always_opt && !Debug::has_break_points()) { | 609 if (FLAG_always_opt && !Debug::has_break_points()) { |
| 610 CompilationInfo optimized(function); | 610 CompilationInfo optimized(function); |
| 611 optimized.SetOptimizing(AstNode::kNoNumber); | 611 optimized.SetOptimizing(kNoAstId); |
| 612 return CompileLazy(&optimized); | 612 return CompileLazy(&optimized); |
| 613 } else if (CompilationCache::ShouldOptimizeEagerly(function)) { | 613 } else if (CompilationCache::ShouldOptimizeEagerly(function)) { |
| 614 RuntimeProfiler::OptimizeSoon(*function); | 614 RuntimeProfiler::OptimizeSoon(*function); |
| 615 } | 615 } |
| 616 } | 616 } |
| 617 } | 617 } |
| 618 | 618 |
| 619 return true; | 619 return true; |
| 620 } | 620 } |
| 621 } | 621 } |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 755 *code, | 755 *code, |
| 756 *name)); | 756 *name)); |
| 757 OPROFILE(CreateNativeCodeRegion(*name, | 757 OPROFILE(CreateNativeCodeRegion(*name, |
| 758 code->instruction_start(), | 758 code->instruction_start(), |
| 759 code->instruction_size())); | 759 code->instruction_size())); |
| 760 } | 760 } |
| 761 } | 761 } |
| 762 } | 762 } |
| 763 | 763 |
| 764 } } // namespace v8::internal | 764 } } // namespace v8::internal |
| OLD | NEW |