OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved.7 | 1 // Copyright 2012 the V8 project authors. All rights reserved.7 |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 3597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3608 __ li(a0, Operand(instr->arity())); | 3608 __ li(a0, Operand(instr->arity())); |
3609 | 3609 |
3610 // Load the code entry address | 3610 // Load the code entry address |
3611 __ lw(at, FieldMemOperand(a1, JSFunction::kCodeEntryOffset)); | 3611 __ lw(at, FieldMemOperand(a1, JSFunction::kCodeEntryOffset)); |
3612 __ Call(at); | 3612 __ Call(at); |
3613 | 3613 |
3614 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); | 3614 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); |
3615 } | 3615 } |
3616 | 3616 |
3617 | 3617 |
3618 void LCodeGen::DoCallFunction(LCallFunction* instr) { | |
3619 HCallFunction* hinstr = instr->hydrogen(); | |
3620 DCHECK(ToRegister(instr->context()).is(cp)); | |
3621 DCHECK(ToRegister(instr->function()).is(a1)); | |
3622 DCHECK(ToRegister(instr->result()).is(v0)); | |
3623 | |
3624 int arity = instr->arity(); | |
3625 ConvertReceiverMode mode = hinstr->convert_mode(); | |
3626 if (hinstr->HasVectorAndSlot()) { | |
3627 Register slot_register = ToRegister(instr->temp_slot()); | |
3628 Register vector_register = ToRegister(instr->temp_vector()); | |
3629 DCHECK(slot_register.is(a3)); | |
3630 DCHECK(vector_register.is(a2)); | |
3631 | |
3632 AllowDeferredHandleDereference vector_structure_check; | |
3633 Handle<TypeFeedbackVector> vector = hinstr->feedback_vector(); | |
3634 int index = vector->GetIndex(hinstr->slot()); | |
3635 | |
3636 __ li(vector_register, vector); | |
3637 __ li(slot_register, Operand(Smi::FromInt(index))); | |
3638 | |
3639 Handle<Code> ic = | |
3640 CodeFactory::CallICInOptimizedCode(isolate(), arity, mode).code(); | |
3641 CallCode(ic, RelocInfo::CODE_TARGET, instr); | |
3642 } else { | |
3643 __ li(a0, Operand(arity)); | |
3644 CallCode(isolate()->builtins()->Call(mode), RelocInfo::CODE_TARGET, instr); | |
3645 } | |
3646 } | |
3647 | |
3648 | |
3649 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { | 3618 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { |
3650 DCHECK(ToRegister(instr->context()).is(cp)); | 3619 DCHECK(ToRegister(instr->context()).is(cp)); |
3651 DCHECK(ToRegister(instr->constructor()).is(a1)); | 3620 DCHECK(ToRegister(instr->constructor()).is(a1)); |
3652 DCHECK(ToRegister(instr->result()).is(v0)); | 3621 DCHECK(ToRegister(instr->result()).is(v0)); |
3653 | 3622 |
3654 __ li(a0, Operand(instr->arity())); | 3623 __ li(a0, Operand(instr->arity())); |
3655 if (instr->arity() == 1) { | 3624 if (instr->arity() == 1) { |
3656 // We only need the allocation site for the case we have a length argument. | 3625 // We only need the allocation site for the case we have a length argument. |
3657 // The case may bail out to the runtime, which will determine the correct | 3626 // The case may bail out to the runtime, which will determine the correct |
3658 // elements kind with the site. | 3627 // elements kind with the site. |
(...skipping 1879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5538 void LCodeGen::DoStoreFrameContext(LStoreFrameContext* instr) { | 5507 void LCodeGen::DoStoreFrameContext(LStoreFrameContext* instr) { |
5539 Register context = ToRegister(instr->context()); | 5508 Register context = ToRegister(instr->context()); |
5540 __ sw(context, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 5509 __ sw(context, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
5541 } | 5510 } |
5542 | 5511 |
5543 | 5512 |
5544 #undef __ | 5513 #undef __ |
5545 | 5514 |
5546 } // namespace internal | 5515 } // namespace internal |
5547 } // namespace v8 | 5516 } // namespace v8 |
OLD | NEW |