OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 2110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2121 ASSERT(!needs_write_barrier_for_map); | 2121 ASSERT(!needs_write_barrier_for_map); |
2122 obj = UseRegisterOrConstant(instr->object()); | 2122 obj = UseRegisterOrConstant(instr->object()); |
2123 } else { | 2123 } else { |
2124 obj = needs_write_barrier_for_map | 2124 obj = needs_write_barrier_for_map |
2125 ? UseRegister(instr->object()) | 2125 ? UseRegister(instr->object()) |
2126 : UseRegisterAtStart(instr->object()); | 2126 : UseRegisterAtStart(instr->object()); |
2127 } | 2127 } |
2128 | 2128 |
2129 bool can_be_constant = instr->value()->IsConstant() && | 2129 bool can_be_constant = instr->value()->IsConstant() && |
2130 HConstant::cast(instr->value())->NotInNewSpace() && | 2130 HConstant::cast(instr->value())->NotInNewSpace() && |
2131 !(FLAG_track_double_fields && instr->field_representation().IsDouble()); | 2131 !instr->field_representation().IsDouble(); |
2132 | 2132 |
2133 LOperand* val; | 2133 LOperand* val; |
2134 if (needs_write_barrier) { | 2134 if (needs_write_barrier) { |
2135 val = UseTempRegister(instr->value()); | 2135 val = UseTempRegister(instr->value()); |
2136 } else if (is_external_location) { | 2136 } else if (is_external_location) { |
2137 val = UseFixed(instr->value(), rax); | 2137 val = UseFixed(instr->value(), rax); |
2138 } else if (can_be_constant) { | 2138 } else if (can_be_constant) { |
2139 val = UseRegisterOrConstant(instr->value()); | 2139 val = UseRegisterOrConstant(instr->value()); |
2140 } else if (FLAG_track_fields && instr->field_representation().IsSmi()) { | 2140 } else if (instr->field_representation().IsSmi()) { |
2141 val = UseRegister(instr->value()); | 2141 val = UseRegister(instr->value()); |
2142 } else if (FLAG_track_double_fields && | 2142 } else if (instr->field_representation().IsDouble()) { |
2143 instr->field_representation().IsDouble()) { | |
2144 val = UseRegisterAtStart(instr->value()); | 2143 val = UseRegisterAtStart(instr->value()); |
2145 } else { | 2144 } else { |
2146 val = UseRegister(instr->value()); | 2145 val = UseRegister(instr->value()); |
2147 } | 2146 } |
2148 | 2147 |
2149 // We only need a scratch register if we have a write barrier or we | 2148 // We only need a scratch register if we have a write barrier or we |
2150 // have a store into the properties array (not in-object-property). | 2149 // have a store into the properties array (not in-object-property). |
2151 LOperand* temp = (!is_in_object || needs_write_barrier || | 2150 LOperand* temp = (!is_in_object || needs_write_barrier || |
2152 needs_write_barrier_for_map) ? TempRegister() : NULL; | 2151 needs_write_barrier_for_map) ? TempRegister() : NULL; |
2153 | 2152 |
2154 LStoreNamedField* result = new(zone()) LStoreNamedField(obj, val, temp); | 2153 LStoreNamedField* result = new(zone()) LStoreNamedField(obj, val, temp); |
2155 if (FLAG_track_heap_object_fields && | 2154 if (instr->field_representation().IsHeapObject()) { |
2156 instr->field_representation().IsHeapObject()) { | |
2157 if (!instr->value()->type().IsHeapObject()) { | 2155 if (!instr->value()->type().IsHeapObject()) { |
2158 return AssignEnvironment(result); | 2156 return AssignEnvironment(result); |
2159 } | 2157 } |
2160 } | 2158 } |
2161 return result; | 2159 return result; |
2162 } | 2160 } |
2163 | 2161 |
2164 | 2162 |
2165 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { | 2163 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { |
2166 LOperand* context = UseFixed(instr->context(), rsi); | 2164 LOperand* context = UseFixed(instr->context(), rsi); |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2436 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2434 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2437 LOperand* object = UseRegister(instr->object()); | 2435 LOperand* object = UseRegister(instr->object()); |
2438 LOperand* index = UseTempRegister(instr->index()); | 2436 LOperand* index = UseTempRegister(instr->index()); |
2439 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2437 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
2440 } | 2438 } |
2441 | 2439 |
2442 | 2440 |
2443 } } // namespace v8::internal | 2441 } } // namespace v8::internal |
2444 | 2442 |
2445 #endif // V8_TARGET_ARCH_X64 | 2443 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |