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 1057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1068 register_save_area_size += kPointerSize; | 1068 register_save_area_size += kPointerSize; |
1069 } | 1069 } |
1070 frame()->SetRegisterSaveAreaSize(register_save_area_size); | 1070 frame()->SetRegisterSaveAreaSize(register_save_area_size); |
1071 __ MultiPush(saves); | 1071 __ MultiPush(saves); |
1072 } | 1072 } |
1073 } else if (descriptor->IsJSFunctionCall()) { | 1073 } else if (descriptor->IsJSFunctionCall()) { |
1074 CompilationInfo* info = this->info(); | 1074 CompilationInfo* info = this->info(); |
1075 __ Prologue(info->IsCodePreAgingActive()); | 1075 __ Prologue(info->IsCodePreAgingActive()); |
1076 frame()->SetRegisterSaveAreaSize( | 1076 frame()->SetRegisterSaveAreaSize( |
1077 StandardFrameConstants::kFixedFrameSizeFromFp); | 1077 StandardFrameConstants::kFixedFrameSizeFromFp); |
1078 } else if (stack_slots > 0) { | 1078 } else if (needs_frame_) { |
1079 __ StubPrologue(); | 1079 __ StubPrologue(); |
1080 frame()->SetRegisterSaveAreaSize( | 1080 frame()->SetRegisterSaveAreaSize( |
1081 StandardFrameConstants::kFixedFrameSizeFromFp); | 1081 StandardFrameConstants::kFixedFrameSizeFromFp); |
1082 } | 1082 } |
1083 | 1083 |
1084 if (info()->is_osr()) { | 1084 if (info()->is_osr()) { |
1085 // TurboFan OSR-compiled functions cannot be entered directly. | 1085 // TurboFan OSR-compiled functions cannot be entered directly. |
1086 __ Abort(kShouldNotDirectlyEnterOsrFunction); | 1086 __ Abort(kShouldNotDirectlyEnterOsrFunction); |
1087 | 1087 |
1088 // Unoptimized code jumps directly to this entrypoint while the unoptimized | 1088 // Unoptimized code jumps directly to this entrypoint while the unoptimized |
(...skipping 25 matching lines...) Expand all Loading... |
1114 } | 1114 } |
1115 // Restore registers. | 1115 // Restore registers. |
1116 const RegList saves = descriptor->CalleeSavedRegisters(); | 1116 const RegList saves = descriptor->CalleeSavedRegisters(); |
1117 if (saves != 0) { | 1117 if (saves != 0) { |
1118 __ MultiPop(saves); | 1118 __ MultiPop(saves); |
1119 } | 1119 } |
1120 } | 1120 } |
1121 __ mov(sp, fp); | 1121 __ mov(sp, fp); |
1122 __ Pop(ra, fp); | 1122 __ Pop(ra, fp); |
1123 __ Ret(); | 1123 __ Ret(); |
1124 } else if (descriptor->IsJSFunctionCall() || stack_slots > 0) { | 1124 } else if (descriptor->IsJSFunctionCall() || needs_frame_) { |
1125 __ mov(sp, fp); | 1125 __ mov(sp, fp); |
1126 __ Pop(ra, fp); | 1126 __ Pop(ra, fp); |
1127 int pop_count = descriptor->IsJSFunctionCall() | 1127 int pop_count = descriptor->IsJSFunctionCall() |
1128 ? static_cast<int>(descriptor->JSParameterCount()) | 1128 ? static_cast<int>(descriptor->JSParameterCount()) |
1129 : 0; | 1129 : 0; |
1130 __ DropAndRet(pop_count); | 1130 __ DropAndRet(pop_count); |
1131 } else { | 1131 } else { |
1132 __ Ret(); | 1132 __ Ret(); |
1133 } | 1133 } |
1134 } | 1134 } |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1339 } | 1339 } |
1340 } | 1340 } |
1341 MarkLazyDeoptSite(); | 1341 MarkLazyDeoptSite(); |
1342 } | 1342 } |
1343 | 1343 |
1344 #undef __ | 1344 #undef __ |
1345 | 1345 |
1346 } // namespace compiler | 1346 } // namespace compiler |
1347 } // namespace internal | 1347 } // namespace internal |
1348 } // namespace v8 | 1348 } // namespace v8 |
OLD | NEW |