| 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 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 872 CompilationInfo* info = this->info(); | 873 CompilationInfo* info = this->info(); |
| 873 __ Prologue(info->IsCodePreAgingActive()); | 874 __ Prologue(info->IsCodePreAgingActive()); |
| 874 frame()->SetRegisterSaveAreaSize( | 875 frame()->SetRegisterSaveAreaSize( |
| 875 StandardFrameConstants::kFixedFrameSizeFromFp); | 876 StandardFrameConstants::kFixedFrameSizeFromFp); |
| 876 } else { | 877 } else { |
| 877 __ StubPrologue(); | 878 __ StubPrologue(); |
| 878 frame()->SetRegisterSaveAreaSize( | 879 frame()->SetRegisterSaveAreaSize( |
| 879 StandardFrameConstants::kFixedFrameSizeFromFp); | 880 StandardFrameConstants::kFixedFrameSizeFromFp); |
| 880 } | 881 } |
| 881 int stack_slots = frame()->GetSpillSlotCount(); | 882 int stack_slots = frame()->GetSpillSlotCount(); |
| 883 |
| 884 if (info()->is_osr()) { |
| 885 // TurboFan OSR-compiled functions cannot be entered directly. |
| 886 // TODO(titzer): put an abort into the header of OSR functions on mips. |
| 887 |
| 888 // Unoptimized code jumps directly to this entrypoint while the unoptimized |
| 889 // frame is still on the stack. Optimized code uses OSR values directly from |
| 890 // the unoptimized frame. Thus, all that needs to be done is to allocate the |
| 891 // remaining stack slots. |
| 892 if (FLAG_code_comments) __ RecordComment("-- OSR entrypoint --"); |
| 893 osr_pc_offset_ = __ pc_offset(); |
| 894 size_t unoptimized_slots = OsrHelper(info()).UnoptimizedFrameSlots(); |
| 895 DCHECK(stack_slots >= static_cast<int>(unoptimized_slots)); |
| 896 stack_slots -= unoptimized_slots; |
| 897 } |
| 898 |
| 882 if (stack_slots > 0) { | 899 if (stack_slots > 0) { |
| 883 __ Subu(sp, sp, Operand(stack_slots * kPointerSize)); | 900 __ Subu(sp, sp, Operand(stack_slots * kPointerSize)); |
| 884 } | 901 } |
| 885 } | 902 } |
| 886 | 903 |
| 887 | 904 |
| 888 void CodeGenerator::AssembleReturn() { | 905 void CodeGenerator::AssembleReturn() { |
| 889 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); | 906 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
| 890 if (descriptor->kind() == CallDescriptor::kCallAddress) { | 907 if (descriptor->kind() == CallDescriptor::kCallAddress) { |
| 891 if (frame()->GetRegisterSaveAreaSize() > 0) { | 908 if (frame()->GetRegisterSaveAreaSize() > 0) { |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1103 } | 1120 } |
| 1104 } | 1121 } |
| 1105 MarkLazyDeoptSite(); | 1122 MarkLazyDeoptSite(); |
| 1106 } | 1123 } |
| 1107 | 1124 |
| 1108 #undef __ | 1125 #undef __ |
| 1109 | 1126 |
| 1110 } // namespace compiler | 1127 } // namespace compiler |
| 1111 } // namespace internal | 1128 } // namespace internal |
| 1112 } // namespace v8 | 1129 } // namespace v8 |
| OLD | NEW |