OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 2616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2627 mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); | 2627 mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); |
2628 mov(ebx, FieldOperand(edx, SharedFunctionInfo::kFormalParameterCountOffset)); | 2628 mov(ebx, FieldOperand(edx, SharedFunctionInfo::kFormalParameterCountOffset)); |
2629 SmiUntag(ebx); | 2629 SmiUntag(ebx); |
2630 | 2630 |
2631 ParameterCount expected(ebx); | 2631 ParameterCount expected(ebx); |
2632 InvokeCode(FieldOperand(edi, JSFunction::kCodeEntryOffset), | 2632 InvokeCode(FieldOperand(edi, JSFunction::kCodeEntryOffset), |
2633 expected, actual, flag, call_wrapper, call_kind); | 2633 expected, actual, flag, call_wrapper, call_kind); |
2634 } | 2634 } |
2635 | 2635 |
2636 | 2636 |
2637 void MacroAssembler::InvokeFunction(Handle<JSFunction> function, | 2637 void MacroAssembler::InvokeFunction(Register fun, |
2638 const ParameterCount& expected, | 2638 const ParameterCount& expected, |
2639 const ParameterCount& actual, | 2639 const ParameterCount& actual, |
2640 InvokeFlag flag, | 2640 InvokeFlag flag, |
2641 const CallWrapper& call_wrapper, | 2641 const CallWrapper& call_wrapper, |
2642 CallKind call_kind) { | 2642 CallKind call_kind) { |
2643 // You can't call a function without a valid frame. | 2643 // You can't call a function without a valid frame. |
2644 ASSERT(flag == JUMP_FUNCTION || has_frame()); | 2644 ASSERT(flag == JUMP_FUNCTION || has_frame()); |
2645 | 2645 |
2646 // Get the function and setup the context. | 2646 ASSERT(fun.is(edi)); |
2647 LoadHeapObject(edi, function); | |
2648 mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); | 2647 mov(esi, FieldOperand(edi, JSFunction::kContextOffset)); |
2649 | 2648 |
2650 // We call indirectly through the code field in the function to | |
2651 // allow recompilation to take effect without changing any of the | |
2652 // call sites. | |
2653 InvokeCode(FieldOperand(edi, JSFunction::kCodeEntryOffset), | 2649 InvokeCode(FieldOperand(edi, JSFunction::kCodeEntryOffset), |
2654 expected, actual, flag, call_wrapper, call_kind); | 2650 expected, actual, flag, call_wrapper, call_kind); |
2655 } | 2651 } |
2656 | 2652 |
2657 | 2653 |
| 2654 void MacroAssembler::InvokeFunction(Handle<JSFunction> function, |
| 2655 const ParameterCount& expected, |
| 2656 const ParameterCount& actual, |
| 2657 InvokeFlag flag, |
| 2658 const CallWrapper& call_wrapper, |
| 2659 CallKind call_kind) { |
| 2660 LoadHeapObject(edi, function); |
| 2661 InvokeFunction(edi, expected, actual, flag, call_wrapper, call_kind); |
| 2662 } |
| 2663 |
| 2664 |
2658 void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id, | 2665 void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id, |
2659 InvokeFlag flag, | 2666 InvokeFlag flag, |
2660 const CallWrapper& call_wrapper) { | 2667 const CallWrapper& call_wrapper) { |
2661 // You can't call a builtin without a valid frame. | 2668 // You can't call a builtin without a valid frame. |
2662 ASSERT(flag == JUMP_FUNCTION || has_frame()); | 2669 ASSERT(flag == JUMP_FUNCTION || has_frame()); |
2663 | 2670 |
2664 // Rely on the assertion to check that the number of provided | 2671 // Rely on the assertion to check that the number of provided |
2665 // arguments match the expected number of arguments. Fake a | 2672 // arguments match the expected number of arguments. Fake a |
2666 // parameter count to avoid emitting code to do the check. | 2673 // parameter count to avoid emitting code to do the check. |
2667 ParameterCount expected(0); | 2674 ParameterCount expected(0); |
(...skipping 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3691 cmp(scratch1, Immediate(DICTIONARY_ELEMENTS)); | 3698 cmp(scratch1, Immediate(DICTIONARY_ELEMENTS)); |
3692 j(equal, found); | 3699 j(equal, found); |
3693 mov(current, FieldOperand(current, Map::kPrototypeOffset)); | 3700 mov(current, FieldOperand(current, Map::kPrototypeOffset)); |
3694 cmp(current, Immediate(factory->null_value())); | 3701 cmp(current, Immediate(factory->null_value())); |
3695 j(not_equal, &loop_again); | 3702 j(not_equal, &loop_again); |
3696 } | 3703 } |
3697 | 3704 |
3698 } } // namespace v8::internal | 3705 } } // namespace v8::internal |
3699 | 3706 |
3700 #endif // V8_TARGET_ARCH_IA32 | 3707 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |