| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #include "src/compiler/code-generator-impl.h" | 6 #include "src/compiler/code-generator-impl.h" |
| 7 #include "src/compiler/gap-resolver.h" | 7 #include "src/compiler/gap-resolver.h" |
| 8 #include "src/compiler/node-matchers.h" | 8 #include "src/compiler/node-matchers.h" |
| 9 #include "src/compiler/node-properties-inl.h" | 9 #include "src/compiler/node-properties-inl.h" |
| 10 #include "src/compiler/osr.h" |
| 10 #include "src/mips/macro-assembler-mips.h" | 11 #include "src/mips/macro-assembler-mips.h" |
| 11 #include "src/scopes.h" | 12 #include "src/scopes.h" |
| 12 | 13 |
| 13 namespace v8 { | 14 namespace v8 { |
| 14 namespace internal { | 15 namespace internal { |
| 15 namespace compiler { | 16 namespace compiler { |
| 16 | 17 |
| 17 #define __ masm()-> | 18 #define __ masm()-> |
| 18 | 19 |
| 19 | 20 |
| (...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 945 CompilationInfo* info = this->info(); | 946 CompilationInfo* info = this->info(); |
| 946 __ Prologue(info->IsCodePreAgingActive()); | 947 __ Prologue(info->IsCodePreAgingActive()); |
| 947 frame()->SetRegisterSaveAreaSize( | 948 frame()->SetRegisterSaveAreaSize( |
| 948 StandardFrameConstants::kFixedFrameSizeFromFp); | 949 StandardFrameConstants::kFixedFrameSizeFromFp); |
| 949 } else { | 950 } else { |
| 950 __ StubPrologue(); | 951 __ StubPrologue(); |
| 951 frame()->SetRegisterSaveAreaSize( | 952 frame()->SetRegisterSaveAreaSize( |
| 952 StandardFrameConstants::kFixedFrameSizeFromFp); | 953 StandardFrameConstants::kFixedFrameSizeFromFp); |
| 953 } | 954 } |
| 954 int stack_slots = frame()->GetSpillSlotCount(); | 955 int stack_slots = frame()->GetSpillSlotCount(); |
| 956 |
| 957 if (info()->is_osr()) { |
| 958 // TurboFan OSR-compiled functions cannot be entered directly. |
| 959 __ Abort(kShouldNotDirectlyEnterOsrFunction); |
| 960 |
| 961 // Unoptimized code jumps directly to this entrypoint while the unoptimized |
| 962 // frame is still on the stack. Optimized code uses OSR values directly from |
| 963 // the unoptimized frame. Thus, all that needs to be done is to allocate the |
| 964 // remaining stack slots. |
| 965 if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --"); |
| 966 osr_pc_offset_ = __ pc_offset(); |
| 967 int unoptimized_slots = |
| 968 static_cast<int>(OsrHelper(info()).UnoptimizedFrameSlots()); |
| 969 DCHECK(stack_slots >= unoptimized_slots); |
| 970 stack_slots -= unoptimized_slots; |
| 971 } |
| 972 |
| 955 if (stack_slots > 0) { | 973 if (stack_slots > 0) { |
| 956 __ Subu(sp, sp, Operand(stack_slots * kPointerSize)); | 974 __ Subu(sp, sp, Operand(stack_slots * kPointerSize)); |
| 957 } | 975 } |
| 958 } | 976 } |
| 959 | 977 |
| 960 | 978 |
| 961 void CodeGenerator::AssembleReturn() { | 979 void CodeGenerator::AssembleReturn() { |
| 962 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); | 980 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
| 963 if (descriptor->kind() == CallDescriptor::kCallAddress) { | 981 if (descriptor->kind() == CallDescriptor::kCallAddress) { |
| 964 if (frame()->GetRegisterSaveAreaSize() > 0) { | 982 if (frame()->GetRegisterSaveAreaSize() > 0) { |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1176 } | 1194 } |
| 1177 } | 1195 } |
| 1178 MarkLazyDeoptSite(); | 1196 MarkLazyDeoptSite(); |
| 1179 } | 1197 } |
| 1180 | 1198 |
| 1181 #undef __ | 1199 #undef __ |
| 1182 | 1200 |
| 1183 } // namespace compiler | 1201 } // namespace compiler |
| 1184 } // namespace internal | 1202 } // namespace internal |
| 1185 } // namespace v8 | 1203 } // namespace v8 |
| OLD | NEW |