| 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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 info->SetCode(code); | 245 info->SetCode(code); |
| 246 return true; | 246 return true; |
| 247 } | 247 } |
| 248 | 248 |
| 249 // Recompile the unoptimized version of the code if the current version | 249 // Recompile the unoptimized version of the code if the current version |
| 250 // doesn't have deoptimization support. Alternatively, we may decide to | 250 // doesn't have deoptimization support. Alternatively, we may decide to |
| 251 // run the full code generator to get a baseline for the compile-time | 251 // run the full code generator to get a baseline for the compile-time |
| 252 // performance of the hydrogen-based compiler. | 252 // performance of the hydrogen-based compiler. |
| 253 int64_t start = OS::Ticks(); | 253 int64_t start = OS::Ticks(); |
| 254 bool should_recompile = !info->shared_info()->has_deoptimization_support(); | 254 bool should_recompile = !info->shared_info()->has_deoptimization_support(); |
| 255 if (should_recompile || FLAG_time_hydrogen) { | 255 if (should_recompile || FLAG_hydrogen_stats) { |
| 256 HPhase phase(HPhase::kFullCodeGen); | 256 HPhase phase(HPhase::kFullCodeGen); |
| 257 CompilationInfo unoptimized(info->shared_info()); | 257 CompilationInfo unoptimized(info->shared_info()); |
| 258 // Note that we use the same AST that we will use for generating the | 258 // Note that we use the same AST that we will use for generating the |
| 259 // optimized code. | 259 // optimized code. |
| 260 unoptimized.SetFunction(info->function()); | 260 unoptimized.SetFunction(info->function()); |
| 261 unoptimized.SetScope(info->scope()); | 261 unoptimized.SetScope(info->scope()); |
| 262 if (should_recompile) unoptimized.EnableDeoptimizationSupport(); | 262 if (should_recompile) unoptimized.EnableDeoptimizationSupport(); |
| 263 bool succeeded = FullCodeGenerator::MakeCode(&unoptimized); | 263 bool succeeded = FullCodeGenerator::MakeCode(&unoptimized); |
| 264 if (should_recompile) { | 264 if (should_recompile) { |
| 265 if (!succeeded) return false; | 265 if (!succeeded) return false; |
| (...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 815 shared->DebugName())); | 815 shared->DebugName())); |
| 816 } | 816 } |
| 817 } | 817 } |
| 818 | 818 |
| 819 GDBJIT(AddCode(name, | 819 GDBJIT(AddCode(name, |
| 820 Handle<Script>(info->script()), | 820 Handle<Script>(info->script()), |
| 821 Handle<Code>(info->code()))); | 821 Handle<Code>(info->code()))); |
| 822 } | 822 } |
| 823 | 823 |
| 824 } } // namespace v8::internal | 824 } } // namespace v8::internal |
| OLD | NEW |