Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1067)

Side by Side Diff: src/arm/lithium-arm.cc

Issue 295743002: Refactor transitioning stores. (Closed) Base URL: git@github.com:v8/v8.git@master
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/arm/lithium-arm.h ('k') | src/arm/lithium-codegen-arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "v8.h" 5 #include "v8.h"
6 6
7 #include "lithium-allocator-inl.h" 7 #include "lithium-allocator-inl.h"
8 #include "arm/lithium-arm.h" 8 #include "arm/lithium-arm.h"
9 #include "arm/lithium-codegen-arm.h" 9 #include "arm/lithium-codegen-arm.h"
10 #include "hydrogen-osr.h" 10 #include "hydrogen-osr.h"
(...skipping 2261 matching lines...) Expand 10 before | Expand all | Expand 10 after
2272 LOperand* temp = TempRegister(); 2272 LOperand* temp = TempRegister();
2273 LTrapAllocationMemento* result = 2273 LTrapAllocationMemento* result =
2274 new(zone()) LTrapAllocationMemento(object, temp); 2274 new(zone()) LTrapAllocationMemento(object, temp);
2275 return AssignEnvironment(result); 2275 return AssignEnvironment(result);
2276 } 2276 }
2277 2277
2278 2278
2279 LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) { 2279 LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) {
2280 bool is_in_object = instr->access().IsInobject(); 2280 bool is_in_object = instr->access().IsInobject();
2281 bool needs_write_barrier = instr->NeedsWriteBarrier(); 2281 bool needs_write_barrier = instr->NeedsWriteBarrier();
2282 bool needs_write_barrier_for_map = instr->has_transition() &&
2283 instr->NeedsWriteBarrierForMap();
2284 2282
2285 LOperand* obj; 2283 LOperand* obj;
2286 if (needs_write_barrier) { 2284 if (needs_write_barrier) {
2287 obj = is_in_object 2285 obj = is_in_object
2288 ? UseRegister(instr->object()) 2286 ? UseRegister(instr->object())
2289 : UseTempRegister(instr->object()); 2287 : UseTempRegister(instr->object());
2290 } else { 2288 } else {
2291 obj = needs_write_barrier_for_map 2289 obj = UseRegisterAtStart(instr->object());
2292 ? UseRegister(instr->object())
2293 : UseRegisterAtStart(instr->object());
2294 } 2290 }
2295 2291
2296 LOperand* val; 2292 LOperand* val;
2297 if (needs_write_barrier || instr->field_representation().IsSmi()) { 2293 if (needs_write_barrier || instr->field_representation().IsSmi()) {
2298 val = UseTempRegister(instr->value()); 2294 val = UseTempRegister(instr->value());
2299 } else if (instr->field_representation().IsDouble()) { 2295 } else if (instr->field_representation().IsDouble()) {
2300 val = UseRegisterAtStart(instr->value()); 2296 val = UseRegisterAtStart(instr->value());
2301 } else { 2297 } else {
2302 val = UseRegister(instr->value()); 2298 val = UseRegister(instr->value());
2303 } 2299 }
2304 2300
2305 // We need a temporary register for write barrier of the map field. 2301 LInstruction* result = new(zone()) LStoreNamedField(obj, val);
2306 LOperand* temp = needs_write_barrier_for_map ? TempRegister() : NULL;
2307
2308 LInstruction* result = new(zone()) LStoreNamedField(obj, val, temp);
2309 if (!instr->access().IsExternalMemory() && 2302 if (!instr->access().IsExternalMemory() &&
2310 instr->field_representation().IsHeapObject() && 2303 instr->field_representation().IsHeapObject() &&
2311 !instr->value()->type().IsHeapObject()) { 2304 !instr->value()->type().IsHeapObject()) {
2312 result = AssignEnvironment(result); 2305 result = AssignEnvironment(result);
2313 } 2306 }
2314 return result; 2307 return result;
2315 } 2308 }
2316 2309
2317 2310
2318 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { 2311 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) {
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
2564 2557
2565 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2558 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2566 LOperand* object = UseRegister(instr->object()); 2559 LOperand* object = UseRegister(instr->object());
2567 LOperand* index = UseTempRegister(instr->index()); 2560 LOperand* index = UseTempRegister(instr->index());
2568 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); 2561 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index);
2569 LInstruction* result = DefineSameAsFirst(load); 2562 LInstruction* result = DefineSameAsFirst(load);
2570 return AssignPointerMap(result); 2563 return AssignPointerMap(result);
2571 } 2564 }
2572 2565
2573 } } // namespace v8::internal 2566 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-arm.h ('k') | src/arm/lithium-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698