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 1141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1152 | 1152 |
1153 void CodeGenerator::AssembleDeoptimizerCall( | 1153 void CodeGenerator::AssembleDeoptimizerCall( |
1154 int deoptimization_id, Deoptimizer::BailoutType bailout_type) { | 1154 int deoptimization_id, Deoptimizer::BailoutType bailout_type) { |
1155 Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( | 1155 Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( |
1156 isolate(), deoptimization_id, bailout_type); | 1156 isolate(), deoptimization_id, bailout_type); |
1157 __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY); | 1157 __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY); |
1158 } | 1158 } |
1159 | 1159 |
1160 | 1160 |
1161 void CodeGenerator::AssemblePrologue() { | 1161 void CodeGenerator::AssemblePrologue() { |
1162 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); | 1162 const CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
1163 if (descriptor->IsCFunctionCall()) { | 1163 if (descriptor->IsCFunctionCall()) { |
1164 if (FLAG_enable_embedded_constant_pool) { | 1164 if (FLAG_enable_embedded_constant_pool) { |
1165 __ Push(lr, fp, pp); | 1165 __ Push(lr, fp, pp); |
1166 // Adjust FP to point to saved FP. | 1166 // Adjust FP to point to saved FP. |
1167 __ sub(fp, sp, Operand(StandardFrameConstants::kConstantPoolOffset)); | 1167 __ sub(fp, sp, Operand(StandardFrameConstants::kConstantPoolOffset)); |
1168 } else { | 1168 } else { |
1169 __ Push(lr, fp); | 1169 __ Push(lr, fp); |
1170 __ mov(fp, sp); | 1170 __ mov(fp, sp); |
1171 } | 1171 } |
1172 } else if (descriptor->IsJSFunctionCall()) { | 1172 } else if (descriptor->IsJSFunctionCall()) { |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1217 if (saves != 0) { | 1217 if (saves != 0) { |
1218 // Save callee-saved registers. | 1218 // Save callee-saved registers. |
1219 __ stm(db_w, sp, saves); | 1219 __ stm(db_w, sp, saves); |
1220 frame()->AllocateSavedCalleeRegisterSlots( | 1220 frame()->AllocateSavedCalleeRegisterSlots( |
1221 base::bits::CountPopulation32(saves)); | 1221 base::bits::CountPopulation32(saves)); |
1222 } | 1222 } |
1223 } | 1223 } |
1224 | 1224 |
1225 | 1225 |
1226 void CodeGenerator::AssembleReturn() { | 1226 void CodeGenerator::AssembleReturn() { |
1227 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); | 1227 const CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
1228 int pop_count = static_cast<int>(descriptor->StackParameterCount()); | 1228 int pop_count = static_cast<int>(descriptor->StackParameterCount()); |
1229 | 1229 |
1230 // Restore registers. | 1230 // Restore registers. |
1231 const RegList saves = FLAG_enable_embedded_constant_pool | 1231 const RegList saves = FLAG_enable_embedded_constant_pool |
1232 ? (descriptor->CalleeSavedRegisters() & ~pp.bit()) | 1232 ? (descriptor->CalleeSavedRegisters() & ~pp.bit()) |
1233 : descriptor->CalleeSavedRegisters(); | 1233 : descriptor->CalleeSavedRegisters(); |
1234 if (saves != 0) { | 1234 if (saves != 0) { |
1235 __ ldm(ia_w, sp, saves); | 1235 __ ldm(ia_w, sp, saves); |
1236 } | 1236 } |
1237 | 1237 |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1466 padding_size -= v8::internal::Assembler::kInstrSize; | 1466 padding_size -= v8::internal::Assembler::kInstrSize; |
1467 } | 1467 } |
1468 } | 1468 } |
1469 } | 1469 } |
1470 | 1470 |
1471 #undef __ | 1471 #undef __ |
1472 | 1472 |
1473 } // namespace compiler | 1473 } // namespace compiler |
1474 } // namespace internal | 1474 } // namespace internal |
1475 } // namespace v8 | 1475 } // namespace v8 |
OLD | NEW |