| 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 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1204 __ ld(a2, FieldMemOperand(a2, GlobalObject::kGlobalProxyOffset)); | 1204 __ ld(a2, FieldMemOperand(a2, GlobalObject::kGlobalProxyOffset)); |
| 1205 __ sd(a2, MemOperand(fp, receiver_slot * kPointerSize)); | 1205 __ sd(a2, MemOperand(fp, receiver_slot * kPointerSize)); |
| 1206 __ bind(&ok); | 1206 __ bind(&ok); |
| 1207 } | 1207 } |
| 1208 } else { | 1208 } else { |
| 1209 __ StubPrologue(); | 1209 __ StubPrologue(); |
| 1210 frame()->SetRegisterSaveAreaSize( | 1210 frame()->SetRegisterSaveAreaSize( |
| 1211 StandardFrameConstants::kFixedFrameSizeFromFp); | 1211 StandardFrameConstants::kFixedFrameSizeFromFp); |
| 1212 } | 1212 } |
| 1213 int stack_slots = frame()->GetSpillSlotCount(); | 1213 int stack_slots = frame()->GetSpillSlotCount(); |
| 1214 |
| 1215 if (info()->is_osr()) { |
| 1216 // TurboFan OSR-compiled functions cannot be entered directly. |
| 1217 __ Abort(kShouldNotDirectlyEnterOsrFunction); |
| 1218 |
| 1219 // Unoptimized code jumps directly to this entrypoint while the unoptimized |
| 1220 // frame is still on the stack. Optimized code uses OSR values directly from |
| 1221 // the unoptimized frame. Thus, all that needs to be done is to allocate the |
| 1222 // remaining stack slots. |
| 1223 if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --"); |
| 1224 osr_pc_offset_ = __ pc_offset(); |
| 1225 int unoptimized_slots = |
| 1226 static_cast<int>(OsrHelper(info()).UnoptimizedFrameSlots()); |
| 1227 DCHECK(stack_slots >= unoptimized_slots); |
| 1228 stack_slots -= unoptimized_slots; |
| 1229 } |
| 1230 |
| 1214 if (stack_slots > 0) { | 1231 if (stack_slots > 0) { |
| 1215 __ Dsubu(sp, sp, Operand(stack_slots * kPointerSize)); | 1232 __ Dsubu(sp, sp, Operand(stack_slots * kPointerSize)); |
| 1216 } | 1233 } |
| 1217 } | 1234 } |
| 1218 | 1235 |
| 1219 | 1236 |
| 1220 void CodeGenerator::AssembleReturn() { | 1237 void CodeGenerator::AssembleReturn() { |
| 1221 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); | 1238 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
| 1222 if (descriptor->kind() == CallDescriptor::kCallAddress) { | 1239 if (descriptor->kind() == CallDescriptor::kCallAddress) { |
| 1223 if (frame()->GetRegisterSaveAreaSize() > 0) { | 1240 if (frame()->GetRegisterSaveAreaSize() > 0) { |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1435 } | 1452 } |
| 1436 } | 1453 } |
| 1437 MarkLazyDeoptSite(); | 1454 MarkLazyDeoptSite(); |
| 1438 } | 1455 } |
| 1439 | 1456 |
| 1440 #undef __ | 1457 #undef __ |
| 1441 | 1458 |
| 1442 } // namespace compiler | 1459 } // namespace compiler |
| 1443 } // namespace internal | 1460 } // namespace internal |
| 1444 } // namespace v8 | 1461 } // namespace v8 |
| OLD | NEW |