| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/compiler/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
| 6 | 6 |
| 7 #include "src/compiler/code-generator-impl.h" | 7 #include "src/compiler/code-generator-impl.h" |
| 8 #include "src/compiler/linkage.h" | 8 #include "src/compiler/linkage.h" |
| 9 #include "src/compiler/pipeline.h" | 9 #include "src/compiler/pipeline.h" |
| 10 | 10 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 // Assemble all out-of-line code. | 78 // Assemble all out-of-line code. |
| 79 if (ools_) { | 79 if (ools_) { |
| 80 masm()->RecordComment("-- Out of line code --"); | 80 masm()->RecordComment("-- Out of line code --"); |
| 81 for (OutOfLineCode* ool = ools_; ool; ool = ool->next()) { | 81 for (OutOfLineCode* ool = ools_; ool; ool = ool->next()) { |
| 82 masm()->bind(ool->entry()); | 82 masm()->bind(ool->entry()); |
| 83 ool->Generate(); | 83 ool->Generate(); |
| 84 masm()->jmp(ool->exit()); | 84 masm()->jmp(ool->exit()); |
| 85 } | 85 } |
| 86 } | 86 } |
| 87 | 87 |
| 88 FinishCode(masm()); | |
| 89 | |
| 90 // Ensure there is space for lazy deoptimization in the code. | 88 // Ensure there is space for lazy deoptimization in the code. |
| 91 if (!info->IsStub()) { | 89 if (!info->IsStub()) { |
| 92 int target_offset = masm()->pc_offset() + Deoptimizer::patch_size(); | 90 int target_offset = masm()->pc_offset() + Deoptimizer::patch_size(); |
| 93 while (masm()->pc_offset() < target_offset) { | 91 while (masm()->pc_offset() < target_offset) { |
| 94 masm()->nop(); | 92 masm()->nop(); |
| 95 } | 93 } |
| 96 } | 94 } |
| 97 | 95 |
| 96 FinishCode(masm()); |
| 97 |
| 98 safepoints()->Emit(masm(), frame()->GetSpillSlotCount()); | 98 safepoints()->Emit(masm(), frame()->GetSpillSlotCount()); |
| 99 | 99 |
| 100 // TODO(titzer): what are the right code flags here? | 100 // TODO(titzer): what are the right code flags here? |
| 101 Code::Kind kind = Code::STUB; | 101 Code::Kind kind = Code::STUB; |
| 102 if (linkage()->GetIncomingDescriptor()->IsJSFunctionCall()) { | 102 if (linkage()->GetIncomingDescriptor()->IsJSFunctionCall()) { |
| 103 kind = Code::OPTIMIZED_FUNCTION; | 103 kind = Code::OPTIMIZED_FUNCTION; |
| 104 } | 104 } |
| 105 Handle<Code> result = v8::internal::CodeGenerator::MakeCodeEpilogue( | 105 Handle<Code> result = v8::internal::CodeGenerator::MakeCodeEpilogue( |
| 106 masm(), Code::ComputeFlags(kind), info); | 106 masm(), Code::ComputeFlags(kind), info); |
| 107 result->set_is_turbofanned(true); | 107 result->set_is_turbofanned(true); |
| (...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 : masm_(gen->masm()), next_(gen->ools_) { | 584 : masm_(gen->masm()), next_(gen->ools_) { |
| 585 gen->ools_ = this; | 585 gen->ools_ = this; |
| 586 } | 586 } |
| 587 | 587 |
| 588 | 588 |
| 589 OutOfLineCode::~OutOfLineCode() {} | 589 OutOfLineCode::~OutOfLineCode() {} |
| 590 | 590 |
| 591 } // namespace compiler | 591 } // namespace compiler |
| 592 } // namespace internal | 592 } // namespace internal |
| 593 } // namespace v8 | 593 } // namespace v8 |
| OLD | NEW |