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 2102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2113 obj = is_in_object | 2113 obj = is_in_object |
2114 ? UseRegister(instr->object()) | 2114 ? UseRegister(instr->object()) |
2115 : UseTempRegister(instr->object()); | 2115 : UseTempRegister(instr->object()); |
2116 } else { | 2116 } else { |
2117 obj = needs_write_barrier_for_map | 2117 obj = needs_write_barrier_for_map |
2118 ? UseRegister(instr->object()) | 2118 ? UseRegister(instr->object()) |
2119 : UseRegisterAtStart(instr->object()); | 2119 : UseRegisterAtStart(instr->object()); |
2120 } | 2120 } |
2121 | 2121 |
2122 LOperand* val; | 2122 LOperand* val; |
2123 if (needs_write_barrier || | 2123 if (needs_write_barrier || instr->field_representation().IsSmi()) { |
2124 (FLAG_track_fields && instr->field_representation().IsSmi())) { | |
2125 val = UseTempRegister(instr->value()); | 2124 val = UseTempRegister(instr->value()); |
2126 } else if (FLAG_track_double_fields && | 2125 } else if (instr->field_representation().IsDouble()) { |
2127 instr->field_representation().IsDouble()) { | |
2128 val = UseRegisterAtStart(instr->value()); | 2126 val = UseRegisterAtStart(instr->value()); |
2129 } else { | 2127 } else { |
2130 val = UseRegister(instr->value()); | 2128 val = UseRegister(instr->value()); |
2131 } | 2129 } |
2132 | 2130 |
2133 // We need a temporary register for write barrier of the map field. | 2131 // We need a temporary register for write barrier of the map field. |
2134 LOperand* temp = needs_write_barrier_for_map ? TempRegister() : NULL; | 2132 LOperand* temp = needs_write_barrier_for_map ? TempRegister() : NULL; |
2135 | 2133 |
2136 LStoreNamedField* result = new(zone()) LStoreNamedField(obj, val, temp); | 2134 LStoreNamedField* result = new(zone()) LStoreNamedField(obj, val, temp); |
2137 if (FLAG_track_heap_object_fields && | 2135 if (instr->field_representation().IsHeapObject()) { |
2138 instr->field_representation().IsHeapObject()) { | |
2139 if (!instr->value()->type().IsHeapObject()) { | 2136 if (!instr->value()->type().IsHeapObject()) { |
2140 return AssignEnvironment(result); | 2137 return AssignEnvironment(result); |
2141 } | 2138 } |
2142 } | 2139 } |
2143 return result; | 2140 return result; |
2144 } | 2141 } |
2145 | 2142 |
2146 | 2143 |
2147 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { | 2144 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { |
2148 LOperand* context = UseFixed(instr->context(), cp); | 2145 LOperand* context = UseFixed(instr->context(), cp); |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2406 | 2403 |
2407 | 2404 |
2408 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2405 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2409 LOperand* object = UseRegister(instr->object()); | 2406 LOperand* object = UseRegister(instr->object()); |
2410 LOperand* index = UseRegister(instr->index()); | 2407 LOperand* index = UseRegister(instr->index()); |
2411 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2408 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
2412 } | 2409 } |
2413 | 2410 |
2414 | 2411 |
2415 } } // namespace v8::internal | 2412 } } // namespace v8::internal |
OLD | NEW |