| 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 1480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1491 | 1491 |
| 1492 // Check if value is a smi. | 1492 // Check if value is a smi. |
| 1493 __ test(ecx, Immediate(kSmiTagMask)); | 1493 __ test(ecx, Immediate(kSmiTagMask)); |
| 1494 __ j(not_zero, &with_write_barrier); | 1494 __ j(not_zero, &with_write_barrier); |
| 1495 | 1495 |
| 1496 __ bind(&exit); | 1496 __ bind(&exit); |
| 1497 __ ret((argc + 1) * kPointerSize); | 1497 __ ret((argc + 1) * kPointerSize); |
| 1498 | 1498 |
| 1499 __ bind(&with_write_barrier); | 1499 __ bind(&with_write_barrier); |
| 1500 | 1500 |
| 1501 __ IncrementalMarkingRecordWrite(ebx, ecx, edx); |
| 1502 |
| 1501 __ InNewSpace(ebx, ecx, equal, &exit); | 1503 __ InNewSpace(ebx, ecx, equal, &exit); |
| 1502 | 1504 |
| 1503 __ RecordWriteHelper(ebx, edx, ecx, kDontSaveFPRegs); | 1505 __ RecordWriteHelper(ebx, edx, ecx, kDontSaveFPRegs); |
| 1504 __ ret((argc + 1) * kPointerSize); | 1506 __ ret((argc + 1) * kPointerSize); |
| 1505 | 1507 |
| 1506 __ bind(&attempt_to_grow_elements); | 1508 __ bind(&attempt_to_grow_elements); |
| 1507 if (!FLAG_inline_new) { | 1509 if (!FLAG_inline_new) { |
| 1508 __ jmp(&call_builtin); | 1510 __ jmp(&call_builtin); |
| 1509 } | 1511 } |
| 1510 | 1512 |
| (...skipping 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2576 // -- edx : receiver | 2578 // -- edx : receiver |
| 2577 // -- esp[0] : return address | 2579 // -- esp[0] : return address |
| 2578 // ----------------------------------- | 2580 // ----------------------------------- |
| 2579 Label miss; | 2581 Label miss; |
| 2580 | 2582 |
| 2581 // Check that the map of the global has not changed. | 2583 // Check that the map of the global has not changed. |
| 2582 __ cmp(FieldOperand(edx, HeapObject::kMapOffset), | 2584 __ cmp(FieldOperand(edx, HeapObject::kMapOffset), |
| 2583 Immediate(Handle<Map>(object->map()))); | 2585 Immediate(Handle<Map>(object->map()))); |
| 2584 __ j(not_equal, &miss, not_taken); | 2586 __ j(not_equal, &miss, not_taken); |
| 2585 | 2587 |
| 2586 | |
| 2587 // Compute the cell operand to use. | 2588 // Compute the cell operand to use. |
| 2588 Operand cell_operand = Operand::Cell(Handle<JSGlobalPropertyCell>(cell)); | 2589 __ mov(ebx, Immediate(Handle<JSGlobalPropertyCell>(cell))); |
| 2589 if (Serializer::enabled()) { | 2590 Operand cell_operand = FieldOperand(ebx, JSGlobalPropertyCell::kValueOffset); |
| 2590 __ mov(ecx, Immediate(Handle<JSGlobalPropertyCell>(cell))); | |
| 2591 cell_operand = FieldOperand(ecx, JSGlobalPropertyCell::kValueOffset); | |
| 2592 } | |
| 2593 | 2591 |
| 2594 // Check that the value in the cell is not the hole. If it is, this | 2592 // Check that the value in the cell is not the hole. If it is, this |
| 2595 // cell could have been deleted and reintroducing the global needs | 2593 // cell could have been deleted and reintroducing the global needs |
| 2596 // to update the property details in the property dictionary of the | 2594 // to update the property details in the property dictionary of the |
| 2597 // global object. We bail out to the runtime system to do that. | 2595 // global object. We bail out to the runtime system to do that. |
| 2598 __ cmp(cell_operand, Factory::the_hole_value()); | 2596 __ cmp(cell_operand, Factory::the_hole_value()); |
| 2599 __ j(equal, &miss); | 2597 __ j(equal, &miss); |
| 2600 | 2598 |
| 2601 // Store the value in the cell. | 2599 // Store the value in the cell. |
| 2602 __ mov(cell_operand, eax); | 2600 __ mov(cell_operand, eax); |
| 2601 Label done; |
| 2602 __ test(eax, Immediate(kSmiTagMask)); |
| 2603 __ j(zero, &done); |
| 2604 |
| 2605 __ mov(ecx, eax); |
| 2606 __ IncrementalMarkingRecordWrite(ebx, ecx, edx); |
| 2607 |
| 2608 // Return the value (register eax). |
| 2609 __ bind(&done); |
| 2603 | 2610 |
| 2604 // Return the value (register eax). | 2611 // Return the value (register eax). |
| 2605 __ IncrementCounter(&Counters::named_store_global_inline, 1); | 2612 __ IncrementCounter(&Counters::named_store_global_inline, 1); |
| 2606 __ ret(0); | 2613 __ ret(0); |
| 2607 | 2614 |
| 2608 // Handle store cache miss. | 2615 // Handle store cache miss. |
| 2609 __ bind(&miss); | 2616 __ bind(&miss); |
| 2610 __ IncrementCounter(&Counters::named_store_global_inline_miss, 1); | 2617 __ IncrementCounter(&Counters::named_store_global_inline_miss, 1); |
| 2611 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); | 2618 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); |
| 2612 __ jmp(ic, RelocInfo::CODE_TARGET); | 2619 __ jmp(ic, RelocInfo::CODE_TARGET); |
| (...skipping 1104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3717 | 3724 |
| 3718 return GetCode(flags); | 3725 return GetCode(flags); |
| 3719 } | 3726 } |
| 3720 | 3727 |
| 3721 | 3728 |
| 3722 #undef __ | 3729 #undef __ |
| 3723 | 3730 |
| 3724 } } // namespace v8::internal | 3731 } } // namespace v8::internal |
| 3725 | 3732 |
| 3726 #endif // V8_TARGET_ARCH_IA32 | 3733 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |