| 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 1927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1938 } | 1938 } |
| 1939 | 1939 |
| 1940 void CodeGenerator::AssembleConstructFrame() { | 1940 void CodeGenerator::AssembleConstructFrame() { |
| 1941 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); | 1941 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
| 1942 if (frame_access_state()->has_frame()) { | 1942 if (frame_access_state()->has_frame()) { |
| 1943 if (descriptor->IsCFunctionCall()) { | 1943 if (descriptor->IsCFunctionCall()) { |
| 1944 __ push(ebp); | 1944 __ push(ebp); |
| 1945 __ mov(ebp, esp); | 1945 __ mov(ebp, esp); |
| 1946 } else if (descriptor->IsJSFunctionCall()) { | 1946 } else if (descriptor->IsJSFunctionCall()) { |
| 1947 __ Prologue(this->info()->GeneratePreagedPrologue()); | 1947 __ Prologue(this->info()->GeneratePreagedPrologue()); |
| 1948 if (descriptor->PushArgumentCount()) { |
| 1949 __ push(kJavaScriptCallArgCountRegister); |
| 1950 } |
| 1948 } else { | 1951 } else { |
| 1949 __ StubPrologue(info()->GetOutputStackFrameType()); | 1952 __ StubPrologue(info()->GetOutputStackFrameType()); |
| 1950 } | 1953 } |
| 1951 } | 1954 } |
| 1952 | 1955 |
| 1953 int shrink_slots = frame()->GetSpillSlotCount(); | 1956 int shrink_slots = |
| 1957 frame()->GetTotalFrameSlotCount() - descriptor->CalculateFixedFrameSize(); |
| 1954 | 1958 |
| 1955 if (info()->is_osr()) { | 1959 if (info()->is_osr()) { |
| 1956 // TurboFan OSR-compiled functions cannot be entered directly. | 1960 // TurboFan OSR-compiled functions cannot be entered directly. |
| 1957 __ Abort(kShouldNotDirectlyEnterOsrFunction); | 1961 __ Abort(kShouldNotDirectlyEnterOsrFunction); |
| 1958 | 1962 |
| 1959 // Unoptimized code jumps directly to this entrypoint while the unoptimized | 1963 // Unoptimized code jumps directly to this entrypoint while the unoptimized |
| 1960 // frame is still on the stack. Optimized code uses OSR values directly from | 1964 // frame is still on the stack. Optimized code uses OSR values directly from |
| 1961 // the unoptimized frame. Thus, all that needs to be done is to allocate the | 1965 // the unoptimized frame. Thus, all that needs to be done is to allocate the |
| 1962 // remaining stack slots. | 1966 // remaining stack slots. |
| 1963 if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --"); | 1967 if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --"); |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2273 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 2277 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
| 2274 __ Nop(padding_size); | 2278 __ Nop(padding_size); |
| 2275 } | 2279 } |
| 2276 } | 2280 } |
| 2277 | 2281 |
| 2278 #undef __ | 2282 #undef __ |
| 2279 | 2283 |
| 2280 } // namespace compiler | 2284 } // namespace compiler |
| 2281 } // namespace internal | 2285 } // namespace internal |
| 2282 } // namespace v8 | 2286 } // namespace v8 |
| OLD | NEW |