Chromium Code Reviews| 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 2015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2026 __ mov(result, Operand::Cell(instr->hydrogen()->cell())); | 2026 __ mov(result, Operand::Cell(instr->hydrogen()->cell())); |
| 2027 if (instr->hydrogen()->check_hole_value()) { | 2027 if (instr->hydrogen()->check_hole_value()) { |
| 2028 __ cmp(result, Factory::the_hole_value()); | 2028 __ cmp(result, Factory::the_hole_value()); |
| 2029 DeoptimizeIf(equal, instr->environment()); | 2029 DeoptimizeIf(equal, instr->environment()); |
| 2030 } | 2030 } |
| 2031 } | 2031 } |
| 2032 | 2032 |
| 2033 | 2033 |
| 2034 void LCodeGen::DoStoreGlobal(LStoreGlobal* instr) { | 2034 void LCodeGen::DoStoreGlobal(LStoreGlobal* instr) { |
| 2035 Register object = ToRegister(instr->temp1()); | 2035 Register object = ToRegister(instr->temp1()); |
| 2036 Register scratch = ToRegister(instr->temp2()); | 2036 Register address = ToRegister(instr->temp2()); |
| 2037 Register value = ToRegister(instr->InputAt(0)); | 2037 Register value = ToRegister(instr->InputAt(0)); |
| 2038 Handle<JSGlobalPropertyCell> cell_handle(instr->hydrogen()->cell()); | 2038 Handle<JSGlobalPropertyCell> cell_handle(instr->hydrogen()->cell()); |
| 2039 | 2039 |
| 2040 // If the cell we are storing to contains the hole it could have | 2040 // If the cell we are storing to contains the hole it could have |
| 2041 // been deleted from the property dictionary. In that case, we need | 2041 // been deleted from the property dictionary. In that case, we need |
| 2042 // to update the property details in the property dictionary to mark | 2042 // to update the property details in the property dictionary to mark |
| 2043 // it as no longer deleted. We deoptimize in that case. | 2043 // it as no longer deleted. We deoptimize in that case. |
| 2044 if (instr->hydrogen()->check_hole_value()) { | 2044 if (instr->hydrogen()->check_hole_value()) { |
| 2045 __ cmp(Operand::Cell(cell_handle), Factory::the_hole_value()); | 2045 __ cmp(Operand::Cell(cell_handle), Factory::the_hole_value()); |
| 2046 DeoptimizeIf(equal, instr->environment()); | 2046 DeoptimizeIf(equal, instr->environment()); |
| 2047 } | 2047 } |
| 2048 | 2048 |
| 2049 // Store the value. | 2049 // Store the value. |
| 2050 __ mov(object, Immediate(cell_handle)); | 2050 __ mov(object, Immediate(cell_handle)); |
| 2051 __ mov(FieldOperand(object, JSGlobalPropertyCell::kValueOffset), value); | 2051 __ lea(address, FieldOperand(object, JSGlobalPropertyCell::kValueOffset)); |
| 2052 __ mov(Operand(address, 0), value); | |
| 2052 | 2053 |
| 2053 __ IncrementalMarkingRecordWrite(object, | 2054 |
| 2054 value, | 2055 // Cells are always in the remembered set. |
| 2055 scratch, | 2056 __ RecordWrite(object, address, value, OMIT_REMEMBERED_SET, kSaveFPRegs); |
|
Vyacheslav Egorov (Chromium)
2011/04/06 11:46:40
mixing two constant naming styles in a single call
Erik Corry
2011/04/06 12:31:28
Yes. Postponed.
| |
| 2056 INLINE_SMI_CHECK, | |
| 2057 DESTROY_OBJECT, | |
| 2058 DESTROY_VALUE, | |
| 2059 DESTROY_SCRATCH); | |
| 2060 } | 2057 } |
| 2061 | 2058 |
| 2062 | 2059 |
| 2063 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 2060 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
| 2064 Register context = ToRegister(instr->context()); | 2061 Register context = ToRegister(instr->context()); |
| 2065 Register result = ToRegister(instr->result()); | 2062 Register result = ToRegister(instr->result()); |
| 2066 __ mov(result, ContextOperand(context, instr->slot_index())); | 2063 __ mov(result, ContextOperand(context, instr->slot_index())); |
| 2067 } | 2064 } |
| 2068 | 2065 |
| 2069 | 2066 |
| (...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2871 value); | 2868 value); |
| 2872 } | 2869 } |
| 2873 | 2870 |
| 2874 if (instr->hydrogen()->NeedsWriteBarrier()) { | 2871 if (instr->hydrogen()->NeedsWriteBarrier()) { |
| 2875 // Compute address of modified element and store it into key register. | 2872 // Compute address of modified element and store it into key register. |
| 2876 __ lea(key, | 2873 __ lea(key, |
| 2877 FieldOperand(elements, | 2874 FieldOperand(elements, |
| 2878 key, | 2875 key, |
| 2879 times_pointer_size, | 2876 times_pointer_size, |
| 2880 FixedArray::kHeaderSize)); | 2877 FixedArray::kHeaderSize)); |
| 2881 __ RecordWrite(elements, key, value, kSaveFPRegs); | 2878 __ RecordWrite(elements, key, value, EMIT_REMEMBERED_SET, kSaveFPRegs); |
| 2882 } | 2879 } |
| 2883 } | 2880 } |
| 2884 | 2881 |
| 2885 | 2882 |
| 2886 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { | 2883 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { |
| 2887 ASSERT(ToRegister(instr->context()).is(esi)); | 2884 ASSERT(ToRegister(instr->context()).is(esi)); |
| 2888 ASSERT(ToRegister(instr->object()).is(edx)); | 2885 ASSERT(ToRegister(instr->object()).is(edx)); |
| 2889 ASSERT(ToRegister(instr->key()).is(ecx)); | 2886 ASSERT(ToRegister(instr->key()).is(ecx)); |
| 2890 ASSERT(ToRegister(instr->value()).is(eax)); | 2887 ASSERT(ToRegister(instr->value()).is(eax)); |
| 2891 | 2888 |
| (...skipping 1057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3949 ASSERT(osr_pc_offset_ == -1); | 3946 ASSERT(osr_pc_offset_ == -1); |
| 3950 osr_pc_offset_ = masm()->pc_offset(); | 3947 osr_pc_offset_ = masm()->pc_offset(); |
| 3951 } | 3948 } |
| 3952 | 3949 |
| 3953 | 3950 |
| 3954 #undef __ | 3951 #undef __ |
| 3955 | 3952 |
| 3956 } } // namespace v8::internal | 3953 } } // namespace v8::internal |
| 3957 | 3954 |
| 3958 #endif // V8_TARGET_ARCH_IA32 | 3955 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |