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

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

Issue 15881003: Remove offset() and is_in_object() from hydrogen and lithium LoadNamedField and StoreNamedField and… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/ia32/lithium-ia32.h ('k') | src/mips/lithium-codegen-mips.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 // 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 2422 matching lines...) Expand 10 before | Expand all | Expand 10 after
2433 HTrapAllocationMemento* instr) { 2433 HTrapAllocationMemento* instr) {
2434 LOperand* object = UseRegister(instr->object()); 2434 LOperand* object = UseRegister(instr->object());
2435 LOperand* temp = TempRegister(); 2435 LOperand* temp = TempRegister();
2436 LTrapAllocationMemento* result = 2436 LTrapAllocationMemento* result =
2437 new(zone()) LTrapAllocationMemento(object, temp); 2437 new(zone()) LTrapAllocationMemento(object, temp);
2438 return AssignEnvironment(result); 2438 return AssignEnvironment(result);
2439 } 2439 }
2440 2440
2441 2441
2442 LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) { 2442 LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) {
2443 bool is_in_object = instr->access().IsInobject();
2443 bool needs_write_barrier = instr->NeedsWriteBarrier(); 2444 bool needs_write_barrier = instr->NeedsWriteBarrier();
2444 bool needs_write_barrier_for_map = !instr->transition().is_null() && 2445 bool needs_write_barrier_for_map = !instr->transition().is_null() &&
2445 instr->NeedsWriteBarrierForMap(); 2446 instr->NeedsWriteBarrierForMap();
2446 2447
2447 LOperand* obj; 2448 LOperand* obj;
2448 if (needs_write_barrier) { 2449 if (needs_write_barrier) {
2449 obj = instr->is_in_object() 2450 obj = is_in_object
2450 ? UseRegister(instr->object()) 2451 ? UseRegister(instr->object())
2451 : UseTempRegister(instr->object()); 2452 : UseTempRegister(instr->object());
2452 } else { 2453 } else {
2453 obj = needs_write_barrier_for_map 2454 obj = needs_write_barrier_for_map
2454 ? UseRegister(instr->object()) 2455 ? UseRegister(instr->object())
2455 : UseRegisterAtStart(instr->object()); 2456 : UseRegisterAtStart(instr->object());
2456 } 2457 }
2457 2458
2458 bool can_be_constant = instr->value()->IsConstant() && 2459 bool can_be_constant = instr->value()->IsConstant() &&
2459 HConstant::cast(instr->value())->NotInNewSpace() && 2460 HConstant::cast(instr->value())->NotInNewSpace() &&
(...skipping 12 matching lines...) Expand all
2472 val = UseRegisterAtStart(instr->value()); 2473 val = UseRegisterAtStart(instr->value());
2473 } else { 2474 } else {
2474 val = UseX87TopOfStack(instr->value()); 2475 val = UseX87TopOfStack(instr->value());
2475 } 2476 }
2476 } else { 2477 } else {
2477 val = UseRegister(instr->value()); 2478 val = UseRegister(instr->value());
2478 } 2479 }
2479 2480
2480 // We only need a scratch register if we have a write barrier or we 2481 // We only need a scratch register if we have a write barrier or we
2481 // have a store into the properties array (not in-object-property). 2482 // have a store into the properties array (not in-object-property).
2482 LOperand* temp = (!instr->is_in_object() || needs_write_barrier || 2483 LOperand* temp = (!is_in_object || needs_write_barrier ||
2483 needs_write_barrier_for_map) ? TempRegister() : NULL; 2484 needs_write_barrier_for_map) ? TempRegister() : NULL;
2484 2485
2485 // We need a temporary register for write barrier of the map field. 2486 // We need a temporary register for write barrier of the map field.
2486 LOperand* temp_map = needs_write_barrier_for_map ? TempRegister() : NULL; 2487 LOperand* temp_map = needs_write_barrier_for_map ? TempRegister() : NULL;
2487 2488
2488 LStoreNamedField* result = 2489 LStoreNamedField* result =
2489 new(zone()) LStoreNamedField(obj, val, temp, temp_map); 2490 new(zone()) LStoreNamedField(obj, val, temp, temp_map);
2490 if ((FLAG_track_fields && instr->field_representation().IsSmi()) || 2491 if ((FLAG_track_fields && instr->field_representation().IsSmi()) ||
2491 (FLAG_track_heap_object_fields && 2492 (FLAG_track_heap_object_fields &&
2492 instr->field_representation().IsHeapObject())) { 2493 instr->field_representation().IsHeapObject())) {
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
2798 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2799 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2799 LOperand* object = UseRegister(instr->object()); 2800 LOperand* object = UseRegister(instr->object());
2800 LOperand* index = UseTempRegister(instr->index()); 2801 LOperand* index = UseTempRegister(instr->index());
2801 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2802 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2802 } 2803 }
2803 2804
2804 2805
2805 } } // namespace v8::internal 2806 } } // namespace v8::internal
2806 2807
2807 #endif // V8_TARGET_ARCH_IA32 2808 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/lithium-ia32.h ('k') | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698