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

Side by Side Diff: src/x64/lithium-x64.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/x64/lithium-x64.h ('k') | src/x64/macro-assembler-x64.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 2013 matching lines...) Expand 10 before | Expand all | Expand 10 after
2024 context = UseRegister(instr->context()); 2024 context = UseRegister(instr->context());
2025 value = UseRegister(instr->value()); 2025 value = UseRegister(instr->value());
2026 temp = NULL; 2026 temp = NULL;
2027 } 2027 }
2028 LInstruction* result = new(zone()) LStoreContextSlot(context, value, temp); 2028 LInstruction* result = new(zone()) LStoreContextSlot(context, value, temp);
2029 return instr->RequiresHoleCheck() ? AssignEnvironment(result) : result; 2029 return instr->RequiresHoleCheck() ? AssignEnvironment(result) : result;
2030 } 2030 }
2031 2031
2032 2032
2033 LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) { 2033 LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) {
2034 ASSERT(instr->representation().IsTagged());
2035 LOperand* obj = UseRegisterAtStart(instr->object()); 2034 LOperand* obj = UseRegisterAtStart(instr->object());
2036 return DefineAsRegister(new(zone()) LLoadNamedField(obj)); 2035 LOperand* temp = instr->representation().IsDouble() ? TempRegister() : NULL;
2036 ASSERT(temp == NULL || FLAG_track_double_fields);
2037 return DefineAsRegister(new(zone()) LLoadNamedField(obj, temp));
2037 } 2038 }
2038 2039
2039 2040
2040 LInstruction* LChunkBuilder::DoLoadNamedFieldPolymorphic( 2041 LInstruction* LChunkBuilder::DoLoadNamedFieldPolymorphic(
2041 HLoadNamedFieldPolymorphic* instr) { 2042 HLoadNamedFieldPolymorphic* instr) {
2042 ASSERT(instr->representation().IsTagged()); 2043 ASSERT(instr->representation().IsTagged());
2043 if (instr->need_generic()) { 2044 if (instr->need_generic()) {
2044 LOperand* obj = UseFixed(instr->object(), rax); 2045 LOperand* obj = UseFixed(instr->object(), rax);
2045 LLoadNamedFieldPolymorphic* result = 2046 LLoadNamedFieldPolymorphic* result =
2046 new(zone()) LLoadNamedFieldPolymorphic(obj); 2047 new(zone()) LLoadNamedFieldPolymorphic(obj);
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
2263 : UseTempRegister(instr->object()); 2264 : UseTempRegister(instr->object());
2264 } else { 2265 } else {
2265 obj = needs_write_barrier_for_map 2266 obj = needs_write_barrier_for_map
2266 ? UseRegister(instr->object()) 2267 ? UseRegister(instr->object())
2267 : UseRegisterAtStart(instr->object()); 2268 : UseRegisterAtStart(instr->object());
2268 } 2269 }
2269 2270
2270 LOperand* val; 2271 LOperand* val;
2271 if (needs_write_barrier) { 2272 if (needs_write_barrier) {
2272 val = UseTempRegister(instr->value()); 2273 val = UseTempRegister(instr->value());
2273 } else if (StoreConstantValueAllowed(instr->value())) { 2274 } else if (StoreConstantValueAllowed(instr->value()) &&
2275 !(FLAG_track_double_fields &&
2276 instr->field_representation().IsDouble())) {
2274 val = UseRegisterOrConstant(instr->value()); 2277 val = UseRegisterOrConstant(instr->value());
2278 } else if (FLAG_track_fields && instr->field_representation().IsSmi()) {
2279 val = UseTempRegister(instr->value());
2275 } else { 2280 } else {
2276 val = UseRegister(instr->value()); 2281 val = UseRegister(instr->value());
2277 } 2282 }
2278 2283
2279 // We only need a scratch register if we have a write barrier or we 2284 // We only need a scratch register if we have a write barrier or we
2280 // have a store into the properties array (not in-object-property). 2285 // have a store into the properties array (not in-object-property).
2281 LOperand* temp = (!instr->is_in_object() || needs_write_barrier || 2286 LOperand* temp = (!instr->is_in_object() || needs_write_barrier ||
2282 needs_write_barrier_for_map) ? TempRegister() : NULL; 2287 needs_write_barrier_for_map) ? TempRegister() : NULL;
2283 2288
2284 return new(zone()) LStoreNamedField(obj, val, temp); 2289 LStoreNamedField* result = new(zone()) LStoreNamedField(obj, val, temp);
2290 if ((FLAG_track_fields && instr->field_representation().IsSmi()) ||
2291 (FLAG_track_double_fields && instr->field_representation().IsDouble())) {
2292 return AssignEnvironment(result);
2293 }
2294 return result;
2285 } 2295 }
2286 2296
2287 2297
2288 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { 2298 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) {
2289 LOperand* object = UseFixed(instr->object(), rdx); 2299 LOperand* object = UseFixed(instr->object(), rdx);
2290 LOperand* value = UseFixed(instr->value(), rax); 2300 LOperand* value = UseFixed(instr->value(), rax);
2291 2301
2292 LStoreNamedGeneric* result = new(zone()) LStoreNamedGeneric(object, value); 2302 LStoreNamedGeneric* result = new(zone()) LStoreNamedGeneric(object, value);
2293 return MarkAsCall(result, instr); 2303 return MarkAsCall(result, instr);
2294 } 2304 }
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
2570 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2580 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2571 LOperand* object = UseRegister(instr->object()); 2581 LOperand* object = UseRegister(instr->object());
2572 LOperand* index = UseTempRegister(instr->index()); 2582 LOperand* index = UseTempRegister(instr->index());
2573 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2583 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2574 } 2584 }
2575 2585
2576 2586
2577 } } // namespace v8::internal 2587 } } // namespace v8::internal
2578 2588
2579 #endif // V8_TARGET_ARCH_X64 2589 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/lithium-x64.h ('k') | src/x64/macro-assembler-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698