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

Side by Side Diff: src/arm/lithium-arm.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, 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/arm/lithium-arm.h ('k') | src/arm/lithium-codegen-arm.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 2096 matching lines...) Expand 10 before | Expand all | Expand 10 after
2107 } else { 2107 } else {
2108 context = UseRegister(instr->context()); 2108 context = UseRegister(instr->context());
2109 value = UseRegister(instr->value()); 2109 value = UseRegister(instr->value());
2110 } 2110 }
2111 LInstruction* result = new(zone()) LStoreContextSlot(context, value); 2111 LInstruction* result = new(zone()) LStoreContextSlot(context, value);
2112 return instr->RequiresHoleCheck() ? AssignEnvironment(result) : result; 2112 return instr->RequiresHoleCheck() ? AssignEnvironment(result) : result;
2113 } 2113 }
2114 2114
2115 2115
2116 LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) { 2116 LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) {
2117 return DefineAsRegister( 2117 LOperand* obj = UseRegisterAtStart(instr->object());
2118 new(zone()) LLoadNamedField(UseRegisterAtStart(instr->object()))); 2118 LOperand* temp = instr->representation().IsDouble() ? TempRegister() : NULL;
2119 ASSERT(temp == NULL || FLAG_track_double_fields);
2120 return DefineAsRegister(new(zone()) LLoadNamedField(obj, temp));
2119 } 2121 }
2120 2122
2121 2123
2122 LInstruction* LChunkBuilder::DoLoadNamedFieldPolymorphic( 2124 LInstruction* LChunkBuilder::DoLoadNamedFieldPolymorphic(
2123 HLoadNamedFieldPolymorphic* instr) { 2125 HLoadNamedFieldPolymorphic* instr) {
2124 ASSERT(instr->representation().IsTagged()); 2126 ASSERT(instr->representation().IsTagged());
2125 if (instr->need_generic()) { 2127 if (instr->need_generic()) {
2126 LOperand* obj = UseFixed(instr->object(), r0); 2128 LOperand* obj = UseFixed(instr->object(), r0);
2127 LLoadNamedFieldPolymorphic* result = 2129 LLoadNamedFieldPolymorphic* result =
2128 new(zone()) LLoadNamedFieldPolymorphic(obj); 2130 new(zone()) LLoadNamedFieldPolymorphic(obj);
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
2312 if (needs_write_barrier) { 2314 if (needs_write_barrier) {
2313 obj = instr->is_in_object() 2315 obj = instr->is_in_object()
2314 ? UseRegister(instr->object()) 2316 ? UseRegister(instr->object())
2315 : UseTempRegister(instr->object()); 2317 : UseTempRegister(instr->object());
2316 } else { 2318 } else {
2317 obj = needs_write_barrier_for_map 2319 obj = needs_write_barrier_for_map
2318 ? UseRegister(instr->object()) 2320 ? UseRegister(instr->object())
2319 : UseRegisterAtStart(instr->object()); 2321 : UseRegisterAtStart(instr->object());
2320 } 2322 }
2321 2323
2322 LOperand* val = needs_write_barrier 2324 LOperand* val =
2323 ? UseTempRegister(instr->value()) 2325 needs_write_barrier ||
2324 : UseRegister(instr->value()); 2326 (FLAG_track_fields && instr->field_representation().IsSmi())
2327 ? UseTempRegister(instr->value()) : UseRegister(instr->value());
2325 2328
2326 // We need a temporary register for write barrier of the map field. 2329 // We need a temporary register for write barrier of the map field.
2327 LOperand* temp = needs_write_barrier_for_map ? TempRegister() : NULL; 2330 LOperand* temp = needs_write_barrier_for_map ? TempRegister() : NULL;
2328 2331
2329 return new(zone()) LStoreNamedField(obj, val, temp); 2332 LStoreNamedField* result = new(zone()) LStoreNamedField(obj, val, temp);
2333 if ((FLAG_track_fields && instr->field_representation().IsSmi()) ||
2334 (FLAG_track_double_fields && instr->field_representation().IsDouble())) {
2335 return AssignEnvironment(result);
2336 }
2337 return result;
2330 } 2338 }
2331 2339
2332 2340
2333 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { 2341 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) {
2334 LOperand* obj = UseFixed(instr->object(), r1); 2342 LOperand* obj = UseFixed(instr->object(), r1);
2335 LOperand* val = UseFixed(instr->value(), r0); 2343 LOperand* val = UseFixed(instr->value(), r0);
2336 2344
2337 LInstruction* result = new(zone()) LStoreNamedGeneric(obj, val); 2345 LInstruction* result = new(zone()) LStoreNamedGeneric(obj, val);
2338 return MarkAsCall(result, instr); 2346 return MarkAsCall(result, instr);
2339 } 2347 }
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
2613 2621
2614 2622
2615 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2623 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2616 LOperand* object = UseRegister(instr->object()); 2624 LOperand* object = UseRegister(instr->object());
2617 LOperand* index = UseRegister(instr->index()); 2625 LOperand* index = UseRegister(instr->index());
2618 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); 2626 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index));
2619 } 2627 }
2620 2628
2621 2629
2622 } } // namespace v8::internal 2630 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-arm.h ('k') | src/arm/lithium-codegen-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698