| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/compiler/code-generator-impl.h" | 7 #include "src/compiler/code-generator-impl.h" |
| 8 #include "src/compiler/gap-resolver.h" | 8 #include "src/compiler/gap-resolver.h" |
| 9 #include "src/compiler/node-matchers.h" | 9 #include "src/compiler/node-matchers.h" |
| 10 #include "src/compiler/node-properties-inl.h" | 10 #include "src/compiler/node-properties-inl.h" |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 Handle<Code> code = Handle<Code>::cast(i.InputHeapObject(0)); | 209 Handle<Code> code = Handle<Code>::cast(i.InputHeapObject(0)); |
| 210 __ Call(code, RelocInfo::CODE_TARGET); | 210 __ Call(code, RelocInfo::CODE_TARGET); |
| 211 } else { | 211 } else { |
| 212 Register reg = i.InputRegister(0); | 212 Register reg = i.InputRegister(0); |
| 213 int entry = Code::kHeaderSize - kHeapObjectTag; | 213 int entry = Code::kHeaderSize - kHeapObjectTag; |
| 214 __ Call(Operand(reg, entry)); | 214 __ Call(Operand(reg, entry)); |
| 215 } | 215 } |
| 216 AddSafepointAndDeopt(instr); | 216 AddSafepointAndDeopt(instr); |
| 217 break; | 217 break; |
| 218 } | 218 } |
| 219 case kArchCallAddress: | |
| 220 if (HasImmediateInput(instr, 0)) { | |
| 221 Immediate64 imm = i.InputImmediate64(0); | |
| 222 DCHECK_EQ(kImm64Value, imm.type); | |
| 223 __ Call(reinterpret_cast<byte*>(imm.value), RelocInfo::NONE64); | |
| 224 } else { | |
| 225 __ call(i.InputRegister(0)); | |
| 226 } | |
| 227 break; | |
| 228 case kArchCallJSFunction: { | 219 case kArchCallJSFunction: { |
| 229 Register func = i.InputRegister(0); | 220 Register func = i.InputRegister(0); |
| 230 if (FLAG_debug_code) { | 221 if (FLAG_debug_code) { |
| 231 // Check the function's context matches the context argument. | 222 // Check the function's context matches the context argument. |
| 232 __ cmpp(rsi, FieldOperand(func, JSFunction::kContextOffset)); | 223 __ cmpp(rsi, FieldOperand(func, JSFunction::kContextOffset)); |
| 233 __ Assert(equal, kWrongFunctionContext); | 224 __ Assert(equal, kWrongFunctionContext); |
| 234 } | 225 } |
| 235 __ Call(FieldOperand(func, JSFunction::kCodeEntryOffset)); | 226 __ Call(FieldOperand(func, JSFunction::kCodeEntryOffset)); |
| 236 AddSafepointAndDeopt(instr); | 227 AddSafepointAndDeopt(instr); |
| 237 break; | 228 break; |
| 238 } | 229 } |
| 239 case kArchDrop: { | |
| 240 int words = MiscField::decode(instr->opcode()); | |
| 241 __ addq(rsp, Immediate(kPointerSize * words)); | |
| 242 break; | |
| 243 } | |
| 244 case kArchJmp: | 230 case kArchJmp: |
| 245 __ jmp(code_->GetLabel(i.InputBlock(0))); | 231 __ jmp(code_->GetLabel(i.InputBlock(0))); |
| 246 break; | 232 break; |
| 247 case kArchNop: | 233 case kArchNop: |
| 248 // don't emit code for nops. | 234 // don't emit code for nops. |
| 249 break; | 235 break; |
| 250 case kArchRet: | 236 case kArchRet: |
| 251 AssembleReturn(); | 237 AssembleReturn(); |
| 252 break; | 238 break; |
| 253 case kArchTruncateDoubleToI: | 239 case kArchTruncateDoubleToI: |
| (...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1003 } | 989 } |
| 1004 | 990 |
| 1005 | 991 |
| 1006 void CodeGenerator::AddNopForSmiCodeInlining() { __ nop(); } | 992 void CodeGenerator::AddNopForSmiCodeInlining() { __ nop(); } |
| 1007 | 993 |
| 1008 #undef __ | 994 #undef __ |
| 1009 | 995 |
| 1010 } // namespace internal | 996 } // namespace internal |
| 1011 } // namespace compiler | 997 } // namespace compiler |
| 1012 } // namespace v8 | 998 } // namespace v8 |
| OLD | NEW |