OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
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 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 static void FreeSpaceForFastApiCall(MacroAssembler* masm) { | 558 static void FreeSpaceForFastApiCall(MacroAssembler* masm) { |
559 __ Drop(kFastApiCallArguments); | 559 __ Drop(kFastApiCallArguments); |
560 } | 560 } |
561 | 561 |
562 | 562 |
563 static void GenerateFastApiDirectCall(MacroAssembler* masm, | 563 static void GenerateFastApiDirectCall(MacroAssembler* masm, |
564 const CallOptimization& optimization, | 564 const CallOptimization& optimization, |
565 int argc) { | 565 int argc) { |
566 // ----------- S t a t e ------------- | 566 // ----------- S t a t e ------------- |
567 // -- sp[0] : holder (set by CheckPrototypes) | 567 // -- sp[0] : holder (set by CheckPrototypes) |
568 // -- sp[4] : callee js function | 568 // -- sp[4] : callee JS function |
569 // -- sp[8] : call data | 569 // -- sp[8] : call data |
570 // -- sp[12] : last js argument | 570 // -- sp[12] : last JS argument |
571 // -- ... | 571 // -- ... |
572 // -- sp[(argc + 3) * 4] : first js argument | 572 // -- sp[(argc + 3) * 4] : first JS argument |
573 // -- sp[(argc + 4) * 4] : receiver | 573 // -- sp[(argc + 4) * 4] : receiver |
574 // ----------------------------------- | 574 // ----------------------------------- |
575 // Get the function and setup the context. | 575 // Get the function and setup the context. |
576 Handle<JSFunction> function = optimization.constant_function(); | 576 Handle<JSFunction> function = optimization.constant_function(); |
577 __ LoadHeapObject(t1, function); | 577 __ LoadHeapObject(t1, function); |
578 __ lw(cp, FieldMemOperand(t1, JSFunction::kContextOffset)); | 578 __ lw(cp, FieldMemOperand(t1, JSFunction::kContextOffset)); |
579 | 579 |
580 // Pass the additional arguments FastHandleApiCall expects. | 580 // Pass the additional arguments FastHandleApiCall expects. |
581 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); | 581 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); |
582 Handle<Object> call_data(api_call_info->data()); | 582 Handle<Object> call_data(api_call_info->data()); |
583 if (masm->isolate()->heap()->InNewSpace(*call_data)) { | 583 if (masm->isolate()->heap()->InNewSpace(*call_data)) { |
584 __ li(a0, api_call_info); | 584 __ li(a0, api_call_info); |
585 __ lw(t2, FieldMemOperand(a0, CallHandlerInfo::kDataOffset)); | 585 __ lw(t2, FieldMemOperand(a0, CallHandlerInfo::kDataOffset)); |
586 } else { | 586 } else { |
587 __ li(t2, call_data); | 587 __ li(t2, call_data); |
588 } | 588 } |
589 | 589 |
590 // Store js function and call data. | 590 // Store JS function and call data. |
591 __ sw(t1, MemOperand(sp, 1 * kPointerSize)); | 591 __ sw(t1, MemOperand(sp, 1 * kPointerSize)); |
592 __ sw(t2, MemOperand(sp, 2 * kPointerSize)); | 592 __ sw(t2, MemOperand(sp, 2 * kPointerSize)); |
593 | 593 |
594 // a2 points to call data as expected by Arguments | 594 // a2 points to call data as expected by Arguments |
595 // (refer to layout above). | 595 // (refer to layout above). |
596 __ Addu(a2, sp, Operand(2 * kPointerSize)); | 596 __ Addu(a2, sp, Operand(2 * kPointerSize)); |
597 | 597 |
598 const int kApiStackSpace = 4; | 598 const int kApiStackSpace = 4; |
599 | 599 |
600 FrameScope frame_scope(masm, StackFrame::MANUAL); | 600 FrameScope frame_scope(masm, StackFrame::MANUAL); |
(...skipping 3704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4305 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss(); | 4305 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss(); |
4306 __ Jump(ic_miss, RelocInfo::CODE_TARGET); | 4306 __ Jump(ic_miss, RelocInfo::CODE_TARGET); |
4307 } | 4307 } |
4308 | 4308 |
4309 | 4309 |
4310 #undef __ | 4310 #undef __ |
4311 | 4311 |
4312 } } // namespace v8::internal | 4312 } } // namespace v8::internal |
4313 | 4313 |
4314 #endif // V8_TARGET_ARCH_MIPS | 4314 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |