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

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

Issue 218403006: Check that environments assigned via AssignEnvironment are actually used. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Simplified. Rebased. 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/x64/lithium-codegen-x64.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 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 645
646 // If instruction does not have side-effects lazy deoptimization 646 // If instruction does not have side-effects lazy deoptimization
647 // after the call will try to deoptimize to the point before the call. 647 // after the call will try to deoptimize to the point before the call.
648 // Thus we still need to attach environment to this call even if 648 // Thus we still need to attach environment to this call even if
649 // call sequence can not deoptimize eagerly. 649 // call sequence can not deoptimize eagerly.
650 bool needs_environment = 650 bool needs_environment =
651 (can_deoptimize == CAN_DEOPTIMIZE_EAGERLY) || 651 (can_deoptimize == CAN_DEOPTIMIZE_EAGERLY) ||
652 !hinstr->HasObservableSideEffects(); 652 !hinstr->HasObservableSideEffects();
653 if (needs_environment && !instr->HasEnvironment()) { 653 if (needs_environment && !instr->HasEnvironment()) {
654 instr = AssignEnvironment(instr); 654 instr = AssignEnvironment(instr);
655 // We can't really figure out if the environment is needed or not.
656 instr->environment()->set_has_been_used();
655 } 657 }
656 658
657 return instr; 659 return instr;
658 } 660 }
659 661
660 662
661 LInstruction* LChunkBuilder::AssignPointerMap(LInstruction* instr) { 663 LInstruction* LChunkBuilder::AssignPointerMap(LInstruction* instr) {
662 ASSERT(!instr->HasPointerMap()); 664 ASSERT(!instr->HasPointerMap());
663 instr->set_pointer_map(new(zone()) LPointerMap(zone())); 665 instr->set_pointer_map(new(zone()) LPointerMap(zone()));
664 return instr; 666 return instr;
(...skipping 1185 matching lines...) Expand 10 before | Expand all | Expand 10 after
1850 ASSERT(to.IsInteger32()); 1852 ASSERT(to.IsInteger32());
1851 if (val->type().IsSmi() || val->representation().IsSmi()) { 1853 if (val->type().IsSmi() || val->representation().IsSmi()) {
1852 LOperand* value = UseRegister(val); 1854 LOperand* value = UseRegister(val);
1853 return DefineSameAsFirst(new(zone()) LSmiUntag(value, false)); 1855 return DefineSameAsFirst(new(zone()) LSmiUntag(value, false));
1854 } else { 1856 } else {
1855 LOperand* value = UseRegister(val); 1857 LOperand* value = UseRegister(val);
1856 bool truncating = instr->CanTruncateToInt32(); 1858 bool truncating = instr->CanTruncateToInt32();
1857 LOperand* xmm_temp = truncating ? NULL : FixedTemp(xmm1); 1859 LOperand* xmm_temp = truncating ? NULL : FixedTemp(xmm1);
1858 LInstruction* result = 1860 LInstruction* result =
1859 DefineSameAsFirst(new(zone()) LTaggedToI(value, xmm_temp)); 1861 DefineSameAsFirst(new(zone()) LTaggedToI(value, xmm_temp));
1860 if (!val->representation().IsSmi()) { 1862 if (!val->representation().IsSmi()) result = AssignEnvironment(result);
1861 // Note: Only deopts in deferred code.
1862 result = AssignEnvironment(result);
1863 }
1864 return result; 1863 return result;
1865 } 1864 }
1866 } 1865 }
1867 } else if (from.IsDouble()) { 1866 } else if (from.IsDouble()) {
1868 if (to.IsTagged()) { 1867 if (to.IsTagged()) {
1869 info()->MarkAsDeferredCalling(); 1868 info()->MarkAsDeferredCalling();
1870 LOperand* value = UseRegister(val); 1869 LOperand* value = UseRegister(val);
1871 LOperand* temp = TempRegister(); 1870 LOperand* temp = TempRegister();
1872 LUnallocated* result_temp = TempRegister(); 1871 LUnallocated* result_temp = TempRegister();
1873 LNumberTagD* result = new(zone()) LNumberTagD(value, temp); 1872 LNumberTagD* result = new(zone()) LNumberTagD(value, temp);
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
1948 return AssignEnvironment(new(zone()) LCheckValue(value)); 1947 return AssignEnvironment(new(zone()) LCheckValue(value));
1949 } 1948 }
1950 1949
1951 1950
1952 LInstruction* LChunkBuilder::DoCheckMaps(HCheckMaps* instr) { 1951 LInstruction* LChunkBuilder::DoCheckMaps(HCheckMaps* instr) {
1953 LOperand* value = NULL; 1952 LOperand* value = NULL;
1954 if (!instr->CanOmitMapChecks()) { 1953 if (!instr->CanOmitMapChecks()) {
1955 value = UseRegisterAtStart(instr->value()); 1954 value = UseRegisterAtStart(instr->value());
1956 if (instr->has_migration_target()) info()->MarkAsDeferredCalling(); 1955 if (instr->has_migration_target()) info()->MarkAsDeferredCalling();
1957 } 1956 }
1958 LCheckMaps* result = new(zone()) LCheckMaps(value); 1957 LInstruction* result = new(zone()) LCheckMaps(value);
1959 if (!instr->CanOmitMapChecks()) { 1958 if (!instr->CanOmitMapChecks()) {
1960 // Note: Only deopts in deferred code. 1959 result = AssignEnvironment(result);
1961 AssignEnvironment(result); 1960 if (instr->has_migration_target()) result = AssignPointerMap(result);
1962 if (instr->has_migration_target()) return AssignPointerMap(result);
1963 } 1961 }
1964 return result; 1962 return result;
1965 } 1963 }
1966 1964
1967 1965
1968 LInstruction* LChunkBuilder::DoClampToUint8(HClampToUint8* instr) { 1966 LInstruction* LChunkBuilder::DoClampToUint8(HClampToUint8* instr) {
1969 HValue* value = instr->value(); 1967 HValue* value = instr->value();
1970 Representation input_rep = value->representation(); 1968 Representation input_rep = value->representation();
1971 LOperand* reg = UseRegister(value); 1969 LOperand* reg = UseRegister(value);
1972 if (input_rep.IsDouble()) { 1970 if (input_rep.IsDouble()) {
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
2603 LOperand* index = UseTempRegister(instr->index()); 2601 LOperand* index = UseTempRegister(instr->index());
2604 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); 2602 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index);
2605 LInstruction* result = DefineSameAsFirst(load); 2603 LInstruction* result = DefineSameAsFirst(load);
2606 return AssignPointerMap(result); 2604 return AssignPointerMap(result);
2607 } 2605 }
2608 2606
2609 2607
2610 } } // namespace v8::internal 2608 } } // namespace v8::internal
2611 2609
2612 #endif // V8_TARGET_ARCH_X64 2610 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/lithium-codegen-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698