| 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 4635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4646 // function without changing the state. | 4646 // function without changing the state. |
| 4647 __ cmp(ecx, edi); | 4647 __ cmp(ecx, edi); |
| 4648 __ j(equal, &call, Label::kNear); | 4648 __ j(equal, &call, Label::kNear); |
| 4649 __ cmp(ecx, Immediate(MegamorphicSentinel(isolate))); | 4649 __ cmp(ecx, Immediate(MegamorphicSentinel(isolate))); |
| 4650 __ j(equal, &call, Label::kNear); | 4650 __ j(equal, &call, Label::kNear); |
| 4651 | 4651 |
| 4652 // A monomorphic miss (i.e, here the cache is not uninitialized) goes | 4652 // A monomorphic miss (i.e, here the cache is not uninitialized) goes |
| 4653 // megamorphic. | 4653 // megamorphic. |
| 4654 __ cmp(ecx, Immediate(UninitializedSentinel(isolate))); | 4654 __ cmp(ecx, Immediate(UninitializedSentinel(isolate))); |
| 4655 __ j(equal, &initialize, Label::kNear); | 4655 __ j(equal, &initialize, Label::kNear); |
| 4656 // MegamorphicSentinel is a root so no write-barrier is needed. | 4656 // MegamorphicSentinel is an immortal immovable object (undefined) so no |
| 4657 // write-barrier is needed. |
| 4657 __ mov(FieldOperand(ebx, JSGlobalPropertyCell::kValueOffset), | 4658 __ mov(FieldOperand(ebx, JSGlobalPropertyCell::kValueOffset), |
| 4658 Immediate(MegamorphicSentinel(isolate))); | 4659 Immediate(MegamorphicSentinel(isolate))); |
| 4659 __ jmp(&call, Label::kNear); | 4660 __ jmp(&call, Label::kNear); |
| 4660 | 4661 |
| 4661 // An uninitialized cache is patched with the function. | 4662 // An uninitialized cache is patched with the function. |
| 4662 __ bind(&initialize); | 4663 __ bind(&initialize); |
| 4663 __ mov(FieldOperand(ebx, JSGlobalPropertyCell::kValueOffset), edi); | 4664 __ mov(FieldOperand(ebx, JSGlobalPropertyCell::kValueOffset), edi); |
| 4664 __ mov(ecx, edi); | 4665 // No need for a write barrier here - cells are rescanned. |
| 4665 __ RecordWriteField(ebx, | |
| 4666 JSGlobalPropertyCell::kValueOffset, | |
| 4667 ecx, | |
| 4668 edx, | |
| 4669 kDontSaveFPRegs, | |
| 4670 OMIT_REMEMBERED_SET, // Cells are rescanned. | |
| 4671 OMIT_SMI_CHECK); | |
| 4672 | 4666 |
| 4673 __ bind(&call); | 4667 __ bind(&call); |
| 4674 } | 4668 } |
| 4675 | 4669 |
| 4676 // Fast-case: Just invoke the function. | 4670 // Fast-case: Just invoke the function. |
| 4677 ParameterCount actual(argc_); | 4671 ParameterCount actual(argc_); |
| 4678 | 4672 |
| 4679 if (ReceiverMightBeImplicit()) { | 4673 if (ReceiverMightBeImplicit()) { |
| 4680 Label call_as_function; | 4674 Label call_as_function; |
| 4681 __ cmp(eax, isolate->factory()->the_hole_value()); | 4675 __ cmp(eax, isolate->factory()->the_hole_value()); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 4693 NullCallWrapper(), | 4687 NullCallWrapper(), |
| 4694 CALL_AS_FUNCTION); | 4688 CALL_AS_FUNCTION); |
| 4695 | 4689 |
| 4696 // Slow-case: Non-function called. | 4690 // Slow-case: Non-function called. |
| 4697 __ bind(&slow); | 4691 __ bind(&slow); |
| 4698 if (RecordCallTarget()) { | 4692 if (RecordCallTarget()) { |
| 4699 // If there is a call target cache, mark it megamorphic in the | 4693 // If there is a call target cache, mark it megamorphic in the |
| 4700 // non-function case. | 4694 // non-function case. |
| 4701 __ mov(ebx, Operand(esp, 0)); | 4695 __ mov(ebx, Operand(esp, 0)); |
| 4702 __ mov(ebx, Operand(ebx, 1)); | 4696 __ mov(ebx, Operand(ebx, 1)); |
| 4697 // MegamorphicSentinel is an immortal immovable object (undefined) so no |
| 4698 // write barrier is needed. |
| 4703 __ mov(FieldOperand(ebx, JSGlobalPropertyCell::kValueOffset), | 4699 __ mov(FieldOperand(ebx, JSGlobalPropertyCell::kValueOffset), |
| 4704 Immediate(MegamorphicSentinel(isolate))); | 4700 Immediate(MegamorphicSentinel(isolate))); |
| 4705 } | 4701 } |
| 4706 // Check for function proxy. | 4702 // Check for function proxy. |
| 4707 __ CmpInstanceType(ecx, JS_FUNCTION_PROXY_TYPE); | 4703 __ CmpInstanceType(ecx, JS_FUNCTION_PROXY_TYPE); |
| 4708 __ j(not_equal, &non_function); | 4704 __ j(not_equal, &non_function); |
| 4709 __ pop(ecx); | 4705 __ pop(ecx); |
| 4710 __ push(edi); // put proxy as additional argument under return address | 4706 __ push(edi); // put proxy as additional argument under return address |
| 4711 __ push(ecx); | 4707 __ push(ecx); |
| 4712 __ Set(eax, Immediate(argc_ + 1)); | 4708 __ Set(eax, Immediate(argc_ + 1)); |
| (...skipping 2571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7284 false); | 7280 false); |
| 7285 __ pop(edx); | 7281 __ pop(edx); |
| 7286 __ ret(0); | 7282 __ ret(0); |
| 7287 } | 7283 } |
| 7288 | 7284 |
| 7289 #undef __ | 7285 #undef __ |
| 7290 | 7286 |
| 7291 } } // namespace v8::internal | 7287 } } // namespace v8::internal |
| 7292 | 7288 |
| 7293 #endif // V8_TARGET_ARCH_IA32 | 7289 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |