| OLD | NEW |
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 2572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2583 // -- edx : receiver | 2583 // -- edx : receiver |
| 2584 // -- esp[0] : return address | 2584 // -- esp[0] : return address |
| 2585 // ----------------------------------- | 2585 // ----------------------------------- |
| 2586 Label miss; | 2586 Label miss; |
| 2587 | 2587 |
| 2588 // Check that the map of the global has not changed. | 2588 // Check that the map of the global has not changed. |
| 2589 __ cmp(FieldOperand(edx, HeapObject::kMapOffset), | 2589 __ cmp(FieldOperand(edx, HeapObject::kMapOffset), |
| 2590 Immediate(Handle<Map>(object->map()))); | 2590 Immediate(Handle<Map>(object->map()))); |
| 2591 __ j(not_equal, &miss, not_taken); | 2591 __ j(not_equal, &miss, not_taken); |
| 2592 | 2592 |
| 2593 // Store the value in the cell. | 2593 |
| 2594 // Compute the cell operand to use. |
| 2595 Operand cell_operand = Operand::Cell(Handle<JSGlobalPropertyCell>(cell)); |
| 2594 if (Serializer::enabled()) { | 2596 if (Serializer::enabled()) { |
| 2595 __ mov(ecx, Immediate(Handle<JSGlobalPropertyCell>(cell))); | 2597 __ mov(ecx, Immediate(Handle<JSGlobalPropertyCell>(cell))); |
| 2596 __ mov(FieldOperand(ecx, JSGlobalPropertyCell::kValueOffset), eax); | 2598 cell_operand = FieldOperand(ecx, JSGlobalPropertyCell::kValueOffset); |
| 2597 } else { | |
| 2598 __ mov(Operand::Cell(Handle<JSGlobalPropertyCell>(cell)), eax); | |
| 2599 } | 2599 } |
| 2600 | 2600 |
| 2601 // Check that the value in the cell is not the hole. If it is, this |
| 2602 // cell could have been deleted and reintroducing the global needs |
| 2603 // to update the property details in the property dictionary of the |
| 2604 // global object. We bail out to the runtime system to do that. |
| 2605 __ cmp(cell_operand, FACTORY->the_hole_value()); |
| 2606 __ j(equal, &miss); |
| 2607 |
| 2608 // Store the value in the cell. |
| 2609 __ mov(cell_operand, eax); |
| 2610 |
| 2601 // Return the value (register eax). | 2611 // Return the value (register eax). |
| 2602 __ IncrementCounter(COUNTERS->named_store_global_inline(), 1); | 2612 __ IncrementCounter(COUNTERS->named_store_global_inline(), 1); |
| 2603 __ ret(0); | 2613 __ ret(0); |
| 2604 | 2614 |
| 2605 // Handle store cache miss. | 2615 // Handle store cache miss. |
| 2606 __ bind(&miss); | 2616 __ bind(&miss); |
| 2607 __ IncrementCounter(COUNTERS->named_store_global_inline_miss(), 1); | 2617 __ IncrementCounter(COUNTERS->named_store_global_inline_miss(), 1); |
| 2608 Handle<Code> ic(Isolate::Current()->builtins()->builtin( | 2618 Handle<Code> ic(Isolate::Current()->builtins()->builtin( |
| 2609 Builtins::StoreIC_Miss)); | 2619 Builtins::StoreIC_Miss)); |
| 2610 __ jmp(ic, RelocInfo::CODE_TARGET); | 2620 __ jmp(ic, RelocInfo::CODE_TARGET); |
| (...skipping 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3651 | 3661 |
| 3652 return GetCode(flags); | 3662 return GetCode(flags); |
| 3653 } | 3663 } |
| 3654 | 3664 |
| 3655 | 3665 |
| 3656 #undef __ | 3666 #undef __ |
| 3657 | 3667 |
| 3658 } } // namespace v8::internal | 3668 } } // namespace v8::internal |
| 3659 | 3669 |
| 3660 #endif // V8_TARGET_ARCH_IA32 | 3670 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |