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/mips/macro-assembler-mips.h" | 9 #include "src/mips/macro-assembler-mips.h" |
10 #include "src/scopes.h" | 10 #include "src/scopes.h" |
(...skipping 1123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1134 register_save_area_size += kPointerSize; | 1134 register_save_area_size += kPointerSize; |
1135 } | 1135 } |
1136 frame()->SetRegisterSaveAreaSize(register_save_area_size); | 1136 frame()->SetRegisterSaveAreaSize(register_save_area_size); |
1137 __ MultiPush(saves); | 1137 __ MultiPush(saves); |
1138 } | 1138 } |
1139 } else if (descriptor->IsJSFunctionCall()) { | 1139 } else if (descriptor->IsJSFunctionCall()) { |
1140 CompilationInfo* info = this->info(); | 1140 CompilationInfo* info = this->info(); |
1141 __ Prologue(info->IsCodePreAgingActive()); | 1141 __ Prologue(info->IsCodePreAgingActive()); |
1142 frame()->SetRegisterSaveAreaSize( | 1142 frame()->SetRegisterSaveAreaSize( |
1143 StandardFrameConstants::kFixedFrameSizeFromFp); | 1143 StandardFrameConstants::kFixedFrameSizeFromFp); |
1144 } else if (stack_slots > 0) { | 1144 } else if (needs_frame_) { |
1145 __ StubPrologue(); | 1145 __ StubPrologue(); |
1146 frame()->SetRegisterSaveAreaSize( | 1146 frame()->SetRegisterSaveAreaSize( |
1147 StandardFrameConstants::kFixedFrameSizeFromFp); | 1147 StandardFrameConstants::kFixedFrameSizeFromFp); |
1148 } | 1148 } |
1149 | 1149 |
1150 if (info()->is_osr()) { | 1150 if (info()->is_osr()) { |
1151 // TurboFan OSR-compiled functions cannot be entered directly. | 1151 // TurboFan OSR-compiled functions cannot be entered directly. |
1152 __ Abort(kShouldNotDirectlyEnterOsrFunction); | 1152 __ Abort(kShouldNotDirectlyEnterOsrFunction); |
1153 | 1153 |
1154 // Unoptimized code jumps directly to this entrypoint while the unoptimized | 1154 // Unoptimized code jumps directly to this entrypoint while the unoptimized |
(...skipping 25 matching lines...) Expand all Loading... |
1180 } | 1180 } |
1181 // Restore registers. | 1181 // Restore registers. |
1182 const RegList saves = descriptor->CalleeSavedRegisters(); | 1182 const RegList saves = descriptor->CalleeSavedRegisters(); |
1183 if (saves != 0) { | 1183 if (saves != 0) { |
1184 __ MultiPop(saves); | 1184 __ MultiPop(saves); |
1185 } | 1185 } |
1186 } | 1186 } |
1187 __ mov(sp, fp); | 1187 __ mov(sp, fp); |
1188 __ Pop(ra, fp); | 1188 __ Pop(ra, fp); |
1189 __ Ret(); | 1189 __ Ret(); |
1190 } else if (descriptor->IsJSFunctionCall() || stack_slots > 0) { | 1190 } else if (descriptor->IsJSFunctionCall() || needs_frame_) { |
1191 __ mov(sp, fp); | 1191 __ mov(sp, fp); |
1192 __ Pop(ra, fp); | 1192 __ Pop(ra, fp); |
1193 int pop_count = descriptor->IsJSFunctionCall() | 1193 int pop_count = descriptor->IsJSFunctionCall() |
1194 ? static_cast<int>(descriptor->JSParameterCount()) | 1194 ? static_cast<int>(descriptor->JSParameterCount()) |
1195 : 0; | 1195 : 0; |
1196 __ DropAndRet(pop_count); | 1196 __ DropAndRet(pop_count); |
1197 } else { | 1197 } else { |
1198 __ Ret(); | 1198 __ Ret(); |
1199 } | 1199 } |
1200 } | 1200 } |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1405 } | 1405 } |
1406 } | 1406 } |
1407 MarkLazyDeoptSite(); | 1407 MarkLazyDeoptSite(); |
1408 } | 1408 } |
1409 | 1409 |
1410 #undef __ | 1410 #undef __ |
1411 | 1411 |
1412 } // namespace compiler | 1412 } // namespace compiler |
1413 } // namespace internal | 1413 } // namespace internal |
1414 } // namespace v8 | 1414 } // namespace v8 |
OLD | NEW |