| 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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 // support. | 278 // support. |
| 279 ASSERT(FLAG_always_opt || code->optimizable()); | 279 ASSERT(FLAG_always_opt || code->optimizable()); |
| 280 ASSERT(info->shared_info()->has_deoptimization_support()); | 280 ASSERT(info->shared_info()->has_deoptimization_support()); |
| 281 | 281 |
| 282 if (FLAG_trace_hydrogen) { | 282 if (FLAG_trace_hydrogen) { |
| 283 PrintF("-----------------------------------------------------------\n"); | 283 PrintF("-----------------------------------------------------------\n"); |
| 284 PrintF("Compiling method %s using hydrogen\n", *name->ToCString()); | 284 PrintF("Compiling method %s using hydrogen\n", *name->ToCString()); |
| 285 HTracer::Instance()->TraceCompilation(info->function()); | 285 HTracer::Instance()->TraceCompilation(info->function()); |
| 286 } | 286 } |
| 287 | 287 |
| 288 TypeFeedbackOracle oracle( | 288 Handle<Context> global_context(info->closure()->context()->global_context()); |
| 289 code, Handle<Context>(info->closure()->context()->global_context())); | 289 TypeFeedbackOracle oracle(code, global_context); |
| 290 HGraphBuilder builder(&oracle); | 290 HGraphBuilder builder(info, &oracle); |
| 291 HPhase phase(HPhase::kTotal); | 291 HPhase phase(HPhase::kTotal); |
| 292 HGraph* graph = builder.CreateGraph(info); | 292 HGraph* graph = builder.CreateGraph(); |
| 293 if (info->isolate()->has_pending_exception()) { | 293 if (info->isolate()->has_pending_exception()) { |
| 294 info->SetCode(Handle<Code>::null()); | 294 info->SetCode(Handle<Code>::null()); |
| 295 return false; | 295 return false; |
| 296 } | 296 } |
| 297 | 297 |
| 298 if (graph != NULL && FLAG_build_lithium) { | 298 if (graph != NULL && FLAG_build_lithium) { |
| 299 Handle<Code> optimized_code = graph->Compile(); | 299 Handle<Code> optimized_code = graph->Compile(info); |
| 300 if (!optimized_code.is_null()) { | 300 if (!optimized_code.is_null()) { |
| 301 info->SetCode(optimized_code); | 301 info->SetCode(optimized_code); |
| 302 FinishOptimization(info->closure(), start); | 302 FinishOptimization(info->closure(), start); |
| 303 return true; | 303 return true; |
| 304 } | 304 } |
| 305 } | 305 } |
| 306 | 306 |
| 307 // Compilation with the Hydrogen compiler failed. Keep using the | 307 // Compilation with the Hydrogen compiler failed. Keep using the |
| 308 // shared code but mark it as unoptimizable. | 308 // shared code but mark it as unoptimizable. |
| 309 AbortAndDisable(info); | 309 AbortAndDisable(info); |
| (...skipping 505 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 |