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/mips/macro-assembler-mips.h" | 10 #include "src/mips/macro-assembler-mips.h" |
(...skipping 1136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1147 __ ld(a2, FieldMemOperand(a2, GlobalObject::kGlobalProxyOffset)); | 1147 __ ld(a2, FieldMemOperand(a2, GlobalObject::kGlobalProxyOffset)); |
1148 __ sd(a2, MemOperand(fp, receiver_slot * kPointerSize)); | 1148 __ sd(a2, MemOperand(fp, receiver_slot * kPointerSize)); |
1149 __ bind(&ok); | 1149 __ bind(&ok); |
1150 } | 1150 } |
1151 } else { | 1151 } else { |
1152 __ StubPrologue(); | 1152 __ StubPrologue(); |
1153 frame()->SetRegisterSaveAreaSize( | 1153 frame()->SetRegisterSaveAreaSize( |
1154 StandardFrameConstants::kFixedFrameSizeFromFp); | 1154 StandardFrameConstants::kFixedFrameSizeFromFp); |
1155 } | 1155 } |
1156 int stack_slots = frame()->GetSpillSlotCount(); | 1156 int stack_slots = frame()->GetSpillSlotCount(); |
| 1157 |
| 1158 if (info()->is_osr()) { |
| 1159 // TurboFan OSR-compiled functions cannot be entered directly. |
| 1160 // TODO(titzer): put an abort into the header of OSR functions on mips64. |
| 1161 |
| 1162 // Unoptimized code jumps directly to this entrypoint while the unoptimized |
| 1163 // frame is still on the stack. Optimized code uses OSR values directly from |
| 1164 // the unoptimized frame. Thus, all that needs to be done is to allocate the |
| 1165 // remaining stack slots. |
| 1166 if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --"); |
| 1167 osr_pc_offset_ = __ pc_offset(); |
| 1168 size_t unoptimized_slots = OsrHelper(info()).UnoptimizedFrameSlots(); |
| 1169 DCHECK(stack_slots >= static_cast<int>(unoptimized_slots)); |
| 1170 stack_slots -= unoptimized_slots; |
| 1171 } |
| 1172 |
1157 if (stack_slots > 0) { | 1173 if (stack_slots > 0) { |
1158 __ Dsubu(sp, sp, Operand(stack_slots * kPointerSize)); | 1174 __ Dsubu(sp, sp, Operand(stack_slots * kPointerSize)); |
1159 } | 1175 } |
1160 } | 1176 } |
1161 | 1177 |
1162 | 1178 |
1163 void CodeGenerator::AssembleReturn() { | 1179 void CodeGenerator::AssembleReturn() { |
1164 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); | 1180 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
1165 if (descriptor->kind() == CallDescriptor::kCallAddress) { | 1181 if (descriptor->kind() == CallDescriptor::kCallAddress) { |
1166 if (frame()->GetRegisterSaveAreaSize() > 0) { | 1182 if (frame()->GetRegisterSaveAreaSize() > 0) { |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1378 } | 1394 } |
1379 } | 1395 } |
1380 MarkLazyDeoptSite(); | 1396 MarkLazyDeoptSite(); |
1381 } | 1397 } |
1382 | 1398 |
1383 #undef __ | 1399 #undef __ |
1384 | 1400 |
1385 } // namespace compiler | 1401 } // namespace compiler |
1386 } // namespace internal | 1402 } // namespace internal |
1387 } // namespace v8 | 1403 } // namespace v8 |
OLD | NEW |