OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 2238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2249 | 2249 |
2250 void CodeGenerator::AssembleConstructFrame() { | 2250 void CodeGenerator::AssembleConstructFrame() { |
2251 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); | 2251 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
2252 | 2252 |
2253 if (frame_access_state()->has_frame()) { | 2253 if (frame_access_state()->has_frame()) { |
2254 if (descriptor->IsCFunctionCall()) { | 2254 if (descriptor->IsCFunctionCall()) { |
2255 __ Push(r14, fp); | 2255 __ Push(r14, fp); |
2256 __ LoadRR(fp, sp); | 2256 __ LoadRR(fp, sp); |
2257 } else if (descriptor->IsJSFunctionCall()) { | 2257 } else if (descriptor->IsJSFunctionCall()) { |
2258 __ Prologue(this->info()->GeneratePreagedPrologue(), ip); | 2258 __ Prologue(this->info()->GeneratePreagedPrologue(), ip); |
| 2259 if (descriptor->PushArgumentCount()) { |
| 2260 __ Push(kJavaScriptCallArgCountRegister); |
| 2261 } |
2259 } else { | 2262 } else { |
2260 StackFrame::Type type = info()->GetOutputStackFrameType(); | 2263 StackFrame::Type type = info()->GetOutputStackFrameType(); |
2261 // TODO(mbrandy): Detect cases where ip is the entrypoint (for | 2264 // TODO(mbrandy): Detect cases where ip is the entrypoint (for |
2262 // efficient intialization of the constant pool pointer register). | 2265 // efficient intialization of the constant pool pointer register). |
2263 __ StubPrologue(type); | 2266 __ StubPrologue(type); |
2264 } | 2267 } |
2265 } | 2268 } |
2266 | 2269 |
2267 int shrink_slots = frame()->GetSpillSlotCount(); | 2270 int shrink_slots = |
| 2271 frame()->GetTotalFrameSlotCount() - descriptor->CalculateFixedFrameSize(); |
2268 if (info()->is_osr()) { | 2272 if (info()->is_osr()) { |
2269 // TurboFan OSR-compiled functions cannot be entered directly. | 2273 // TurboFan OSR-compiled functions cannot be entered directly. |
2270 __ Abort(kShouldNotDirectlyEnterOsrFunction); | 2274 __ Abort(kShouldNotDirectlyEnterOsrFunction); |
2271 | 2275 |
2272 // Unoptimized code jumps directly to this entrypoint while the unoptimized | 2276 // Unoptimized code jumps directly to this entrypoint while the unoptimized |
2273 // frame is still on the stack. Optimized code uses OSR values directly from | 2277 // frame is still on the stack. Optimized code uses OSR values directly from |
2274 // the unoptimized frame. Thus, all that needs to be done is to allocate the | 2278 // the unoptimized frame. Thus, all that needs to be done is to allocate the |
2275 // remaining stack slots. | 2279 // remaining stack slots. |
2276 if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --"); | 2280 if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --"); |
2277 osr_pc_offset_ = __ pc_offset(); | 2281 osr_pc_offset_ = __ pc_offset(); |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2573 padding_size -= 2; | 2577 padding_size -= 2; |
2574 } | 2578 } |
2575 } | 2579 } |
2576 } | 2580 } |
2577 | 2581 |
2578 #undef __ | 2582 #undef __ |
2579 | 2583 |
2580 } // namespace compiler | 2584 } // namespace compiler |
2581 } // namespace internal | 2585 } // namespace internal |
2582 } // namespace v8 | 2586 } // namespace v8 |
OLD | NEW |