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/arm/macro-assembler-arm.h" | 7 #include "src/arm/macro-assembler-arm.h" |
8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
9 #include "src/compiler/code-generator-impl.h" | 9 #include "src/compiler/code-generator-impl.h" |
10 #include "src/compiler/gap-resolver.h" | 10 #include "src/compiler/gap-resolver.h" |
(...skipping 1157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1168 // TODO(turbofan): We should be able to generate better code by sharing the | 1168 // TODO(turbofan): We should be able to generate better code by sharing the |
1169 // actual final call site and just bl'ing to it here, similar to what we do | 1169 // actual final call site and just bl'ing to it here, similar to what we do |
1170 // in the lithium backend. | 1170 // in the lithium backend. |
1171 __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY); | 1171 __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY); |
1172 __ CheckConstPool(false, false); | 1172 __ CheckConstPool(false, false); |
1173 } | 1173 } |
1174 | 1174 |
1175 | 1175 |
1176 void CodeGenerator::AssemblePrologue() { | 1176 void CodeGenerator::AssemblePrologue() { |
1177 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); | 1177 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
1178 if (descriptor->IsCFunctionCall()) { | 1178 if (frame()->needs_frame()) { |
1179 if (FLAG_enable_embedded_constant_pool) { | 1179 if (descriptor->IsCFunctionCall()) { |
1180 __ Push(lr, fp, pp); | 1180 if (FLAG_enable_embedded_constant_pool) { |
1181 // Adjust FP to point to saved FP. | 1181 __ Push(lr, fp, pp); |
1182 __ sub(fp, sp, Operand(StandardFrameConstants::kConstantPoolOffset)); | 1182 // Adjust FP to point to saved FP. |
| 1183 __ sub(fp, sp, Operand(StandardFrameConstants::kConstantPoolOffset)); |
| 1184 } else { |
| 1185 __ Push(lr, fp); |
| 1186 __ mov(fp, sp); |
| 1187 } |
| 1188 } else if (descriptor->IsJSFunctionCall()) { |
| 1189 __ Prologue(this->info()->GeneratePreagedPrologue()); |
1183 } else { | 1190 } else { |
1184 __ Push(lr, fp); | 1191 __ StubPrologue(info()->GetOutputStackFrameType()); |
1185 __ mov(fp, sp); | |
1186 } | 1192 } |
1187 } else if (descriptor->IsJSFunctionCall()) { | |
1188 __ Prologue(this->info()->GeneratePreagedPrologue()); | |
1189 } else if (frame()->needs_frame()) { | |
1190 __ StubPrologue(); | |
1191 } else { | 1193 } else { |
1192 frame()->SetElidedFrameSizeInSlots(0); | 1194 frame()->SetElidedFrameSizeInSlots(0); |
1193 } | 1195 } |
1194 frame_access_state()->SetFrameAccessToDefault(); | 1196 frame_access_state()->SetFrameAccessToDefault(); |
1195 | 1197 |
1196 int stack_shrink_slots = frame()->GetSpillSlotCount(); | 1198 int stack_shrink_slots = frame()->GetSpillSlotCount(); |
1197 if (info()->is_osr()) { | 1199 if (info()->is_osr()) { |
1198 // TurboFan OSR-compiled functions cannot be entered directly. | 1200 // TurboFan OSR-compiled functions cannot be entered directly. |
1199 __ Abort(kShouldNotDirectlyEnterOsrFunction); | 1201 __ Abort(kShouldNotDirectlyEnterOsrFunction); |
1200 | 1202 |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1481 padding_size -= v8::internal::Assembler::kInstrSize; | 1483 padding_size -= v8::internal::Assembler::kInstrSize; |
1482 } | 1484 } |
1483 } | 1485 } |
1484 } | 1486 } |
1485 | 1487 |
1486 #undef __ | 1488 #undef __ |
1487 | 1489 |
1488 } // namespace compiler | 1490 } // namespace compiler |
1489 } // namespace internal | 1491 } // namespace internal |
1490 } // namespace v8 | 1492 } // namespace v8 |
OLD | NEW |