| 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/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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 case kArchNop: | 143 case kArchNop: |
| 144 // don't emit code for nops. | 144 // don't emit code for nops. |
| 145 DCHECK_EQ(LeaveCC, i.OutputSBit()); | 145 DCHECK_EQ(LeaveCC, i.OutputSBit()); |
| 146 break; | 146 break; |
| 147 case kArchRet: | 147 case kArchRet: |
| 148 AssembleReturn(); | 148 AssembleReturn(); |
| 149 DCHECK_EQ(LeaveCC, i.OutputSBit()); | 149 DCHECK_EQ(LeaveCC, i.OutputSBit()); |
| 150 break; | 150 break; |
| 151 case kArchDeoptimize: { | 151 case kArchDeoptimize: { |
| 152 int deoptimization_id = MiscField::decode(instr->opcode()); | 152 int deoptimization_id = MiscField::decode(instr->opcode()); |
| 153 BuildTranslation(instr, deoptimization_id); | 153 BuildTranslation(instr, 0, deoptimization_id); |
| 154 | 154 |
| 155 Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( | 155 Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( |
| 156 isolate(), deoptimization_id, Deoptimizer::LAZY); | 156 isolate(), deoptimization_id, Deoptimizer::LAZY); |
| 157 __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY); | 157 __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY); |
| 158 DCHECK_EQ(LeaveCC, i.OutputSBit()); | 158 DCHECK_EQ(LeaveCC, i.OutputSBit()); |
| 159 break; | 159 break; |
| 160 } | 160 } |
| 161 case kArchTruncateDoubleToI: | 161 case kArchTruncateDoubleToI: |
| 162 __ TruncateDoubleToI(i.OutputRegister(), i.InputDoubleRegister(0)); | 162 __ TruncateDoubleToI(i.OutputRegister(), i.InputDoubleRegister(0)); |
| 163 DCHECK_EQ(LeaveCC, i.OutputSBit()); | 163 DCHECK_EQ(LeaveCC, i.OutputSBit()); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 CpuFeatureScope scope(masm(), ARMv7); | 233 CpuFeatureScope scope(masm(), ARMv7); |
| 234 __ ubfx(i.OutputRegister(), i.InputRegister(0), i.InputInt8(1), | 234 __ ubfx(i.OutputRegister(), i.InputRegister(0), i.InputInt8(1), |
| 235 i.InputInt8(2)); | 235 i.InputInt8(2)); |
| 236 DCHECK_EQ(LeaveCC, i.OutputSBit()); | 236 DCHECK_EQ(LeaveCC, i.OutputSBit()); |
| 237 break; | 237 break; |
| 238 } | 238 } |
| 239 case kArmCallCodeObject: { | 239 case kArmCallCodeObject: { |
| 240 if (instr->InputAt(0)->IsImmediate()) { | 240 if (instr->InputAt(0)->IsImmediate()) { |
| 241 Handle<Code> code = Handle<Code>::cast(i.InputHeapObject(0)); | 241 Handle<Code> code = Handle<Code>::cast(i.InputHeapObject(0)); |
| 242 __ Call(code, RelocInfo::CODE_TARGET); | 242 __ Call(code, RelocInfo::CODE_TARGET); |
| 243 RecordSafepoint(instr->pointer_map(), Safepoint::kSimple, 0, | |
| 244 Safepoint::kNoLazyDeopt); | |
| 245 } else { | 243 } else { |
| 246 Register reg = i.InputRegister(0); | 244 Register reg = i.InputRegister(0); |
| 247 int entry = Code::kHeaderSize - kHeapObjectTag; | 245 int entry = Code::kHeaderSize - kHeapObjectTag; |
| 248 __ ldr(reg, MemOperand(reg, entry)); | 246 __ ldr(reg, MemOperand(reg, entry)); |
| 249 __ Call(reg); | 247 __ Call(reg); |
| 250 RecordSafepoint(instr->pointer_map(), Safepoint::kSimple, 0, | |
| 251 Safepoint::kNoLazyDeopt); | |
| 252 } | 248 } |
| 253 bool lazy_deopt = (MiscField::decode(instr->opcode()) == 1); | 249 |
| 254 if (lazy_deopt) { | 250 AddSafepointAndDeopt(instr); |
| 255 RecordLazyDeoptimizationEntry(instr); | 251 |
| 256 } | |
| 257 DCHECK_EQ(LeaveCC, i.OutputSBit()); | 252 DCHECK_EQ(LeaveCC, i.OutputSBit()); |
| 258 break; | 253 break; |
| 259 } | 254 } |
| 260 case kArmCallJSFunction: { | 255 case kArmCallJSFunction: { |
| 261 Register func = i.InputRegister(0); | 256 Register func = i.InputRegister(0); |
| 262 | 257 |
| 263 // TODO(jarin) The load of the context should be separated from the call. | 258 // TODO(jarin) The load of the context should be separated from the call. |
| 264 __ ldr(cp, FieldMemOperand(func, JSFunction::kContextOffset)); | 259 __ ldr(cp, FieldMemOperand(func, JSFunction::kContextOffset)); |
| 265 __ ldr(ip, FieldMemOperand(func, JSFunction::kCodeEntryOffset)); | 260 __ ldr(ip, FieldMemOperand(func, JSFunction::kCodeEntryOffset)); |
| 266 __ Call(ip); | 261 __ Call(ip); |
| 267 | 262 |
| 268 RecordSafepoint(instr->pointer_map(), Safepoint::kSimple, 0, | 263 AddSafepointAndDeopt(instr); |
| 269 Safepoint::kNoLazyDeopt); | 264 |
| 270 RecordLazyDeoptimizationEntry(instr); | |
| 271 DCHECK_EQ(LeaveCC, i.OutputSBit()); | 265 DCHECK_EQ(LeaveCC, i.OutputSBit()); |
| 272 break; | 266 break; |
| 273 } | 267 } |
| 274 case kArmCallAddress: { | 268 case kArmCallAddress: { |
| 275 DirectCEntryStub stub(isolate()); | 269 DirectCEntryStub stub(isolate()); |
| 276 stub.GenerateCall(masm(), i.InputRegister(0)); | 270 stub.GenerateCall(masm(), i.InputRegister(0)); |
| 277 DCHECK_EQ(LeaveCC, i.OutputSBit()); | 271 DCHECK_EQ(LeaveCC, i.OutputSBit()); |
| 278 break; | 272 break; |
| 279 } | 273 } |
| 280 case kArmPush: | 274 case kArmPush: |
| (...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 830 | 824 |
| 831 void CodeGenerator::AddNopForSmiCodeInlining() { | 825 void CodeGenerator::AddNopForSmiCodeInlining() { |
| 832 // On 32-bit ARM we do not insert nops for inlined Smi code. | 826 // On 32-bit ARM we do not insert nops for inlined Smi code. |
| 833 UNREACHABLE(); | 827 UNREACHABLE(); |
| 834 } | 828 } |
| 835 | 829 |
| 836 #undef __ | 830 #undef __ |
| 837 } | 831 } |
| 838 } | 832 } |
| 839 } // namespace v8::internal::compiler | 833 } // namespace v8::internal::compiler |
| OLD | NEW |