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 1148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1159 // TODO(turbofan): We should be able to generate better code by sharing the | 1159 // TODO(turbofan): We should be able to generate better code by sharing the |
1160 // actual final call site and just bl'ing to it here, similar to what we do | 1160 // actual final call site and just bl'ing to it here, similar to what we do |
1161 // in the lithium backend. | 1161 // in the lithium backend. |
1162 __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY); | 1162 __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY); |
1163 __ CheckConstPool(false, false); | 1163 __ CheckConstPool(false, false); |
1164 } | 1164 } |
1165 | 1165 |
1166 | 1166 |
1167 void CodeGenerator::AssemblePrologue() { | 1167 void CodeGenerator::AssemblePrologue() { |
1168 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); | 1168 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
1169 if (descriptor->IsCFunctionCall()) { | 1169 if (frame()->needs_frame()) { |
1170 if (FLAG_enable_embedded_constant_pool) { | 1170 if (descriptor->flags() & CallDescriptor::kHasStandardFrameHeader) { |
1171 __ Push(lr, fp, pp); | 1171 __ Prologue(this->info()->GeneratePreagedPrologue()); |
1172 // Adjust FP to point to saved FP. | |
1173 __ sub(fp, sp, Operand(StandardFrameConstants::kConstantPoolOffset)); | |
1174 } else { | 1172 } else { |
1175 __ Push(lr, fp); | 1173 __ StubPrologue(info()->GetOutputStackFrameType()); |
titzer
2016/03/07 10:48:43
Would it be possible to unify the two cases and pu
danno
2016/03/08 07:04:44
Yes, but I'd prefer to save that for a separate CL
| |
1176 __ mov(fp, sp); | |
1177 } | 1174 } |
1178 } else if (descriptor->IsJSFunctionCall()) { | |
1179 __ Prologue(this->info()->GeneratePreagedPrologue()); | |
1180 } else if (frame()->needs_frame()) { | |
1181 __ StubPrologue(); | |
1182 } else { | 1175 } else { |
1183 frame()->SetElidedFrameSizeInSlots(0); | 1176 frame()->SetElidedFrameSizeInSlots(0); |
1184 } | 1177 } |
1185 frame_access_state()->SetFrameAccessToDefault(); | 1178 frame_access_state()->SetFrameAccessToDefault(); |
1186 | 1179 |
1187 int stack_shrink_slots = frame()->GetSpillSlotCount(); | 1180 int stack_shrink_slots = frame()->GetSpillSlotCount(); |
1188 if (info()->is_osr()) { | 1181 if (info()->is_osr()) { |
1189 // TurboFan OSR-compiled functions cannot be entered directly. | 1182 // TurboFan OSR-compiled functions cannot be entered directly. |
1190 __ Abort(kShouldNotDirectlyEnterOsrFunction); | 1183 __ Abort(kShouldNotDirectlyEnterOsrFunction); |
1191 | 1184 |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1472 padding_size -= v8::internal::Assembler::kInstrSize; | 1465 padding_size -= v8::internal::Assembler::kInstrSize; |
1473 } | 1466 } |
1474 } | 1467 } |
1475 } | 1468 } |
1476 | 1469 |
1477 #undef __ | 1470 #undef __ |
1478 | 1471 |
1479 } // namespace compiler | 1472 } // namespace compiler |
1480 } // namespace internal | 1473 } // namespace internal |
1481 } // namespace v8 | 1474 } // namespace v8 |
OLD | NEW |