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

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

Issue 14146005: Track representations of fields (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add test for tracking fields Created 7 years, 8 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/ia32/macro-assembler-ia32.h » ('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 2148 matching lines...) Expand 10 before | Expand all | Expand 10 after
2159 } else { 2159 } else {
2160 value = UseRegister(instr->value()); 2160 value = UseRegister(instr->value());
2161 temp = NULL; 2161 temp = NULL;
2162 } 2162 }
2163 LInstruction* result = new(zone()) LStoreContextSlot(context, value, temp); 2163 LInstruction* result = new(zone()) LStoreContextSlot(context, value, temp);
2164 return instr->RequiresHoleCheck() ? AssignEnvironment(result) : result; 2164 return instr->RequiresHoleCheck() ? AssignEnvironment(result) : result;
2165 } 2165 }
2166 2166
2167 2167
2168 LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) { 2168 LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) {
2169 ASSERT(instr->representation().IsTagged());
2170 LOperand* obj = UseRegisterAtStart(instr->object()); 2169 LOperand* obj = UseRegisterAtStart(instr->object());
2171 return DefineAsRegister(new(zone()) LLoadNamedField(obj)); 2170 LOperand* temp = instr->representation().IsDouble() ? TempRegister() : NULL;
2171 ASSERT(temp == NULL || FLAG_track_double_fields);
2172 return DefineAsRegister(new(zone()) LLoadNamedField(obj, temp));
2172 } 2173 }
2173 2174
2174 2175
2175 LInstruction* LChunkBuilder::DoLoadNamedFieldPolymorphic( 2176 LInstruction* LChunkBuilder::DoLoadNamedFieldPolymorphic(
2176 HLoadNamedFieldPolymorphic* instr) { 2177 HLoadNamedFieldPolymorphic* instr) {
2177 ASSERT(instr->representation().IsTagged()); 2178 ASSERT(instr->representation().IsTagged());
2178 if (instr->need_generic()) { 2179 if (instr->need_generic()) {
2179 LOperand* context = UseFixed(instr->context(), esi); 2180 LOperand* context = UseFixed(instr->context(), esi);
2180 LOperand* obj = UseFixed(instr->object(), edx); 2181 LOperand* obj = UseFixed(instr->object(), edx);
2181 LLoadNamedFieldPolymorphic* result = 2182 LLoadNamedFieldPolymorphic* result =
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
2434 : UseTempRegister(instr->object()); 2435 : UseTempRegister(instr->object());
2435 } else { 2436 } else {
2436 obj = needs_write_barrier_for_map 2437 obj = needs_write_barrier_for_map
2437 ? UseRegister(instr->object()) 2438 ? UseRegister(instr->object())
2438 : UseRegisterAtStart(instr->object()); 2439 : UseRegisterAtStart(instr->object());
2439 } 2440 }
2440 2441
2441 LOperand* val; 2442 LOperand* val;
2442 if (needs_write_barrier) { 2443 if (needs_write_barrier) {
2443 val = UseTempRegister(instr->value()); 2444 val = UseTempRegister(instr->value());
2444 } else if (StoreConstantValueAllowed(instr->value())) { 2445 } else if (StoreConstantValueAllowed(instr->value()) &&
2446 !(FLAG_track_double_fields &&
2447 instr->field_representation().IsDouble())) {
2445 val = UseRegisterOrConstant(instr->value()); 2448 val = UseRegisterOrConstant(instr->value());
2449 } else if (FLAG_track_fields && instr->field_representation().IsSmi()) {
2450 val = UseTempRegister(instr->value());
2446 } else { 2451 } else {
2447 val = UseRegister(instr->value()); 2452 val = UseRegister(instr->value());
2448 } 2453 }
2449 2454
2450 // We only need a scratch register if we have a write barrier or we 2455 // We only need a scratch register if we have a write barrier or we
2451 // have a store into the properties array (not in-object-property). 2456 // have a store into the properties array (not in-object-property).
2452 LOperand* temp = (!instr->is_in_object() || needs_write_barrier || 2457 LOperand* temp = (!instr->is_in_object() || needs_write_barrier ||
2453 needs_write_barrier_for_map) ? TempRegister() : NULL; 2458 needs_write_barrier_for_map) ? TempRegister() : NULL;
2454 2459
2455 // We need a temporary register for write barrier of the map field. 2460 // We need a temporary register for write barrier of the map field.
2456 LOperand* temp_map = needs_write_barrier_for_map ? TempRegister() : NULL; 2461 LOperand* temp_map = needs_write_barrier_for_map ? TempRegister() : NULL;
2457 2462
2458 return new(zone()) LStoreNamedField(obj, val, temp, temp_map); 2463 LStoreNamedField* result =
2464 new(zone()) LStoreNamedField(obj, val, temp, temp_map);
2465 if ((FLAG_track_fields && instr->field_representation().IsSmi()) ||
2466 (FLAG_track_double_fields && instr->field_representation().IsDouble())) {
2467 return AssignEnvironment(result);
2468 }
2469 return result;
2459 } 2470 }
2460 2471
2461 2472
2462 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { 2473 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) {
2463 LOperand* context = UseFixed(instr->context(), esi); 2474 LOperand* context = UseFixed(instr->context(), esi);
2464 LOperand* object = UseFixed(instr->object(), edx); 2475 LOperand* object = UseFixed(instr->object(), edx);
2465 LOperand* value = UseFixed(instr->value(), eax); 2476 LOperand* value = UseFixed(instr->value(), eax);
2466 2477
2467 LStoreNamedGeneric* result = 2478 LStoreNamedGeneric* result =
2468 new(zone()) LStoreNamedGeneric(context, object, value); 2479 new(zone()) LStoreNamedGeneric(context, object, value);
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
2772 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2783 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2773 LOperand* object = UseRegister(instr->object()); 2784 LOperand* object = UseRegister(instr->object());
2774 LOperand* index = UseTempRegister(instr->index()); 2785 LOperand* index = UseTempRegister(instr->index());
2775 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2786 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2776 } 2787 }
2777 2788
2778 2789
2779 } } // namespace v8::internal 2790 } } // namespace v8::internal
2780 2791
2781 #endif // V8_TARGET_ARCH_IA32 2792 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/lithium-ia32.h ('k') | src/ia32/macro-assembler-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698