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 2045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2056 | 2056 |
2057 LInstruction* LChunkBuilder::DoCheckInstanceType(HCheckInstanceType* instr) { | 2057 LInstruction* LChunkBuilder::DoCheckInstanceType(HCheckInstanceType* instr) { |
2058 LOperand* value = UseRegisterAtStart(instr->value()); | 2058 LOperand* value = UseRegisterAtStart(instr->value()); |
2059 LOperand* temp = TempRegister(); | 2059 LOperand* temp = TempRegister(); |
2060 LCheckInstanceType* result = new(zone()) LCheckInstanceType(value, temp); | 2060 LCheckInstanceType* result = new(zone()) LCheckInstanceType(value, temp); |
2061 return AssignEnvironment(result); | 2061 return AssignEnvironment(result); |
2062 } | 2062 } |
2063 | 2063 |
2064 | 2064 |
2065 LInstruction* LChunkBuilder::DoCheckPrototypeMaps(HCheckPrototypeMaps* instr) { | 2065 LInstruction* LChunkBuilder::DoCheckPrototypeMaps(HCheckPrototypeMaps* instr) { |
2066 LUnallocated* temp = TempRegister(); | 2066 LUnallocated* temp = NULL; |
| 2067 if (!instr->CanOmitPrototypeChecks()) temp = TempRegister(); |
2067 LCheckPrototypeMaps* result = new(zone()) LCheckPrototypeMaps(temp); | 2068 LCheckPrototypeMaps* result = new(zone()) LCheckPrototypeMaps(temp); |
| 2069 if (instr->CanOmitPrototypeChecks()) return result; |
2068 return AssignEnvironment(result); | 2070 return AssignEnvironment(result); |
2069 } | 2071 } |
2070 | 2072 |
2071 | 2073 |
2072 LInstruction* LChunkBuilder::DoCheckFunction(HCheckFunction* instr) { | 2074 LInstruction* LChunkBuilder::DoCheckFunction(HCheckFunction* instr) { |
2073 // If the target is in new space, we'll emit a global cell compare and so | 2075 // If the target is in new space, we'll emit a global cell compare and so |
2074 // want the value in a register. If the target gets promoted before we | 2076 // want the value in a register. If the target gets promoted before we |
2075 // emit code, we will still get the register but will do an immediate | 2077 // emit code, we will still get the register but will do an immediate |
2076 // compare instead of the cell compare. This is safe. | 2078 // compare instead of the cell compare. This is safe. |
2077 LOperand* value = instr->target_in_new_space() | 2079 LOperand* value = instr->target_in_new_space() |
2078 ? UseRegisterAtStart(instr->value()) : UseAtStart(instr->value()); | 2080 ? UseRegisterAtStart(instr->value()) : UseAtStart(instr->value()); |
2079 return AssignEnvironment(new(zone()) LCheckFunction(value)); | 2081 return AssignEnvironment(new(zone()) LCheckFunction(value)); |
2080 } | 2082 } |
2081 | 2083 |
2082 | 2084 |
2083 LInstruction* LChunkBuilder::DoCheckMaps(HCheckMaps* instr) { | 2085 LInstruction* LChunkBuilder::DoCheckMaps(HCheckMaps* instr) { |
2084 LOperand* value = UseRegisterAtStart(instr->value()); | 2086 LOperand* value = NULL; |
| 2087 if (!instr->CanOmitMapChecks()) value = UseRegisterAtStart(instr->value()); |
2085 LCheckMaps* result = new(zone()) LCheckMaps(value); | 2088 LCheckMaps* result = new(zone()) LCheckMaps(value); |
| 2089 if (instr->CanOmitMapChecks()) return result; |
2086 return AssignEnvironment(result); | 2090 return AssignEnvironment(result); |
2087 } | 2091 } |
2088 | 2092 |
2089 | 2093 |
2090 LInstruction* LChunkBuilder::DoClampToUint8(HClampToUint8* instr) { | 2094 LInstruction* LChunkBuilder::DoClampToUint8(HClampToUint8* instr) { |
2091 HValue* value = instr->value(); | 2095 HValue* value = instr->value(); |
2092 Representation input_rep = value->representation(); | 2096 Representation input_rep = value->representation(); |
2093 if (input_rep.IsDouble()) { | 2097 if (input_rep.IsDouble()) { |
2094 LOperand* reg = UseRegister(value); | 2098 LOperand* reg = UseRegister(value); |
2095 return DefineFixed(new(zone()) LClampDToUint8(reg), eax); | 2099 return DefineFixed(new(zone()) LClampDToUint8(reg), eax); |
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2767 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2771 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2768 LOperand* object = UseRegister(instr->object()); | 2772 LOperand* object = UseRegister(instr->object()); |
2769 LOperand* index = UseTempRegister(instr->index()); | 2773 LOperand* index = UseTempRegister(instr->index()); |
2770 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2774 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
2771 } | 2775 } |
2772 | 2776 |
2773 | 2777 |
2774 } } // namespace v8::internal | 2778 } } // namespace v8::internal |
2775 | 2779 |
2776 #endif // V8_TARGET_ARCH_IA32 | 2780 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |