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 2075 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2086 ASSERT(instr->value()->representation().IsTagged()); | 2086 ASSERT(instr->value()->representation().IsTagged()); |
2087 | 2087 |
2088 LStoreKeyedGeneric* result = | 2088 LStoreKeyedGeneric* result = |
2089 new(zone()) LStoreKeyedGeneric(context, object, key, value); | 2089 new(zone()) LStoreKeyedGeneric(context, object, key, value); |
2090 return MarkAsCall(result, instr); | 2090 return MarkAsCall(result, instr); |
2091 } | 2091 } |
2092 | 2092 |
2093 | 2093 |
2094 LInstruction* LChunkBuilder::DoTransitionElementsKind( | 2094 LInstruction* LChunkBuilder::DoTransitionElementsKind( |
2095 HTransitionElementsKind* instr) { | 2095 HTransitionElementsKind* instr) { |
2096 if (instr->original_map()->elements_kind() == FAST_SMI_ONLY_ELEMENTS && | 2096 ElementsKind from_kind = instr->original_map()->elements_kind(); |
2097 instr->transitioned_map()->elements_kind() == FAST_ELEMENTS) { | 2097 ElementsKind to_kind = instr->transitioned_map()->elements_kind(); |
| 2098 bool simple_map_change = (GetHoleyElementsKind(from_kind) == to_kind) || |
| 2099 (IsFastSmiElementsKind(from_kind) && |
| 2100 IsFastObjectElementsKind(to_kind)); |
| 2101 if (simple_map_change) { |
2098 LOperand* object = UseRegister(instr->object()); | 2102 LOperand* object = UseRegister(instr->object()); |
2099 LOperand* new_map_reg = TempRegister(); | 2103 LOperand* new_map_reg = TempRegister(); |
2100 LOperand* temp_reg = TempRegister(); | 2104 LOperand* temp_reg = TempRegister(); |
2101 LTransitionElementsKind* result = | 2105 LTransitionElementsKind* result = |
2102 new(zone()) LTransitionElementsKind(object, new_map_reg, temp_reg); | 2106 new(zone()) LTransitionElementsKind(object, new_map_reg, temp_reg); |
2103 return DefineSameAsFirst(result); | 2107 return DefineSameAsFirst(result); |
2104 } else { | 2108 } else { |
2105 LOperand* object = UseFixed(instr->object(), eax); | 2109 LOperand* object = UseFixed(instr->object(), eax); |
2106 LOperand* fixed_object_reg = FixedTemp(edx); | 2110 LOperand* fixed_object_reg = FixedTemp(edx); |
2107 LOperand* new_map_reg = FixedTemp(ebx); | 2111 LOperand* new_map_reg = FixedTemp(ebx); |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2431 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2435 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2432 LOperand* object = UseRegister(instr->object()); | 2436 LOperand* object = UseRegister(instr->object()); |
2433 LOperand* index = UseTempRegister(instr->index()); | 2437 LOperand* index = UseTempRegister(instr->index()); |
2434 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2438 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
2435 } | 2439 } |
2436 | 2440 |
2437 | 2441 |
2438 } } // namespace v8::internal | 2442 } } // namespace v8::internal |
2439 | 2443 |
2440 #endif // V8_TARGET_ARCH_IA32 | 2444 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |