| 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/compilation-info.h" | 7 #include "src/compilation-info.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 2386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2397 } | 2397 } |
| 2398 | 2398 |
| 2399 void CodeGenerator::AssembleConstructFrame() { | 2399 void CodeGenerator::AssembleConstructFrame() { |
| 2400 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); | 2400 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
| 2401 if (frame_access_state()->has_frame()) { | 2401 if (frame_access_state()->has_frame()) { |
| 2402 if (descriptor->IsCFunctionCall()) { | 2402 if (descriptor->IsCFunctionCall()) { |
| 2403 __ push(ebp); | 2403 __ push(ebp); |
| 2404 __ mov(ebp, esp); | 2404 __ mov(ebp, esp); |
| 2405 } else if (descriptor->IsJSFunctionCall()) { | 2405 } else if (descriptor->IsJSFunctionCall()) { |
| 2406 __ Prologue(this->info()->GeneratePreagedPrologue()); | 2406 __ Prologue(this->info()->GeneratePreagedPrologue()); |
| 2407 if (descriptor->PushArgumentCount()) { |
| 2408 __ push(kJavaScriptCallArgCountRegister); |
| 2409 } |
| 2407 } else { | 2410 } else { |
| 2408 __ StubPrologue(info()->GetOutputStackFrameType()); | 2411 __ StubPrologue(info()->GetOutputStackFrameType()); |
| 2409 } | 2412 } |
| 2410 } | 2413 } |
| 2411 | 2414 |
| 2412 int shrink_slots = frame()->GetSpillSlotCount(); | 2415 int shrink_slots = |
| 2416 frame()->GetTotalFrameSlotCount() - descriptor->CalculateFixedFrameSize(); |
| 2413 | 2417 |
| 2414 if (info()->is_osr()) { | 2418 if (info()->is_osr()) { |
| 2415 // TurboFan OSR-compiled functions cannot be entered directly. | 2419 // TurboFan OSR-compiled functions cannot be entered directly. |
| 2416 __ Abort(kShouldNotDirectlyEnterOsrFunction); | 2420 __ Abort(kShouldNotDirectlyEnterOsrFunction); |
| 2417 | 2421 |
| 2418 // Unoptimized code jumps directly to this entrypoint while the unoptimized | 2422 // Unoptimized code jumps directly to this entrypoint while the unoptimized |
| 2419 // frame is still on the stack. Optimized code uses OSR values directly from | 2423 // frame is still on the stack. Optimized code uses OSR values directly from |
| 2420 // the unoptimized frame. Thus, all that needs to be done is to allocate the | 2424 // the unoptimized frame. Thus, all that needs to be done is to allocate the |
| 2421 // remaining stack slots. | 2425 // remaining stack slots. |
| 2422 if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --"); | 2426 if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --"); |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2730 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 2734 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
| 2731 __ Nop(padding_size); | 2735 __ Nop(padding_size); |
| 2732 } | 2736 } |
| 2733 } | 2737 } |
| 2734 | 2738 |
| 2735 #undef __ | 2739 #undef __ |
| 2736 | 2740 |
| 2737 } // namespace compiler | 2741 } // namespace compiler |
| 2738 } // namespace internal | 2742 } // namespace internal |
| 2739 } // namespace v8 | 2743 } // namespace v8 |
| OLD | NEW |