| OLD | NEW |
| 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 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 681 | 681 |
| 682 // If instruction does not have side-effects lazy deoptimization | 682 // If instruction does not have side-effects lazy deoptimization |
| 683 // after the call will try to deoptimize to the point before the call. | 683 // after the call will try to deoptimize to the point before the call. |
| 684 // Thus we still need to attach environment to this call even if | 684 // Thus we still need to attach environment to this call even if |
| 685 // call sequence can not deoptimize eagerly. | 685 // call sequence can not deoptimize eagerly. |
| 686 bool needs_environment = | 686 bool needs_environment = |
| 687 (can_deoptimize == CAN_DEOPTIMIZE_EAGERLY) || | 687 (can_deoptimize == CAN_DEOPTIMIZE_EAGERLY) || |
| 688 !hinstr->HasObservableSideEffects(); | 688 !hinstr->HasObservableSideEffects(); |
| 689 if (needs_environment && !instr->HasEnvironment()) { | 689 if (needs_environment && !instr->HasEnvironment()) { |
| 690 instr = AssignEnvironment(instr); | 690 instr = AssignEnvironment(instr); |
| 691 // We can't really figure out if the environment is needed or not. |
| 692 instr->environment()->set_has_been_used(); |
| 691 } | 693 } |
| 692 | 694 |
| 693 return instr; | 695 return instr; |
| 694 } | 696 } |
| 695 | 697 |
| 696 | 698 |
| 697 LInstruction* LChunkBuilder::AssignPointerMap(LInstruction* instr) { | 699 LInstruction* LChunkBuilder::AssignPointerMap(LInstruction* instr) { |
| 698 ASSERT(!instr->HasPointerMap()); | 700 ASSERT(!instr->HasPointerMap()); |
| 699 instr->set_pointer_map(new(zone()) LPointerMap(zone())); | 701 instr->set_pointer_map(new(zone()) LPointerMap(zone())); |
| 700 return instr; | 702 return instr; |
| (...skipping 1226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1927 LOperand* value = UseRegister(val); | 1929 LOperand* value = UseRegister(val); |
| 1928 return DefineSameAsFirst(new(zone()) LSmiUntag(value, false)); | 1930 return DefineSameAsFirst(new(zone()) LSmiUntag(value, false)); |
| 1929 } else { | 1931 } else { |
| 1930 LOperand* value = UseRegister(val); | 1932 LOperand* value = UseRegister(val); |
| 1931 bool truncating = instr->CanTruncateToInt32(); | 1933 bool truncating = instr->CanTruncateToInt32(); |
| 1932 LOperand* xmm_temp = | 1934 LOperand* xmm_temp = |
| 1933 (CpuFeatures::IsSafeForSnapshot(SSE2) && !truncating) | 1935 (CpuFeatures::IsSafeForSnapshot(SSE2) && !truncating) |
| 1934 ? FixedTemp(xmm1) : NULL; | 1936 ? FixedTemp(xmm1) : NULL; |
| 1935 LInstruction* result = | 1937 LInstruction* result = |
| 1936 DefineSameAsFirst(new(zone()) LTaggedToI(value, xmm_temp)); | 1938 DefineSameAsFirst(new(zone()) LTaggedToI(value, xmm_temp)); |
| 1937 if (!val->representation().IsSmi()) { | 1939 if (!val->representation().IsSmi()) result = AssignEnvironment(result); |
| 1938 // Note: Only deopts in deferred code. | |
| 1939 result = AssignEnvironment(result); | |
| 1940 } | |
| 1941 return result; | 1940 return result; |
| 1942 } | 1941 } |
| 1943 } | 1942 } |
| 1944 } else if (from.IsDouble()) { | 1943 } else if (from.IsDouble()) { |
| 1945 if (to.IsTagged()) { | 1944 if (to.IsTagged()) { |
| 1946 info()->MarkAsDeferredCalling(); | 1945 info()->MarkAsDeferredCalling(); |
| 1947 LOperand* value = UseRegisterAtStart(val); | 1946 LOperand* value = UseRegisterAtStart(val); |
| 1948 LOperand* temp = FLAG_inline_new ? TempRegister() : NULL; | 1947 LOperand* temp = FLAG_inline_new ? TempRegister() : NULL; |
| 1949 LUnallocated* result_temp = TempRegister(); | 1948 LUnallocated* result_temp = TempRegister(); |
| 1950 LNumberTagD* result = new(zone()) LNumberTagD(value, temp); | 1949 LNumberTagD* result = new(zone()) LNumberTagD(value, temp); |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2036 return AssignEnvironment(new(zone()) LCheckValue(value)); | 2035 return AssignEnvironment(new(zone()) LCheckValue(value)); |
| 2037 } | 2036 } |
| 2038 | 2037 |
| 2039 | 2038 |
| 2040 LInstruction* LChunkBuilder::DoCheckMaps(HCheckMaps* instr) { | 2039 LInstruction* LChunkBuilder::DoCheckMaps(HCheckMaps* instr) { |
| 2041 LOperand* value = NULL; | 2040 LOperand* value = NULL; |
| 2042 if (!instr->CanOmitMapChecks()) { | 2041 if (!instr->CanOmitMapChecks()) { |
| 2043 value = UseRegisterAtStart(instr->value()); | 2042 value = UseRegisterAtStart(instr->value()); |
| 2044 if (instr->has_migration_target()) info()->MarkAsDeferredCalling(); | 2043 if (instr->has_migration_target()) info()->MarkAsDeferredCalling(); |
| 2045 } | 2044 } |
| 2046 LCheckMaps* result = new(zone()) LCheckMaps(value); | 2045 LInstruction* result = new(zone()) LCheckMaps(value); |
| 2047 if (!instr->CanOmitMapChecks()) { | 2046 if (!instr->CanOmitMapChecks()) { |
| 2048 // Note: Only deopts in deferred code. | 2047 result = AssignEnvironment(result); |
| 2049 AssignEnvironment(result); | 2048 if (instr->has_migration_target()) result = AssignPointerMap(result); |
| 2050 if (instr->has_migration_target()) return AssignPointerMap(result); | |
| 2051 } | 2049 } |
| 2052 return result; | 2050 return result; |
| 2053 } | 2051 } |
| 2054 | 2052 |
| 2055 | 2053 |
| 2056 LInstruction* LChunkBuilder::DoClampToUint8(HClampToUint8* instr) { | 2054 LInstruction* LChunkBuilder::DoClampToUint8(HClampToUint8* instr) { |
| 2057 HValue* value = instr->value(); | 2055 HValue* value = instr->value(); |
| 2058 Representation input_rep = value->representation(); | 2056 Representation input_rep = value->representation(); |
| 2059 if (input_rep.IsDouble()) { | 2057 if (input_rep.IsDouble()) { |
| 2060 LOperand* reg = UseRegister(value); | 2058 LOperand* reg = UseRegister(value); |
| (...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2711 LOperand* index = UseTempRegister(instr->index()); | 2709 LOperand* index = UseTempRegister(instr->index()); |
| 2712 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); | 2710 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); |
| 2713 LInstruction* result = DefineSameAsFirst(load); | 2711 LInstruction* result = DefineSameAsFirst(load); |
| 2714 return AssignPointerMap(result); | 2712 return AssignPointerMap(result); |
| 2715 } | 2713 } |
| 2716 | 2714 |
| 2717 | 2715 |
| 2718 } } // namespace v8::internal | 2716 } } // namespace v8::internal |
| 2719 | 2717 |
| 2720 #endif // V8_TARGET_ARCH_IA32 | 2718 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |