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 | 6 |
7 #include "src/arm64/macro-assembler-arm64.h" | 7 #include "src/arm64/macro-assembler-arm64.h" |
8 #include "src/compiler/code-generator-impl.h" | 8 #include "src/compiler/code-generator-impl.h" |
9 #include "src/compiler/gap-resolver.h" | 9 #include "src/compiler/gap-resolver.h" |
10 #include "src/compiler/node-matchers.h" | 10 #include "src/compiler/node-matchers.h" |
(...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1071 __ Mov(fp, csp); | 1071 __ Mov(fp, csp); |
1072 // TODO(dcarney): correct callee saved registers. | 1072 // TODO(dcarney): correct callee saved registers. |
1073 __ PushCalleeSavedRegisters(); | 1073 __ PushCalleeSavedRegisters(); |
1074 frame()->SetRegisterSaveAreaSize(20 * kPointerSize); | 1074 frame()->SetRegisterSaveAreaSize(20 * kPointerSize); |
1075 } else if (descriptor->IsJSFunctionCall()) { | 1075 } else if (descriptor->IsJSFunctionCall()) { |
1076 CompilationInfo* info = this->info(); | 1076 CompilationInfo* info = this->info(); |
1077 __ SetStackPointer(jssp); | 1077 __ SetStackPointer(jssp); |
1078 __ Prologue(info->IsCodePreAgingActive()); | 1078 __ Prologue(info->IsCodePreAgingActive()); |
1079 frame()->SetRegisterSaveAreaSize( | 1079 frame()->SetRegisterSaveAreaSize( |
1080 StandardFrameConstants::kFixedFrameSizeFromFp); | 1080 StandardFrameConstants::kFixedFrameSizeFromFp); |
1081 } else if (stack_slots > 0) { | 1081 } else if (needs_frame_) { |
1082 __ SetStackPointer(jssp); | 1082 __ SetStackPointer(jssp); |
1083 __ StubPrologue(); | 1083 __ StubPrologue(); |
1084 frame()->SetRegisterSaveAreaSize( | 1084 frame()->SetRegisterSaveAreaSize( |
1085 StandardFrameConstants::kFixedFrameSizeFromFp); | 1085 StandardFrameConstants::kFixedFrameSizeFromFp); |
1086 } | 1086 } |
1087 | 1087 |
1088 if (info()->is_osr()) { | 1088 if (info()->is_osr()) { |
1089 // TurboFan OSR-compiled functions cannot be entered directly. | 1089 // TurboFan OSR-compiled functions cannot be entered directly. |
1090 __ Abort(kShouldNotDirectlyEnterOsrFunction); | 1090 __ Abort(kShouldNotDirectlyEnterOsrFunction); |
1091 | 1091 |
(...skipping 28 matching lines...) Expand all Loading... |
1120 if (stack_slots > 0) { | 1120 if (stack_slots > 0) { |
1121 __ Add(csp, csp, AlignedStackSlots(stack_slots) * kPointerSize); | 1121 __ Add(csp, csp, AlignedStackSlots(stack_slots) * kPointerSize); |
1122 } | 1122 } |
1123 // Restore registers. | 1123 // Restore registers. |
1124 // TODO(dcarney): correct callee saved registers. | 1124 // TODO(dcarney): correct callee saved registers. |
1125 __ PopCalleeSavedRegisters(); | 1125 __ PopCalleeSavedRegisters(); |
1126 } | 1126 } |
1127 __ Mov(csp, fp); | 1127 __ Mov(csp, fp); |
1128 __ Pop(fp, lr); | 1128 __ Pop(fp, lr); |
1129 __ Ret(); | 1129 __ Ret(); |
1130 } else if (descriptor->IsJSFunctionCall() || stack_slots > 0) { | 1130 } else if (descriptor->IsJSFunctionCall() || needs_frame_) { |
1131 __ Mov(jssp, fp); | 1131 __ Mov(jssp, fp); |
1132 __ Pop(fp, lr); | 1132 __ Pop(fp, lr); |
1133 int pop_count = descriptor->IsJSFunctionCall() | 1133 int pop_count = descriptor->IsJSFunctionCall() |
1134 ? static_cast<int>(descriptor->JSParameterCount()) | 1134 ? static_cast<int>(descriptor->JSParameterCount()) |
1135 : 0; | 1135 : 0; |
1136 __ Drop(pop_count); | 1136 __ Drop(pop_count); |
1137 __ Ret(); | 1137 __ Ret(); |
1138 } else { | 1138 } else { |
1139 __ Ret(); | 1139 __ Ret(); |
1140 } | 1140 } |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1322 } | 1322 } |
1323 } | 1323 } |
1324 MarkLazyDeoptSite(); | 1324 MarkLazyDeoptSite(); |
1325 } | 1325 } |
1326 | 1326 |
1327 #undef __ | 1327 #undef __ |
1328 | 1328 |
1329 } // namespace compiler | 1329 } // namespace compiler |
1330 } // namespace internal | 1330 } // namespace internal |
1331 } // namespace v8 | 1331 } // namespace v8 |
OLD | NEW |