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 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 LConstantOperand* operand) const { | 388 LConstantOperand* operand) const { |
389 return graph_->LookupValue(operand->index())->representation(); | 389 return graph_->LookupValue(operand->index())->representation(); |
390 } | 390 } |
391 | 391 |
392 | 392 |
393 LChunk* LChunk::NewChunk(HGraph* graph) { | 393 LChunk* LChunk::NewChunk(HGraph* graph) { |
394 NoHandleAllocation no_handles; | 394 NoHandleAllocation no_handles; |
395 AssertNoAllocation no_gc; | 395 AssertNoAllocation no_gc; |
396 | 396 |
397 int values = graph->GetMaximumValueID(); | 397 int values = graph->GetMaximumValueID(); |
| 398 CompilationInfo* info = graph->info(); |
398 if (values > LUnallocated::kMaxVirtualRegisters) { | 399 if (values > LUnallocated::kMaxVirtualRegisters) { |
399 if (FLAG_trace_bailout) { | 400 info->set_bailout_reason("not enough virtual registers for values"); |
400 PrintF("Not enough virtual registers for (values).\n"); | |
401 } | |
402 return NULL; | 401 return NULL; |
403 } | 402 } |
404 LAllocator allocator(values, graph); | 403 LAllocator allocator(values, graph); |
405 LChunkBuilder builder(graph->info(), graph, &allocator); | 404 LChunkBuilder builder(info, graph, &allocator); |
406 LChunk* chunk = builder.Build(); | 405 LChunk* chunk = builder.Build(); |
407 if (chunk == NULL) return NULL; | 406 if (chunk == NULL) return NULL; |
408 | 407 |
409 if (!allocator.Allocate(chunk)) { | 408 if (!allocator.Allocate(chunk)) { |
410 if (FLAG_trace_bailout) { | 409 info->set_bailout_reason("not enough virtual registers (regalloc)"); |
411 PrintF("Not enough virtual registers (regalloc).\n"); | |
412 } | |
413 return NULL; | 410 return NULL; |
414 } | 411 } |
415 | 412 |
416 return chunk; | 413 return chunk; |
417 } | 414 } |
418 | 415 |
419 | 416 |
420 Handle<Code> LChunk::Codegen() { | 417 Handle<Code> LChunk::Codegen() { |
421 MacroAssembler assembler(info()->isolate(), NULL, 0); | 418 MacroAssembler assembler(info()->isolate(), NULL, 0); |
422 LCodeGen generator(this, &assembler, info()); | 419 LCodeGen generator(this, &assembler, info()); |
(...skipping 10 matching lines...) Expand all Loading... |
433 CodeGenerator::MakeCodeEpilogue(&assembler, flags, info()); | 430 CodeGenerator::MakeCodeEpilogue(&assembler, flags, info()); |
434 generator.FinishCode(code); | 431 generator.FinishCode(code); |
435 CodeGenerator::PrintCode(code, info()); | 432 CodeGenerator::PrintCode(code, info()); |
436 return code; | 433 return code; |
437 } | 434 } |
438 return Handle<Code>::null(); | 435 return Handle<Code>::null(); |
439 } | 436 } |
440 | 437 |
441 | 438 |
442 } } // namespace v8::internal | 439 } } // namespace v8::internal |
OLD | NEW |