| 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 <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "src/compilation-info.h" | 9 #include "src/compilation-info.h" |
| 10 #include "src/compiler/code-generator-impl.h" | 10 #include "src/compiler/code-generator-impl.h" |
| (...skipping 2379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2390 void CodeGenerator::AssembleConstructFrame() { | 2390 void CodeGenerator::AssembleConstructFrame() { |
| 2391 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); | 2391 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
| 2392 if (frame_access_state()->has_frame()) { | 2392 if (frame_access_state()->has_frame()) { |
| 2393 int pc_base = __ pc_offset(); | 2393 int pc_base = __ pc_offset(); |
| 2394 | 2394 |
| 2395 if (descriptor->IsCFunctionCall()) { | 2395 if (descriptor->IsCFunctionCall()) { |
| 2396 __ pushq(rbp); | 2396 __ pushq(rbp); |
| 2397 __ movq(rbp, rsp); | 2397 __ movq(rbp, rsp); |
| 2398 } else if (descriptor->IsJSFunctionCall()) { | 2398 } else if (descriptor->IsJSFunctionCall()) { |
| 2399 __ Prologue(this->info()->GeneratePreagedPrologue()); | 2399 __ Prologue(this->info()->GeneratePreagedPrologue()); |
| 2400 if (descriptor->PushArgumentCount()) { |
| 2401 __ pushq(kJavaScriptCallArgCountRegister); |
| 2402 } |
| 2400 } else { | 2403 } else { |
| 2401 __ StubPrologue(info()->GetOutputStackFrameType()); | 2404 __ StubPrologue(info()->GetOutputStackFrameType()); |
| 2402 } | 2405 } |
| 2403 | 2406 |
| 2404 if (!descriptor->IsJSFunctionCall() || !info()->GeneratePreagedPrologue()) { | 2407 if (!descriptor->IsJSFunctionCall() || !info()->GeneratePreagedPrologue()) { |
| 2405 unwinding_info_writer_.MarkFrameConstructed(pc_base); | 2408 unwinding_info_writer_.MarkFrameConstructed(pc_base); |
| 2406 } | 2409 } |
| 2407 } | 2410 } |
| 2408 int shrink_slots = frame()->GetSpillSlotCount(); | 2411 int shrink_slots = |
| 2412 frame()->GetTotalFrameSlotCount() - descriptor->CalculateFixedFrameSize(); |
| 2409 | 2413 |
| 2410 if (info()->is_osr()) { | 2414 if (info()->is_osr()) { |
| 2411 // TurboFan OSR-compiled functions cannot be entered directly. | 2415 // TurboFan OSR-compiled functions cannot be entered directly. |
| 2412 __ Abort(kShouldNotDirectlyEnterOsrFunction); | 2416 __ Abort(kShouldNotDirectlyEnterOsrFunction); |
| 2413 | 2417 |
| 2414 // Unoptimized code jumps directly to this entrypoint while the unoptimized | 2418 // Unoptimized code jumps directly to this entrypoint while the unoptimized |
| 2415 // frame is still on the stack. Optimized code uses OSR values directly from | 2419 // frame is still on the stack. Optimized code uses OSR values directly from |
| 2416 // the unoptimized frame. Thus, all that needs to be done is to allocate the | 2420 // the unoptimized frame. Thus, all that needs to be done is to allocate the |
| 2417 // remaining stack slots. | 2421 // remaining stack slots. |
| 2418 if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --"); | 2422 if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --"); |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2773 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 2777 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
| 2774 __ Nop(padding_size); | 2778 __ Nop(padding_size); |
| 2775 } | 2779 } |
| 2776 } | 2780 } |
| 2777 | 2781 |
| 2778 #undef __ | 2782 #undef __ |
| 2779 | 2783 |
| 2780 } // namespace compiler | 2784 } // namespace compiler |
| 2781 } // namespace internal | 2785 } // namespace internal |
| 2782 } // namespace v8 | 2786 } // namespace v8 |
| OLD | NEW |