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/ast/scopes.h" | 7 #include "src/ast/scopes.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 14 matching lines...) Expand all Loading... |
25 class PPCOperandConverter final : public InstructionOperandConverter { | 25 class PPCOperandConverter final : public InstructionOperandConverter { |
26 public: | 26 public: |
27 PPCOperandConverter(CodeGenerator* gen, Instruction* instr) | 27 PPCOperandConverter(CodeGenerator* gen, Instruction* instr) |
28 : InstructionOperandConverter(gen, instr) {} | 28 : InstructionOperandConverter(gen, instr) {} |
29 | 29 |
30 size_t OutputCount() { return instr_->OutputCount(); } | 30 size_t OutputCount() { return instr_->OutputCount(); } |
31 | 31 |
32 RCBit OutputRCBit() const { | 32 RCBit OutputRCBit() const { |
33 switch (instr_->flags_mode()) { | 33 switch (instr_->flags_mode()) { |
34 case kFlags_branch: | 34 case kFlags_branch: |
| 35 case kFlags_deoptimize: |
35 case kFlags_set: | 36 case kFlags_set: |
36 return SetRC; | 37 return SetRC; |
37 case kFlags_none: | 38 case kFlags_none: |
38 return LeaveRC; | 39 return LeaveRC; |
39 } | 40 } |
40 UNREACHABLE(); | 41 UNREACHABLE(); |
41 return LeaveRC; | 42 return LeaveRC; |
42 } | 43 } |
43 | 44 |
44 bool CompareLogical() const { | 45 bool CompareLogical() const { |
(...skipping 1537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1582 __ ShiftLeftImm(r0, input, Operand(kPointerSizeLog2)); | 1583 __ ShiftLeftImm(r0, input, Operand(kPointerSizeLog2)); |
1583 __ LoadPX(kScratchReg, MemOperand(kScratchReg, r0)); | 1584 __ LoadPX(kScratchReg, MemOperand(kScratchReg, r0)); |
1584 __ Jump(kScratchReg); | 1585 __ Jump(kScratchReg); |
1585 } | 1586 } |
1586 | 1587 |
1587 | 1588 |
1588 void CodeGenerator::AssembleDeoptimizerCall( | 1589 void CodeGenerator::AssembleDeoptimizerCall( |
1589 int deoptimization_id, Deoptimizer::BailoutType bailout_type) { | 1590 int deoptimization_id, Deoptimizer::BailoutType bailout_type) { |
1590 Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( | 1591 Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( |
1591 isolate(), deoptimization_id, bailout_type); | 1592 isolate(), deoptimization_id, bailout_type); |
| 1593 // TODO(turbofan): We should be able to generate better code by sharing the |
| 1594 // actual final call site and just bl'ing to it here, similar to what we do |
| 1595 // in the lithium backend. |
1592 __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY); | 1596 __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY); |
1593 } | 1597 } |
1594 | 1598 |
1595 | 1599 |
1596 void CodeGenerator::AssemblePrologue() { | 1600 void CodeGenerator::AssemblePrologue() { |
1597 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); | 1601 CallDescriptor* descriptor = linkage()->GetIncomingDescriptor(); |
1598 if (descriptor->IsCFunctionCall()) { | 1602 if (descriptor->IsCFunctionCall()) { |
1599 __ function_descriptor(); | 1603 __ function_descriptor(); |
1600 __ mflr(r0); | 1604 __ mflr(r0); |
1601 if (FLAG_enable_embedded_constant_pool) { | 1605 if (FLAG_enable_embedded_constant_pool) { |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1907 padding_size -= v8::internal::Assembler::kInstrSize; | 1911 padding_size -= v8::internal::Assembler::kInstrSize; |
1908 } | 1912 } |
1909 } | 1913 } |
1910 } | 1914 } |
1911 | 1915 |
1912 #undef __ | 1916 #undef __ |
1913 | 1917 |
1914 } // namespace compiler | 1918 } // namespace compiler |
1915 } // namespace internal | 1919 } // namespace internal |
1916 } // namespace v8 | 1920 } // namespace v8 |
OLD | NEW |