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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 info()->SetCode(code); | 360 info()->SetCode(code); |
361 return SetLastStatus(BAILED_OUT); | 361 return SetLastStatus(BAILED_OUT); |
362 } | 362 } |
363 | 363 |
364 // Recompile the unoptimized version of the code if the current version | 364 // Recompile the unoptimized version of the code if the current version |
365 // doesn't have deoptimization support. Alternatively, we may decide to | 365 // doesn't have deoptimization support. Alternatively, we may decide to |
366 // run the full code generator to get a baseline for the compile-time | 366 // run the full code generator to get a baseline for the compile-time |
367 // performance of the hydrogen-based compiler. | 367 // performance of the hydrogen-based compiler. |
368 bool should_recompile = !info()->shared_info()->has_deoptimization_support(); | 368 bool should_recompile = !info()->shared_info()->has_deoptimization_support(); |
369 if (should_recompile || FLAG_hydrogen_stats) { | 369 if (should_recompile || FLAG_hydrogen_stats) { |
370 HPhase phase(HPhase::kFullCodeGen, isolate()); | 370 HPhase phase(HPhase::kFullCodeGen, isolate(), info()->zone()); |
371 CompilationInfoWithZone unoptimized(info()->shared_info()); | 371 CompilationInfoWithZone unoptimized(info()->shared_info()); |
372 // Note that we use the same AST that we will use for generating the | 372 // Note that we use the same AST that we will use for generating the |
373 // optimized code. | 373 // optimized code. |
374 unoptimized.SetFunction(info()->function()); | 374 unoptimized.SetFunction(info()->function()); |
375 unoptimized.SetScope(info()->scope()); | 375 unoptimized.SetScope(info()->scope()); |
376 unoptimized.SetContext(info()->context()); | 376 unoptimized.SetContext(info()->context()); |
377 if (should_recompile) unoptimized.EnableDeoptimizationSupport(); | 377 if (should_recompile) unoptimized.EnableDeoptimizationSupport(); |
378 bool succeeded = FullCodeGenerator::MakeCode(&unoptimized); | 378 bool succeeded = FullCodeGenerator::MakeCode(&unoptimized); |
379 if (should_recompile) { | 379 if (should_recompile) { |
380 if (!succeeded) return SetLastStatus(FAILED); | 380 if (!succeeded) return SetLastStatus(FAILED); |
(...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1201 } | 1201 } |
1202 } | 1202 } |
1203 | 1203 |
1204 GDBJIT(AddCode(Handle<String>(shared->DebugName()), | 1204 GDBJIT(AddCode(Handle<String>(shared->DebugName()), |
1205 Handle<Script>(info->script()), | 1205 Handle<Script>(info->script()), |
1206 Handle<Code>(info->code()), | 1206 Handle<Code>(info->code()), |
1207 info)); | 1207 info)); |
1208 } | 1208 } |
1209 | 1209 |
1210 } } // namespace v8::internal | 1210 } } // namespace v8::internal |
OLD | NEW |