OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 __ mov(Operand(ebx), eax); | 443 __ mov(Operand(ebx), eax); |
444 __ pop(edi); // restore edi after the call | 444 __ pop(edi); // restore edi after the call |
445 | 445 |
446 // Get the arguments count and untag it. | 446 // Get the arguments count and untag it. |
447 __ pop(eax); | 447 __ pop(eax); |
448 __ shr(eax, kSmiTagSize); | 448 __ shr(eax, kSmiTagSize); |
449 | 449 |
450 __ LeaveInternalFrame(); | 450 __ LeaveInternalFrame(); |
451 __ jmp(&patch_receiver); | 451 __ jmp(&patch_receiver); |
452 | 452 |
453 // Use the global object from the called function as the receiver. | 453 // Use the global receiver object from the called function as the receiver. |
454 __ bind(&use_global_receiver); | 454 __ bind(&use_global_receiver); |
455 const int kGlobalIndex = | 455 const int kGlobalIndex = |
456 Context::kHeaderSize + Context::GLOBAL_INDEX * kPointerSize; | 456 Context::kHeaderSize + Context::GLOBAL_INDEX * kPointerSize; |
457 __ mov(ebx, FieldOperand(esi, kGlobalIndex)); | 457 __ mov(ebx, FieldOperand(esi, kGlobalIndex)); |
| 458 __ mov(ebx, FieldOperand(ebx, GlobalObject::kGlobalReceiverOffset)); |
458 | 459 |
459 __ bind(&patch_receiver); | 460 __ bind(&patch_receiver); |
460 __ mov(Operand(esp, eax, times_4, 0), ebx); | 461 __ mov(Operand(esp, eax, times_4, 0), ebx); |
461 | 462 |
462 __ bind(&done); | 463 __ bind(&done); |
463 } | 464 } |
464 | 465 |
465 // 4. Shift stuff one slot down the stack. | 466 // 4. Shift stuff one slot down the stack. |
466 { Label loop; | 467 { Label loop; |
467 __ lea(ecx, Operand(eax, +1)); // +1 ~ copy receiver too | 468 __ lea(ecx, Operand(eax, +1)); // +1 ~ copy receiver too |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 __ cmp(ecx, LAST_JS_OBJECT_TYPE); | 587 __ cmp(ecx, LAST_JS_OBJECT_TYPE); |
587 __ j(less_equal, &push_receiver); | 588 __ j(less_equal, &push_receiver); |
588 | 589 |
589 // Convert the receiver to an object. | 590 // Convert the receiver to an object. |
590 __ bind(&call_to_object); | 591 __ bind(&call_to_object); |
591 __ push(ebx); | 592 __ push(ebx); |
592 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); | 593 __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); |
593 __ mov(ebx, Operand(eax)); | 594 __ mov(ebx, Operand(eax)); |
594 __ jmp(&push_receiver); | 595 __ jmp(&push_receiver); |
595 | 596 |
596 // Use the current global object as the receiver. | 597 // Use the current global receiver object as the receiver. |
597 __ bind(&use_global_receiver); | 598 __ bind(&use_global_receiver); |
598 const int kGlobalOffset = | 599 const int kGlobalOffset = |
599 Context::kHeaderSize + Context::GLOBAL_INDEX * kPointerSize; | 600 Context::kHeaderSize + Context::GLOBAL_INDEX * kPointerSize; |
600 __ mov(ebx, FieldOperand(esi, kGlobalOffset)); | 601 __ mov(ebx, FieldOperand(esi, kGlobalOffset)); |
| 602 __ mov(ebx, FieldOperand(ebx, GlobalObject::kGlobalReceiverOffset)); |
601 | 603 |
602 // Push the receiver. | 604 // Push the receiver. |
603 __ bind(&push_receiver); | 605 __ bind(&push_receiver); |
604 __ push(ebx); | 606 __ push(ebx); |
605 | 607 |
606 // Copy all arguments from the array to the stack. | 608 // Copy all arguments from the array to the stack. |
607 Label entry, loop; | 609 Label entry, loop; |
608 __ mov(eax, Operand(ebp, kIndexOffset)); | 610 __ mov(eax, Operand(ebp, kIndexOffset)); |
609 __ jmp(&entry); | 611 __ jmp(&entry); |
610 __ bind(&loop); | 612 __ bind(&loop); |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
891 // Register state for stub CallFunction (from CallFunctionStub in ic-ia32.cc). | 893 // Register state for stub CallFunction (from CallFunctionStub in ic-ia32.cc). |
892 // ----------- S t a t e ------------- | 894 // ----------- S t a t e ------------- |
893 // No registers used on entry. | 895 // No registers used on entry. |
894 // ----------------------------------- | 896 // ----------------------------------- |
895 Generate_DebugBreakCallHelper(masm, 0, false); | 897 Generate_DebugBreakCallHelper(masm, 0, false); |
896 } | 898 } |
897 | 899 |
898 #undef __ | 900 #undef __ |
899 | 901 |
900 } } // namespace v8::internal | 902 } } // namespace v8::internal |
OLD | NEW |