| 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 // Restore registers. | 1134 // Restore registers. |
| 1135 const RegList saves = descriptor->CalleeSavedRegisters(); | 1135 const RegList saves = descriptor->CalleeSavedRegisters(); |
| 1136 if (saves != 0) { | 1136 if (saves != 0) { |
| 1137 __ MultiPop(saves); | 1137 __ MultiPop(saves); |
| 1138 } | 1138 } |
| 1139 } | 1139 } |
| 1140 __ mov(sp, fp); | 1140 __ mov(sp, fp); |
| 1141 __ Pop(ra, fp); | 1141 __ Pop(ra, fp); |
| 1142 __ Ret(); | 1142 __ Ret(); |
| 1143 } else if (descriptor->IsJSFunctionCall() || needs_frame_) { | 1143 } else if (descriptor->IsJSFunctionCall() || needs_frame_) { |
| 1144 __ mov(sp, fp); | 1144 // Canonicalize JSFunction return sites for now. |
| 1145 __ Pop(ra, fp); | 1145 if (return_label_.is_bound()) { |
| 1146 int pop_count = descriptor->IsJSFunctionCall() | 1146 __ Branch(&return_label_); |
| 1147 ? static_cast<int>(descriptor->JSParameterCount()) | 1147 } else { |
| 1148 : 0; | 1148 __ bind(&return_label_); |
| 1149 __ DropAndRet(pop_count); | 1149 __ mov(sp, fp); |
| 1150 __ Pop(ra, fp); |
| 1151 int pop_count = descriptor->IsJSFunctionCall() |
| 1152 ? static_cast<int>(descriptor->JSParameterCount()) |
| 1153 : 0; |
| 1154 __ DropAndRet(pop_count); |
| 1155 } |
| 1150 } else { | 1156 } else { |
| 1151 __ Ret(); | 1157 __ Ret(); |
| 1152 } | 1158 } |
| 1153 } | 1159 } |
| 1154 | 1160 |
| 1155 | 1161 |
| 1156 void CodeGenerator::AssembleMove(InstructionOperand* source, | 1162 void CodeGenerator::AssembleMove(InstructionOperand* source, |
| 1157 InstructionOperand* destination) { | 1163 InstructionOperand* destination) { |
| 1158 MipsOperandConverter g(this, NULL); | 1164 MipsOperandConverter g(this, NULL); |
| 1159 // Dispatch on the source and destination operand kinds. Not all | 1165 // Dispatch on the source and destination operand kinds. Not all |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1357 } | 1363 } |
| 1358 } | 1364 } |
| 1359 } | 1365 } |
| 1360 } | 1366 } |
| 1361 | 1367 |
| 1362 #undef __ | 1368 #undef __ |
| 1363 | 1369 |
| 1364 } // namespace compiler | 1370 } // namespace compiler |
| 1365 } // namespace internal | 1371 } // namespace internal |
| 1366 } // namespace v8 | 1372 } // namespace v8 |
| OLD | NEW |