| 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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 // support. | 274 // support. |
| 275 ASSERT(FLAG_always_opt || code->optimizable()); | 275 ASSERT(FLAG_always_opt || code->optimizable()); |
| 276 ASSERT(info->shared_info()->has_deoptimization_support()); | 276 ASSERT(info->shared_info()->has_deoptimization_support()); |
| 277 | 277 |
| 278 if (FLAG_trace_hydrogen) { | 278 if (FLAG_trace_hydrogen) { |
| 279 PrintF("-----------------------------------------------------------\n"); | 279 PrintF("-----------------------------------------------------------\n"); |
| 280 PrintF("Compiling method %s using hydrogen\n", *name->ToCString()); | 280 PrintF("Compiling method %s using hydrogen\n", *name->ToCString()); |
| 281 HTracer::Instance()->TraceCompilation(info->function()); | 281 HTracer::Instance()->TraceCompilation(info->function()); |
| 282 } | 282 } |
| 283 | 283 |
| 284 TypeFeedbackOracle oracle( | 284 Handle<Context> global_context(info->closure()->context()->global_context()); |
| 285 code, Handle<Context>(info->closure()->context()->global_context())); | 285 TypeFeedbackOracle oracle(code, global_context); |
| 286 HGraphBuilder builder(&oracle); | 286 HGraphBuilder builder(info, &oracle); |
| 287 HPhase phase(HPhase::kTotal); | 287 HPhase phase(HPhase::kTotal); |
| 288 HGraph* graph = builder.CreateGraph(info); | 288 HGraph* graph = builder.CreateGraph(); |
| 289 if (Top::has_pending_exception()) { | 289 if (Top::has_pending_exception()) { |
| 290 info->SetCode(Handle<Code>::null()); | 290 info->SetCode(Handle<Code>::null()); |
| 291 return false; | 291 return false; |
| 292 } | 292 } |
| 293 | 293 |
| 294 if (graph != NULL && FLAG_build_lithium) { | 294 if (graph != NULL && FLAG_build_lithium) { |
| 295 Handle<Code> optimized_code = graph->Compile(); | 295 Handle<Code> optimized_code = graph->Compile(info); |
| 296 if (!optimized_code.is_null()) { | 296 if (!optimized_code.is_null()) { |
| 297 info->SetCode(optimized_code); | 297 info->SetCode(optimized_code); |
| 298 FinishOptimization(info->closure(), start); | 298 FinishOptimization(info->closure(), start); |
| 299 return true; | 299 return true; |
| 300 } | 300 } |
| 301 } | 301 } |
| 302 | 302 |
| 303 // Compilation with the Hydrogen compiler failed. Keep using the | 303 // Compilation with the Hydrogen compiler failed. Keep using the |
| 304 // shared code but mark it as unoptimizable. | 304 // shared code but mark it as unoptimizable. |
| 305 AbortAndDisable(info); | 305 AbortAndDisable(info); |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 797 shared->DebugName())); | 797 shared->DebugName())); |
| 798 } | 798 } |
| 799 } | 799 } |
| 800 | 800 |
| 801 GDBJIT(AddCode(name, | 801 GDBJIT(AddCode(name, |
| 802 Handle<Script>(info->script()), | 802 Handle<Script>(info->script()), |
| 803 Handle<Code>(info->code()))); | 803 Handle<Code>(info->code()))); |
| 804 } | 804 } |
| 805 | 805 |
| 806 } } // namespace v8::internal | 806 } } // namespace v8::internal |
| OLD | NEW |