| 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 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 OptimizingCompiler::Status OptimizingCompiler::CreateGraph() { | 306 OptimizingCompiler::Status OptimizingCompiler::CreateGraph() { |
| 307 ASSERT(V8::UseCrankshaft()); | 307 ASSERT(V8::UseCrankshaft()); |
| 308 ASSERT(info()->IsOptimizing()); | 308 ASSERT(info()->IsOptimizing()); |
| 309 ASSERT(!info()->IsCompilingForDebugging()); | 309 ASSERT(!info()->IsCompilingForDebugging()); |
| 310 | 310 |
| 311 // We should never arrive here if there is no code object on the | 311 // We should never arrive here if there is no code object on the |
| 312 // shared function object. | 312 // shared function object. |
| 313 Handle<Code> code(info()->shared_info()->code()); | 313 Handle<Code> code(info()->shared_info()->code()); |
| 314 ASSERT(code->kind() == Code::FUNCTION); | 314 ASSERT(code->kind() == Code::FUNCTION); |
| 315 | 315 |
| 316 if (FLAG_trace_opt) { |
| 317 // TODO(jbramley): This was added to help analyse the behaviour of |
| 318 // Crankshaft for the A64 Crankshaft port. It should eventually be deleted. |
| 319 Handle<JSFunction> function = info()->closure(); |
| 320 PrintF("Attempting optimization of "); |
| 321 function->PrintName(); |
| 322 PrintF(" / %" V8PRIxPTR "\n", reinterpret_cast<intptr_t>(*function)); |
| 323 } |
| 324 |
| 316 // We should never arrive here if optimization has been disabled on the | 325 // We should never arrive here if optimization has been disabled on the |
| 317 // shared function info. | 326 // shared function info. |
| 318 ASSERT(!info()->shared_info()->optimization_disabled()); | 327 ASSERT(!info()->shared_info()->optimization_disabled()); |
| 319 | 328 |
| 320 // Fall back to using the full code generator if it's not possible | 329 // Fall back to using the full code generator if it's not possible |
| 321 // to use the Hydrogen-based optimizing compiler. We already have | 330 // to use the Hydrogen-based optimizing compiler. We already have |
| 322 // generated code for this from the shared function object. | 331 // generated code for this from the shared function object. |
| 323 if (AlwaysFullCompiler(isolate())) { | 332 if (AlwaysFullCompiler(isolate())) { |
| 324 info()->SetCode(code); | 333 info()->SetCode(code); |
| 325 return SetLastStatus(BAILED_OUT); | 334 return SetLastStatus(BAILED_OUT); |
| (...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1210 } | 1219 } |
| 1211 } | 1220 } |
| 1212 | 1221 |
| 1213 GDBJIT(AddCode(Handle<String>(shared->DebugName()), | 1222 GDBJIT(AddCode(Handle<String>(shared->DebugName()), |
| 1214 Handle<Script>(info->script()), | 1223 Handle<Script>(info->script()), |
| 1215 Handle<Code>(info->code()), | 1224 Handle<Code>(info->code()), |
| 1216 info)); | 1225 info)); |
| 1217 } | 1226 } |
| 1218 | 1227 |
| 1219 } } // namespace v8::internal | 1228 } } // namespace v8::internal |
| OLD | NEW |