| 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 2017 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2028 } | 2028 } |
| 2029 | 2029 |
| 2030 | 2030 |
| 2031 void LCodeGen::DoLoadKeyedFastElement(LLoadKeyedFastElement* instr) { | 2031 void LCodeGen::DoLoadKeyedFastElement(LLoadKeyedFastElement* instr) { |
| 2032 Register elements = ToRegister(instr->elements()); | 2032 Register elements = ToRegister(instr->elements()); |
| 2033 Register key = ToRegister(instr->key()); | 2033 Register key = ToRegister(instr->key()); |
| 2034 Register result = ToRegister(instr->result()); | 2034 Register result = ToRegister(instr->result()); |
| 2035 ASSERT(result.is(elements)); | 2035 ASSERT(result.is(elements)); |
| 2036 | 2036 |
| 2037 // Load the result. | 2037 // Load the result. |
| 2038 __ mov(result, FieldOperand(elements, key, times_4, FixedArray::kHeaderSize)); | 2038 __ mov(result, FieldOperand(elements, |
| 2039 key, |
| 2040 times_pointer_size, |
| 2041 FixedArray::kHeaderSize)); |
| 2039 | 2042 |
| 2040 // Check for the hole value. | 2043 // Check for the hole value. |
| 2041 __ cmp(result, Factory::the_hole_value()); | 2044 __ cmp(result, Factory::the_hole_value()); |
| 2042 DeoptimizeIf(equal, instr->environment()); | 2045 DeoptimizeIf(equal, instr->environment()); |
| 2043 } | 2046 } |
| 2044 | 2047 |
| 2045 | 2048 |
| 2046 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { | 2049 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { |
| 2047 ASSERT(ToRegister(instr->object()).is(edx)); | 2050 ASSERT(ToRegister(instr->object()).is(edx)); |
| 2048 ASSERT(ToRegister(instr->key()).is(eax)); | 2051 ASSERT(ToRegister(instr->key()).is(eax)); |
| (...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2654 Register key = instr->key()->IsRegister() ? ToRegister(instr->key()) : no_reg; | 2657 Register key = instr->key()->IsRegister() ? ToRegister(instr->key()) : no_reg; |
| 2655 | 2658 |
| 2656 // Do the store. | 2659 // Do the store. |
| 2657 if (instr->key()->IsConstantOperand()) { | 2660 if (instr->key()->IsConstantOperand()) { |
| 2658 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); | 2661 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); |
| 2659 LConstantOperand* const_operand = LConstantOperand::cast(instr->key()); | 2662 LConstantOperand* const_operand = LConstantOperand::cast(instr->key()); |
| 2660 int offset = | 2663 int offset = |
| 2661 ToInteger32(const_operand) * kPointerSize + FixedArray::kHeaderSize; | 2664 ToInteger32(const_operand) * kPointerSize + FixedArray::kHeaderSize; |
| 2662 __ mov(FieldOperand(elements, offset), value); | 2665 __ mov(FieldOperand(elements, offset), value); |
| 2663 } else { | 2666 } else { |
| 2664 __ mov(FieldOperand(elements, key, times_4, FixedArray::kHeaderSize), | 2667 __ mov(FieldOperand(elements, |
| 2668 key, |
| 2669 times_pointer_size, |
| 2670 FixedArray::kHeaderSize), |
| 2665 value); | 2671 value); |
| 2666 } | 2672 } |
| 2667 | 2673 |
| 2668 if (instr->hydrogen()->NeedsWriteBarrier()) { | 2674 if (instr->hydrogen()->NeedsWriteBarrier()) { |
| 2669 // Compute address of modified element and store it into key register. | 2675 // Compute address of modified element and store it into key register. |
| 2670 __ lea(key, FieldOperand(elements, key, times_4, FixedArray::kHeaderSize)); | 2676 __ lea(key, |
| 2677 FieldOperand(elements, |
| 2678 key, |
| 2679 times_pointer_size, |
| 2680 FixedArray::kHeaderSize)); |
| 2671 __ RecordWrite(elements, key, value); | 2681 __ RecordWrite(elements, key, value); |
| 2672 } | 2682 } |
| 2673 } | 2683 } |
| 2674 | 2684 |
| 2675 | 2685 |
| 2676 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { | 2686 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { |
| 2677 ASSERT(ToRegister(instr->object()).is(edx)); | 2687 ASSERT(ToRegister(instr->object()).is(edx)); |
| 2678 ASSERT(ToRegister(instr->key()).is(ecx)); | 2688 ASSERT(ToRegister(instr->key()).is(ecx)); |
| 2679 ASSERT(ToRegister(instr->value()).is(eax)); | 2689 ASSERT(ToRegister(instr->value()).is(eax)); |
| 2680 | 2690 |
| (...skipping 956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3637 ASSERT(osr_pc_offset_ == -1); | 3647 ASSERT(osr_pc_offset_ == -1); |
| 3638 osr_pc_offset_ = masm()->pc_offset(); | 3648 osr_pc_offset_ = masm()->pc_offset(); |
| 3639 } | 3649 } |
| 3640 | 3650 |
| 3641 | 3651 |
| 3642 #undef __ | 3652 #undef __ |
| 3643 | 3653 |
| 3644 } } // namespace v8::internal | 3654 } } // namespace v8::internal |
| 3645 | 3655 |
| 3646 #endif // V8_TARGET_ARCH_IA32 | 3656 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |