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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 __ asm_instr(value, i.InputOffset(3), lo); \ | 352 __ asm_instr(value, i.InputOffset(3), lo); \ |
353 DCHECK_EQ(LeaveCC, i.OutputSBit()); \ | 353 DCHECK_EQ(LeaveCC, i.OutputSBit()); \ |
354 } while (0) | 354 } while (0) |
355 | 355 |
356 | 356 |
357 void CodeGenerator::AssembleDeconstructActivationRecord(int stack_param_delta) { | 357 void CodeGenerator::AssembleDeconstructActivationRecord(int stack_param_delta) { |
358 int sp_slot_delta = TailCallFrameStackSlotDelta(stack_param_delta); | 358 int sp_slot_delta = TailCallFrameStackSlotDelta(stack_param_delta); |
359 if (sp_slot_delta > 0) { | 359 if (sp_slot_delta > 0) { |
360 __ add(sp, sp, Operand(sp_slot_delta * kPointerSize)); | 360 __ add(sp, sp, Operand(sp_slot_delta * kPointerSize)); |
361 } | 361 } |
362 if (frame()->needs_frame()) { | |
363 if (FLAG_enable_embedded_constant_pool) { | |
364 __ ldm(ia_w, sp, pp.bit() | fp.bit() | lr.bit()); | |
365 } else { | |
366 __ ldm(ia_w, sp, fp.bit() | lr.bit()); | |
367 } | |
368 } | |
369 frame_access_state()->SetFrameAccessToDefault(); | 362 frame_access_state()->SetFrameAccessToDefault(); |
370 } | 363 } |
371 | 364 |
372 | 365 |
373 void CodeGenerator::AssemblePrepareTailCall(int stack_param_delta) { | 366 void CodeGenerator::AssemblePrepareTailCall(int stack_param_delta) { |
374 int sp_slot_delta = TailCallFrameStackSlotDelta(stack_param_delta); | 367 int sp_slot_delta = TailCallFrameStackSlotDelta(stack_param_delta); |
375 if (sp_slot_delta < 0) { | 368 if (sp_slot_delta < 0) { |
376 __ sub(sp, sp, Operand(-sp_slot_delta * kPointerSize)); | 369 __ sub(sp, sp, Operand(-sp_slot_delta * kPointerSize)); |
377 frame_access_state()->IncreaseSPDelta(-sp_slot_delta); | 370 frame_access_state()->IncreaseSPDelta(-sp_slot_delta); |
378 } | 371 } |
| 372 if (frame()->needs_frame()) { |
| 373 if (FLAG_enable_embedded_constant_pool) { |
| 374 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kConstantPoolOffset)); |
| 375 } |
| 376 __ ldr(lr, MemOperand(fp, StandardFrameConstants::kCallerPCOffset)); |
| 377 __ ldr(fp, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
| 378 } |
379 frame_access_state()->SetFrameAccessToSP(); | 379 frame_access_state()->SetFrameAccessToSP(); |
380 } | 380 } |
381 | 381 |
382 | 382 |
383 // Assembles an instruction after register allocation, producing machine code. | 383 // Assembles an instruction after register allocation, producing machine code. |
384 void CodeGenerator::AssembleArchInstruction(Instruction* instr) { | 384 void CodeGenerator::AssembleArchInstruction(Instruction* instr) { |
385 ArmOperandConverter i(this, instr); | 385 ArmOperandConverter i(this, instr); |
386 | 386 |
387 masm()->MaybeCheckConstPool(); | 387 masm()->MaybeCheckConstPool(); |
388 | 388 |
(...skipping 986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1375 padding_size -= v8::internal::Assembler::kInstrSize; | 1375 padding_size -= v8::internal::Assembler::kInstrSize; |
1376 } | 1376 } |
1377 } | 1377 } |
1378 } | 1378 } |
1379 | 1379 |
1380 #undef __ | 1380 #undef __ |
1381 | 1381 |
1382 } // namespace compiler | 1382 } // namespace compiler |
1383 } // namespace internal | 1383 } // namespace internal |
1384 } // namespace v8 | 1384 } // namespace v8 |
OLD | NEW |