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

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

Issue 214703007: MIPS: Check that environments assigned via AssignEnvironment are actually used. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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/mips/lithium-codegen-mips.cc ('k') | no next file » | 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 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 621
622 // If instruction does not have side-effects lazy deoptimization 622 // If instruction does not have side-effects lazy deoptimization
623 // after the call will try to deoptimize to the point before the call. 623 // after the call will try to deoptimize to the point before the call.
624 // Thus we still need to attach environment to this call even if 624 // Thus we still need to attach environment to this call even if
625 // call sequence can not deoptimize eagerly. 625 // call sequence can not deoptimize eagerly.
626 bool needs_environment = 626 bool needs_environment =
627 (can_deoptimize == CAN_DEOPTIMIZE_EAGERLY) || 627 (can_deoptimize == CAN_DEOPTIMIZE_EAGERLY) ||
628 !hinstr->HasObservableSideEffects(); 628 !hinstr->HasObservableSideEffects();
629 if (needs_environment && !instr->HasEnvironment()) { 629 if (needs_environment && !instr->HasEnvironment()) {
630 instr = AssignEnvironment(instr); 630 instr = AssignEnvironment(instr);
631 // We can't really figure out if the environment is needed or not.
632 instr->environment()->set_has_been_used();
631 } 633 }
632 634
633 return instr; 635 return instr;
634 } 636 }
635 637
636 638
637 LInstruction* LChunkBuilder::AssignPointerMap(LInstruction* instr) { 639 LInstruction* LChunkBuilder::AssignPointerMap(LInstruction* instr) {
638 ASSERT(!instr->HasPointerMap()); 640 ASSERT(!instr->HasPointerMap());
639 instr->set_pointer_map(new(zone()) LPointerMap(zone())); 641 instr->set_pointer_map(new(zone()) LPointerMap(zone()));
640 return instr; 642 return instr;
(...skipping 1197 matching lines...) Expand 10 before | Expand all | Expand 10 after
1838 ASSERT(to.IsInteger32()); 1840 ASSERT(to.IsInteger32());
1839 if (val->type().IsSmi() || val->representation().IsSmi()) { 1841 if (val->type().IsSmi() || val->representation().IsSmi()) {
1840 LOperand* value = UseRegisterAtStart(val); 1842 LOperand* value = UseRegisterAtStart(val);
1841 return DefineAsRegister(new(zone()) LSmiUntag(value, false)); 1843 return DefineAsRegister(new(zone()) LSmiUntag(value, false));
1842 } else { 1844 } else {
1843 LOperand* value = UseRegister(val); 1845 LOperand* value = UseRegister(val);
1844 LOperand* temp1 = TempRegister(); 1846 LOperand* temp1 = TempRegister();
1845 LOperand* temp2 = FixedTemp(f22); 1847 LOperand* temp2 = FixedTemp(f22);
1846 LInstruction* result = 1848 LInstruction* result =
1847 DefineSameAsFirst(new(zone()) LTaggedToI(value, temp1, temp2)); 1849 DefineSameAsFirst(new(zone()) LTaggedToI(value, temp1, temp2));
1848 if (!val->representation().IsSmi()) { 1850 if (!val->representation().IsSmi()) result = AssignEnvironment(result);
1849 // Note: Only deopts in deferred code.
1850 result = AssignEnvironment(result);
1851 }
1852 return result; 1851 return result;
1853 } 1852 }
1854 } 1853 }
1855 } else if (from.IsDouble()) { 1854 } else if (from.IsDouble()) {
1856 if (to.IsTagged()) { 1855 if (to.IsTagged()) {
1857 info()->MarkAsDeferredCalling(); 1856 info()->MarkAsDeferredCalling();
1858 LOperand* value = UseRegister(val); 1857 LOperand* value = UseRegister(val);
1859 LOperand* temp1 = TempRegister(); 1858 LOperand* temp1 = TempRegister();
1860 LOperand* temp2 = TempRegister(); 1859 LOperand* temp2 = TempRegister();
1861 LUnallocated* result_temp = TempRegister(); 1860 LUnallocated* result_temp = TempRegister();
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
1936 return AssignEnvironment(new(zone()) LCheckValue(value)); 1935 return AssignEnvironment(new(zone()) LCheckValue(value));
1937 } 1936 }
1938 1937
1939 1938
1940 LInstruction* LChunkBuilder::DoCheckMaps(HCheckMaps* instr) { 1939 LInstruction* LChunkBuilder::DoCheckMaps(HCheckMaps* instr) {
1941 LOperand* value = NULL; 1940 LOperand* value = NULL;
1942 if (!instr->CanOmitMapChecks()) { 1941 if (!instr->CanOmitMapChecks()) {
1943 value = UseRegisterAtStart(instr->value()); 1942 value = UseRegisterAtStart(instr->value());
1944 if (instr->has_migration_target()) info()->MarkAsDeferredCalling(); 1943 if (instr->has_migration_target()) info()->MarkAsDeferredCalling();
1945 } 1944 }
1946 LCheckMaps* result = new(zone()) LCheckMaps(value); 1945 LInstruction* result = new(zone()) LCheckMaps(value);
1947 if (!instr->CanOmitMapChecks()) { 1946 if (!instr->CanOmitMapChecks()) {
1948 // Note: Only deopts in deferred code. 1947 result = AssignEnvironment(result);
1949 AssignEnvironment(result); 1948 if (instr->has_migration_target()) result = AssignPointerMap(result);
1950 if (instr->has_migration_target()) return AssignPointerMap(result);
1951 } 1949 }
1952 return result; 1950 return result;
1953 } 1951 }
1954 1952
1955 1953
1956 LInstruction* LChunkBuilder::DoClampToUint8(HClampToUint8* instr) { 1954 LInstruction* LChunkBuilder::DoClampToUint8(HClampToUint8* instr) {
1957 HValue* value = instr->value(); 1955 HValue* value = instr->value();
1958 Representation input_rep = value->representation(); 1956 Representation input_rep = value->representation();
1959 LOperand* reg = UseRegister(value); 1957 LOperand* reg = UseRegister(value);
1960 if (input_rep.IsDouble()) { 1958 if (input_rep.IsDouble()) {
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
2523 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2521 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2524 LOperand* object = UseRegister(instr->object()); 2522 LOperand* object = UseRegister(instr->object());
2525 LOperand* index = UseRegister(instr->index()); 2523 LOperand* index = UseRegister(instr->index());
2526 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); 2524 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index);
2527 LInstruction* result = DefineSameAsFirst(load); 2525 LInstruction* result = DefineSameAsFirst(load);
2528 return AssignPointerMap(result); 2526 return AssignPointerMap(result);
2529 } 2527 }
2530 2528
2531 2529
2532 } } // namespace v8::internal 2530 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mips/lithium-codegen-mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698