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 3578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3589 Register target = ToRegister(instr->target()); | 3589 Register target = ToRegister(instr->target()); |
3590 generator.BeforeCall(__ CallSize(target)); | 3590 generator.BeforeCall(__ CallSize(target)); |
3591 __ Addu(target, target, Operand(Code::kHeaderSize - kHeapObjectTag)); | 3591 __ Addu(target, target, Operand(Code::kHeaderSize - kHeapObjectTag)); |
3592 __ Call(target); | 3592 __ Call(target); |
3593 } | 3593 } |
3594 generator.AfterCall(); | 3594 generator.AfterCall(); |
3595 } | 3595 } |
3596 } | 3596 } |
3597 | 3597 |
3598 | 3598 |
3599 void LCodeGen::DoCallJSFunction(LCallJSFunction* instr) { | |
3600 DCHECK(ToRegister(instr->function()).is(a1)); | |
3601 DCHECK(ToRegister(instr->result()).is(v0)); | |
3602 | |
3603 // Change context. | |
3604 __ lw(cp, FieldMemOperand(a1, JSFunction::kContextOffset)); | |
3605 | |
3606 // Always initialize new target and number of actual arguments. | |
3607 __ LoadRoot(a3, Heap::kUndefinedValueRootIndex); | |
3608 __ li(a0, Operand(instr->arity())); | |
3609 | |
3610 // Load the code entry address | |
3611 __ lw(at, FieldMemOperand(a1, JSFunction::kCodeEntryOffset)); | |
3612 __ Call(at); | |
3613 | |
3614 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); | |
3615 } | |
3616 | |
3617 | |
3618 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { | 3599 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { |
3619 DCHECK(ToRegister(instr->context()).is(cp)); | 3600 DCHECK(ToRegister(instr->context()).is(cp)); |
3620 DCHECK(ToRegister(instr->constructor()).is(a1)); | 3601 DCHECK(ToRegister(instr->constructor()).is(a1)); |
3621 DCHECK(ToRegister(instr->result()).is(v0)); | 3602 DCHECK(ToRegister(instr->result()).is(v0)); |
3622 | 3603 |
3623 __ li(a0, Operand(instr->arity())); | 3604 __ li(a0, Operand(instr->arity())); |
3624 if (instr->arity() == 1) { | 3605 if (instr->arity() == 1) { |
3625 // We only need the allocation site for the case we have a length argument. | 3606 // We only need the allocation site for the case we have a length argument. |
3626 // The case may bail out to the runtime, which will determine the correct | 3607 // The case may bail out to the runtime, which will determine the correct |
3627 // elements kind with the site. | 3608 // elements kind with the site. |
(...skipping 1879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5507 void LCodeGen::DoStoreFrameContext(LStoreFrameContext* instr) { | 5488 void LCodeGen::DoStoreFrameContext(LStoreFrameContext* instr) { |
5508 Register context = ToRegister(instr->context()); | 5489 Register context = ToRegister(instr->context()); |
5509 __ sw(context, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 5490 __ sw(context, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
5510 } | 5491 } |
5511 | 5492 |
5512 | 5493 |
5513 #undef __ | 5494 #undef __ |
5514 | 5495 |
5515 } // namespace internal | 5496 } // namespace internal |
5516 } // namespace v8 | 5497 } // namespace v8 |
OLD | NEW |