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 2064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2075 ASSERT(instr->object()->representation().IsTagged()); | 2075 ASSERT(instr->object()->representation().IsTagged()); |
2076 ASSERT(instr->key()->representation().IsTagged()); | 2076 ASSERT(instr->key()->representation().IsTagged()); |
2077 ASSERT(instr->value()->representation().IsTagged()); | 2077 ASSERT(instr->value()->representation().IsTagged()); |
2078 | 2078 |
2079 return MarkAsCall(new(zone()) LStoreKeyedGeneric(obj, key, val), instr); | 2079 return MarkAsCall(new(zone()) LStoreKeyedGeneric(obj, key, val), instr); |
2080 } | 2080 } |
2081 | 2081 |
2082 | 2082 |
2083 LInstruction* LChunkBuilder::DoTransitionElementsKind( | 2083 LInstruction* LChunkBuilder::DoTransitionElementsKind( |
2084 HTransitionElementsKind* instr) { | 2084 HTransitionElementsKind* instr) { |
2085 if (instr->original_map()->elements_kind() == FAST_SMI_ONLY_ELEMENTS && | 2085 ElementsKind from_kind = instr->original_map()->elements_kind(); |
2086 instr->transitioned_map()->elements_kind() == FAST_ELEMENTS) { | 2086 ElementsKind to_kind = instr->transitioned_map()->elements_kind(); |
| 2087 bool simple_map_change = (GetHoleyElementsKind(from_kind) == to_kind) || |
| 2088 (IsFastSmiElementsKind(from_kind) && |
| 2089 IsFastObjectElementsKind(to_kind)); |
| 2090 if (simple_map_change) { |
2087 LOperand* object = UseRegister(instr->object()); | 2091 LOperand* object = UseRegister(instr->object()); |
2088 LOperand* new_map_reg = TempRegister(); | 2092 LOperand* new_map_reg = TempRegister(); |
2089 LTransitionElementsKind* result = | 2093 LTransitionElementsKind* result = |
2090 new(zone()) LTransitionElementsKind(object, new_map_reg, NULL); | 2094 new(zone()) LTransitionElementsKind(object, new_map_reg, NULL); |
2091 return DefineSameAsFirst(result); | 2095 return DefineSameAsFirst(result); |
2092 } else { | 2096 } else { |
2093 LOperand* object = UseFixed(instr->object(), r0); | 2097 LOperand* object = UseFixed(instr->object(), r0); |
2094 LOperand* fixed_object_reg = FixedTemp(r2); | 2098 LOperand* fixed_object_reg = FixedTemp(r2); |
2095 LOperand* new_map_reg = FixedTemp(r3); | 2099 LOperand* new_map_reg = FixedTemp(r3); |
2096 LTransitionElementsKind* result = | 2100 LTransitionElementsKind* result = |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2377 | 2381 |
2378 | 2382 |
2379 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2383 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2380 LOperand* object = UseRegister(instr->object()); | 2384 LOperand* object = UseRegister(instr->object()); |
2381 LOperand* index = UseRegister(instr->index()); | 2385 LOperand* index = UseRegister(instr->index()); |
2382 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2386 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
2383 } | 2387 } |
2384 | 2388 |
2385 | 2389 |
2386 } } // namespace v8::internal | 2390 } } // namespace v8::internal |
OLD | NEW |