| 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 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 616 | 616 |
| 617 // If instruction does not have side-effects lazy deoptimization | 617 // If instruction does not have side-effects lazy deoptimization |
| 618 // after the call will try to deoptimize to the point before the call. | 618 // after the call will try to deoptimize to the point before the call. |
| 619 // Thus we still need to attach environment to this call even if | 619 // Thus we still need to attach environment to this call even if |
| 620 // call sequence can not deoptimize eagerly. | 620 // call sequence can not deoptimize eagerly. |
| 621 bool needs_environment = | 621 bool needs_environment = |
| 622 (can_deoptimize == CAN_DEOPTIMIZE_EAGERLY) || | 622 (can_deoptimize == CAN_DEOPTIMIZE_EAGERLY) || |
| 623 !hinstr->HasObservableSideEffects(); | 623 !hinstr->HasObservableSideEffects(); |
| 624 if (needs_environment && !instr->HasEnvironment()) { | 624 if (needs_environment && !instr->HasEnvironment()) { |
| 625 instr = AssignEnvironment(instr); | 625 instr = AssignEnvironment(instr); |
| 626 // We can't really figure out if the environment is needed or not. |
| 627 instr->environment()->set_has_been_used(); |
| 626 } | 628 } |
| 627 | 629 |
| 628 return instr; | 630 return instr; |
| 629 } | 631 } |
| 630 | 632 |
| 631 | 633 |
| 632 LInstruction* LChunkBuilder::AssignPointerMap(LInstruction* instr) { | 634 LInstruction* LChunkBuilder::AssignPointerMap(LInstruction* instr) { |
| 633 ASSERT(!instr->HasPointerMap()); | 635 ASSERT(!instr->HasPointerMap()); |
| 634 instr->set_pointer_map(new(zone()) LPointerMap(zone())); | 636 instr->set_pointer_map(new(zone()) LPointerMap(zone())); |
| 635 return instr; | 637 return instr; |
| (...skipping 1252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1888 ASSERT(to.IsInteger32()); | 1890 ASSERT(to.IsInteger32()); |
| 1889 if (val->type().IsSmi() || val->representation().IsSmi()) { | 1891 if (val->type().IsSmi() || val->representation().IsSmi()) { |
| 1890 LOperand* value = UseRegisterAtStart(val); | 1892 LOperand* value = UseRegisterAtStart(val); |
| 1891 return DefineAsRegister(new(zone()) LSmiUntag(value, false)); | 1893 return DefineAsRegister(new(zone()) LSmiUntag(value, false)); |
| 1892 } else { | 1894 } else { |
| 1893 LOperand* value = UseRegister(val); | 1895 LOperand* value = UseRegister(val); |
| 1894 LOperand* temp1 = TempRegister(); | 1896 LOperand* temp1 = TempRegister(); |
| 1895 LOperand* temp2 = FixedTemp(d11); | 1897 LOperand* temp2 = FixedTemp(d11); |
| 1896 LInstruction* result = | 1898 LInstruction* result = |
| 1897 DefineSameAsFirst(new(zone()) LTaggedToI(value, temp1, temp2)); | 1899 DefineSameAsFirst(new(zone()) LTaggedToI(value, temp1, temp2)); |
| 1898 if (!val->representation().IsSmi()) { | 1900 if (!val->representation().IsSmi()) result = AssignEnvironment(result); |
| 1899 // Note: Only deopts in deferred code. | |
| 1900 result = AssignEnvironment(result); | |
| 1901 } | |
| 1902 return result; | 1901 return result; |
| 1903 } | 1902 } |
| 1904 } | 1903 } |
| 1905 } else if (from.IsDouble()) { | 1904 } else if (from.IsDouble()) { |
| 1906 if (to.IsTagged()) { | 1905 if (to.IsTagged()) { |
| 1907 info()->MarkAsDeferredCalling(); | 1906 info()->MarkAsDeferredCalling(); |
| 1908 LOperand* value = UseRegister(val); | 1907 LOperand* value = UseRegister(val); |
| 1909 LOperand* temp1 = TempRegister(); | 1908 LOperand* temp1 = TempRegister(); |
| 1910 LOperand* temp2 = TempRegister(); | 1909 LOperand* temp2 = TempRegister(); |
| 1911 LUnallocated* result_temp = TempRegister(); | 1910 LUnallocated* result_temp = TempRegister(); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1986 return AssignEnvironment(new(zone()) LCheckValue(value)); | 1985 return AssignEnvironment(new(zone()) LCheckValue(value)); |
| 1987 } | 1986 } |
| 1988 | 1987 |
| 1989 | 1988 |
| 1990 LInstruction* LChunkBuilder::DoCheckMaps(HCheckMaps* instr) { | 1989 LInstruction* LChunkBuilder::DoCheckMaps(HCheckMaps* instr) { |
| 1991 LOperand* value = NULL; | 1990 LOperand* value = NULL; |
| 1992 if (!instr->CanOmitMapChecks()) { | 1991 if (!instr->CanOmitMapChecks()) { |
| 1993 value = UseRegisterAtStart(instr->value()); | 1992 value = UseRegisterAtStart(instr->value()); |
| 1994 if (instr->has_migration_target()) info()->MarkAsDeferredCalling(); | 1993 if (instr->has_migration_target()) info()->MarkAsDeferredCalling(); |
| 1995 } | 1994 } |
| 1996 LCheckMaps* result = new(zone()) LCheckMaps(value); | 1995 LInstruction* result = new(zone()) LCheckMaps(value); |
| 1997 if (!instr->CanOmitMapChecks()) { | 1996 if (!instr->CanOmitMapChecks()) { |
| 1998 // Note: Only deopts in deferred code. | 1997 result = AssignEnvironment(result); |
| 1999 AssignEnvironment(result); | 1998 if (instr->has_migration_target()) result = AssignPointerMap(result); |
| 2000 if (instr->has_migration_target()) return AssignPointerMap(result); | |
| 2001 } | 1999 } |
| 2002 return result; | 2000 return result; |
| 2003 } | 2001 } |
| 2004 | 2002 |
| 2005 | 2003 |
| 2006 LInstruction* LChunkBuilder::DoClampToUint8(HClampToUint8* instr) { | 2004 LInstruction* LChunkBuilder::DoClampToUint8(HClampToUint8* instr) { |
| 2007 HValue* value = instr->value(); | 2005 HValue* value = instr->value(); |
| 2008 Representation input_rep = value->representation(); | 2006 Representation input_rep = value->representation(); |
| 2009 LOperand* reg = UseRegister(value); | 2007 LOperand* reg = UseRegister(value); |
| 2010 if (input_rep.IsDouble()) { | 2008 if (input_rep.IsDouble()) { |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2571 | 2569 |
| 2572 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2570 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
| 2573 LOperand* object = UseRegister(instr->object()); | 2571 LOperand* object = UseRegister(instr->object()); |
| 2574 LOperand* index = UseRegister(instr->index()); | 2572 LOperand* index = UseRegister(instr->index()); |
| 2575 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); | 2573 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); |
| 2576 LInstruction* result = DefineSameAsFirst(load); | 2574 LInstruction* result = DefineSameAsFirst(load); |
| 2577 return AssignPointerMap(result); | 2575 return AssignPointerMap(result); |
| 2578 } | 2576 } |
| 2579 | 2577 |
| 2580 } } // namespace v8::internal | 2578 } } // namespace v8::internal |
| OLD | NEW |