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