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/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/compiler/code-generator-impl.h" | 8 #include "src/compiler/code-generator-impl.h" |
9 #include "src/compiler/gap-resolver.h" | 9 #include "src/compiler/gap-resolver.h" |
10 #include "src/compiler/node-matchers.h" | 10 #include "src/compiler/node-matchers.h" |
(...skipping 1402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1413 // ^ esp ^ ebp | 1413 // ^ esp ^ ebp |
1414 | 1414 |
1415 | 1415 |
1416 void CodeGenerator::AssemblePrologue() { | 1416 void CodeGenerator::AssemblePrologue() { |
1417 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); | 1417 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
1418 if (descriptor->IsCFunctionCall()) { | 1418 if (descriptor->IsCFunctionCall()) { |
1419 // Assemble a prologue similar the to cdecl calling convention. | 1419 // Assemble a prologue similar the to cdecl calling convention. |
1420 __ push(ebp); | 1420 __ push(ebp); |
1421 __ mov(ebp, esp); | 1421 __ mov(ebp, esp); |
1422 } else if (descriptor->IsJSFunctionCall()) { | 1422 } else if (descriptor->IsJSFunctionCall()) { |
1423 // TODO(turbofan): this prologue is redundant with OSR, but needed for | 1423 // TODO(turbofan): this prologue is redundant with OSR, but still needed for |
1424 // code aging. | 1424 // code aging. |
1425 CompilationInfo* info = this->info(); | 1425 __ Prologue(this->info()->GeneratePreagedPrologue()); |
1426 __ Prologue(info->IsCodePreAgingActive()); | |
1427 } else if (frame()->needs_frame()) { | 1426 } else if (frame()->needs_frame()) { |
1428 __ StubPrologue(); | 1427 __ StubPrologue(); |
1429 } else { | 1428 } else { |
1430 frame()->SetElidedFrameSizeInSlots(kPCOnStackSize / kPointerSize); | 1429 frame()->SetElidedFrameSizeInSlots(kPCOnStackSize / kPointerSize); |
1431 } | 1430 } |
1432 frame_access_state()->SetFrameAccessToDefault(); | 1431 frame_access_state()->SetFrameAccessToDefault(); |
1433 | 1432 |
1434 int stack_shrink_slots = frame()->GetSpillSlotCount(); | 1433 int stack_shrink_slots = frame()->GetSpillSlotCount(); |
1435 if (info()->is_osr()) { | 1434 if (info()->is_osr()) { |
1436 // TurboFan OSR-compiled functions cannot be entered directly. | 1435 // TurboFan OSR-compiled functions cannot be entered directly. |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1689 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 1688 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
1690 __ Nop(padding_size); | 1689 __ Nop(padding_size); |
1691 } | 1690 } |
1692 } | 1691 } |
1693 | 1692 |
1694 #undef __ | 1693 #undef __ |
1695 | 1694 |
1696 } // namespace compiler | 1695 } // namespace compiler |
1697 } // namespace internal | 1696 } // namespace internal |
1698 } // namespace v8 | 1697 } // namespace v8 |
OLD | NEW |