| 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 1466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1477 // | FP | RET | args | caller frame | | 1477 // | FP | RET | args | caller frame | |
| 1478 // ^ esp,ebp | 1478 // ^ esp,ebp |
| 1479 | 1479 |
| 1480 // --{ pop ebp }---------------------------------------------------------------- | 1480 // --{ pop ebp }---------------------------------------------------------------- |
| 1481 // | RET | args | caller frame | | 1481 // | RET | args | caller frame | |
| 1482 // ^ esp ^ ebp | 1482 // ^ esp ^ ebp |
| 1483 | 1483 |
| 1484 | 1484 |
| 1485 void CodeGenerator::AssemblePrologue() { | 1485 void CodeGenerator::AssemblePrologue() { |
| 1486 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); | 1486 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
| 1487 if (descriptor->IsCFunctionCall()) { | 1487 if (frame()->needs_frame()) { |
| 1488 // Assemble a prologue similar the to cdecl calling convention. | 1488 if (descriptor->IsCFunctionCall()) { |
| 1489 __ push(ebp); | 1489 __ push(ebp); |
| 1490 __ mov(ebp, esp); | 1490 __ mov(ebp, esp); |
| 1491 } else if (descriptor->IsJSFunctionCall()) { | 1491 } else if (descriptor->IsJSFunctionCall()) { |
| 1492 // TODO(turbofan): this prologue is redundant with OSR, but still needed for | 1492 __ Prologue(this->info()->GeneratePreagedPrologue()); |
| 1493 // code aging. | 1493 } else { |
| 1494 __ Prologue(this->info()->GeneratePreagedPrologue()); | 1494 __ StubPrologue(info()->GetOutputStackFrameType()); |
| 1495 } else if (frame()->needs_frame()) { | 1495 } |
| 1496 __ StubPrologue(); | |
| 1497 } else { | 1496 } else { |
| 1498 frame()->SetElidedFrameSizeInSlots(kPCOnStackSize / kPointerSize); | 1497 frame()->SetElidedFrameSizeInSlots(kPCOnStackSize / kPointerSize); |
| 1499 } | 1498 } |
| 1500 frame_access_state()->SetFrameAccessToDefault(); | 1499 frame_access_state()->SetFrameAccessToDefault(); |
| 1501 | 1500 |
| 1502 int stack_shrink_slots = frame()->GetSpillSlotCount(); | 1501 int stack_shrink_slots = frame()->GetSpillSlotCount(); |
| 1503 if (info()->is_osr()) { | 1502 if (info()->is_osr()) { |
| 1504 // TurboFan OSR-compiled functions cannot be entered directly. | 1503 // TurboFan OSR-compiled functions cannot be entered directly. |
| 1505 __ Abort(kShouldNotDirectlyEnterOsrFunction); | 1504 __ Abort(kShouldNotDirectlyEnterOsrFunction); |
| 1506 | 1505 |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1764 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 1763 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
| 1765 __ Nop(padding_size); | 1764 __ Nop(padding_size); |
| 1766 } | 1765 } |
| 1767 } | 1766 } |
| 1768 | 1767 |
| 1769 #undef __ | 1768 #undef __ |
| 1770 | 1769 |
| 1771 } // namespace compiler | 1770 } // namespace compiler |
| 1772 } // namespace internal | 1771 } // namespace internal |
| 1773 } // namespace v8 | 1772 } // namespace v8 |
| OLD | NEW |