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 4781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4792 } | 4792 } |
4793 return; | 4793 return; |
4794 } | 4794 } |
4795 target.TakeValue(NOT_INSIDE_TYPEOF); | 4795 target.TakeValue(NOT_INSIDE_TYPEOF); |
4796 | 4796 |
4797 DeferredCountOperation* deferred = | 4797 DeferredCountOperation* deferred = |
4798 new DeferredCountOperation(this, is_postfix, is_increment, | 4798 new DeferredCountOperation(this, is_postfix, is_increment, |
4799 target.size() * kPointerSize); | 4799 target.size() * kPointerSize); |
4800 | 4800 |
4801 Result value = frame_->Pop(); | 4801 Result value = frame_->Pop(); |
| 4802 value.ToRegister(); |
| 4803 ASSERT(value.is_valid()); |
4802 | 4804 |
4803 // Postfix: Store the old value as the result. | 4805 // Postfix: Store the old value as the result. |
4804 if (is_postfix) { | 4806 if (is_postfix) { |
4805 if (value.is_register()) { | 4807 Result old_value = value; |
4806 Result old_value = allocator_->Allocate(); | 4808 frame_->SetElementAt(target.size(), &old_value); |
4807 ASSERT(old_value.is_valid()); | |
4808 __ mov(old_value.reg(), value.reg()); | |
4809 frame_->SetElementAt(target.size(), &old_value); | |
4810 } else { | |
4811 ASSERT(value.is_constant()); | |
4812 Result old_value = value; | |
4813 frame_->SetElementAt(target.size(), &old_value); | |
4814 } | |
4815 } | 4809 } |
4816 | 4810 |
4817 // Perform optimistic increment/decrement. Ensure the value is | 4811 // Perform optimistic increment/decrement. Ensure the value is |
4818 // writable. | 4812 // writable. |
4819 value.ToRegister(); | |
4820 ASSERT(value.is_valid()); | |
4821 frame_->Spill(value.reg()); | 4813 frame_->Spill(value.reg()); |
4822 ASSERT(allocator_->count(value.reg()) == 1); | 4814 ASSERT(allocator_->count(value.reg()) == 1); |
4823 | 4815 |
4824 // In order to combine the overflow and the smi check, we need to | 4816 // In order to combine the overflow and the smi check, we need to |
4825 // be able to allocate a byte register. We attempt to do so | 4817 // be able to allocate a byte register. We attempt to do so |
4826 // without spilling. If we fail, we will generate separate | 4818 // without spilling. If we fail, we will generate separate |
4827 // overflow and smi checks. | 4819 // overflow and smi checks. |
4828 // | 4820 // |
4829 // We need to allocate and clear the temporary byte register | 4821 // We need to allocate and clear the temporary byte register |
4830 // before performing the count operation since clearing the | 4822 // before performing the count operation since clearing the |
(...skipping 2250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7081 | 7073 |
7082 // Slow-case: Go through the JavaScript implementation. | 7074 // Slow-case: Go through the JavaScript implementation. |
7083 __ bind(&slow); | 7075 __ bind(&slow); |
7084 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); | 7076 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); |
7085 } | 7077 } |
7086 | 7078 |
7087 | 7079 |
7088 #undef __ | 7080 #undef __ |
7089 | 7081 |
7090 } } // namespace v8::internal | 7082 } } // namespace v8::internal |
OLD | NEW |