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 2080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2091 ASSERT(instr->object()->representation().IsTagged()); | 2091 ASSERT(instr->object()->representation().IsTagged()); |
2092 ASSERT(instr->key()->representation().IsTagged()); | 2092 ASSERT(instr->key()->representation().IsTagged()); |
2093 ASSERT(instr->value()->representation().IsTagged()); | 2093 ASSERT(instr->value()->representation().IsTagged()); |
2094 | 2094 |
2095 return MarkAsCall(new(zone()) LStoreKeyedGeneric(obj, key, val), instr); | 2095 return MarkAsCall(new(zone()) LStoreKeyedGeneric(obj, key, val), instr); |
2096 } | 2096 } |
2097 | 2097 |
2098 | 2098 |
2099 LInstruction* LChunkBuilder::DoTransitionElementsKind( | 2099 LInstruction* LChunkBuilder::DoTransitionElementsKind( |
2100 HTransitionElementsKind* instr) { | 2100 HTransitionElementsKind* instr) { |
| 2101 LOperand* object = UseRegister(instr->object()); |
2101 if (IsSimpleMapChangeTransition(instr->from_kind(), instr->to_kind())) { | 2102 if (IsSimpleMapChangeTransition(instr->from_kind(), instr->to_kind())) { |
2102 LOperand* object = UseRegister(instr->object()); | |
2103 LOperand* new_map_reg = TempRegister(); | 2103 LOperand* new_map_reg = TempRegister(); |
2104 LTransitionElementsKind* result = | 2104 LTransitionElementsKind* result = |
2105 new(zone()) LTransitionElementsKind(object, new_map_reg, NULL); | 2105 new(zone()) LTransitionElementsKind(object, new_map_reg, NULL); |
2106 return DefineSameAsFirst(result); | 2106 return DefineSameAsFirst(result); |
| 2107 } else if (FLAG_compiled_transitions) { |
| 2108 LTransitionElementsKind* result = |
| 2109 new(zone()) LTransitionElementsKind(object, NULL, NULL); |
| 2110 return AssignPointerMap(result); |
2107 } else { | 2111 } else { |
2108 LOperand* object = UseFixed(instr->object(), r0); | 2112 LOperand* object = UseFixed(instr->object(), r0); |
2109 LOperand* fixed_object_reg = FixedTemp(r2); | 2113 LOperand* fixed_object_reg = FixedTemp(r2); |
2110 LOperand* new_map_reg = FixedTemp(r3); | 2114 LOperand* new_map_reg = FixedTemp(r3); |
2111 LTransitionElementsKind* result = | 2115 LTransitionElementsKind* result = |
2112 new(zone()) LTransitionElementsKind(object, | 2116 new(zone()) LTransitionElementsKind(object, |
2113 new_map_reg, | 2117 new_map_reg, |
2114 fixed_object_reg); | 2118 fixed_object_reg); |
2115 return MarkAsCall(DefineFixed(result, r0), instr); | 2119 return MarkAsCall(result, instr); |
2116 } | 2120 } |
2117 } | 2121 } |
2118 | 2122 |
2119 | 2123 |
| 2124 LInstruction* LChunkBuilder::DoTrapAllocationMemento( |
| 2125 HTrapAllocationMemento* instr) { |
| 2126 LOperand* object = UseRegister(instr->object()); |
| 2127 LOperand* temp = TempRegister(); |
| 2128 LTrapAllocationMemento* result = |
| 2129 new(zone()) LTrapAllocationMemento(object, temp); |
| 2130 return AssignEnvironment(result); |
| 2131 } |
| 2132 |
| 2133 |
2120 LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) { | 2134 LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) { |
2121 bool needs_write_barrier = instr->NeedsWriteBarrier(); | 2135 bool needs_write_barrier = instr->NeedsWriteBarrier(); |
2122 bool needs_write_barrier_for_map = !instr->transition().is_null() && | 2136 bool needs_write_barrier_for_map = !instr->transition().is_null() && |
2123 instr->NeedsWriteBarrierForMap(); | 2137 instr->NeedsWriteBarrierForMap(); |
2124 | 2138 |
2125 LOperand* obj; | 2139 LOperand* obj; |
2126 if (needs_write_barrier) { | 2140 if (needs_write_barrier) { |
2127 obj = instr->is_in_object() | 2141 obj = instr->is_in_object() |
2128 ? UseRegister(instr->object()) | 2142 ? UseRegister(instr->object()) |
2129 : UseTempRegister(instr->object()); | 2143 : UseTempRegister(instr->object()); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2176 } | 2190 } |
2177 | 2191 |
2178 | 2192 |
2179 LInstruction* LChunkBuilder::DoStringLength(HStringLength* instr) { | 2193 LInstruction* LChunkBuilder::DoStringLength(HStringLength* instr) { |
2180 LOperand* string = UseRegisterAtStart(instr->value()); | 2194 LOperand* string = UseRegisterAtStart(instr->value()); |
2181 return DefineAsRegister(new(zone()) LStringLength(string)); | 2195 return DefineAsRegister(new(zone()) LStringLength(string)); |
2182 } | 2196 } |
2183 | 2197 |
2184 | 2198 |
2185 LInstruction* LChunkBuilder::DoAllocateObject(HAllocateObject* instr) { | 2199 LInstruction* LChunkBuilder::DoAllocateObject(HAllocateObject* instr) { |
| 2200 info()->MarkAsDeferredCalling(); |
2186 LAllocateObject* result = | 2201 LAllocateObject* result = |
2187 new(zone()) LAllocateObject(TempRegister(), TempRegister()); | 2202 new(zone()) LAllocateObject(TempRegister(), TempRegister()); |
2188 return AssignPointerMap(DefineAsRegister(result)); | 2203 return AssignPointerMap(DefineAsRegister(result)); |
2189 } | 2204 } |
2190 | 2205 |
2191 | 2206 |
| 2207 LInstruction* LChunkBuilder::DoAllocate(HAllocate* instr) { |
| 2208 info()->MarkAsDeferredCalling(); |
| 2209 LOperand* size = UseTempRegister(instr->size()); |
| 2210 LOperand* temp1 = TempRegister(); |
| 2211 LOperand* temp2 = TempRegister(); |
| 2212 LAllocate* result = new(zone()) LAllocate(size, temp1, temp2); |
| 2213 return AssignPointerMap(DefineAsRegister(result)); |
| 2214 } |
| 2215 |
| 2216 |
2192 LInstruction* LChunkBuilder::DoFastLiteral(HFastLiteral* instr) { | 2217 LInstruction* LChunkBuilder::DoFastLiteral(HFastLiteral* instr) { |
2193 return MarkAsCall(DefineFixed(new(zone()) LFastLiteral, r0), instr); | 2218 return MarkAsCall(DefineFixed(new(zone()) LFastLiteral, r0), instr); |
2194 } | 2219 } |
2195 | 2220 |
2196 | 2221 |
2197 LInstruction* LChunkBuilder::DoArrayLiteral(HArrayLiteral* instr) { | 2222 LInstruction* LChunkBuilder::DoArrayLiteral(HArrayLiteral* instr) { |
2198 return MarkAsCall(DefineFixed(new(zone()) LArrayLiteral, r0), instr); | 2223 return MarkAsCall(DefineFixed(new(zone()) LArrayLiteral, r0), instr); |
2199 } | 2224 } |
2200 | 2225 |
2201 | 2226 |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2413 | 2438 |
2414 | 2439 |
2415 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2440 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2416 LOperand* object = UseRegister(instr->object()); | 2441 LOperand* object = UseRegister(instr->object()); |
2417 LOperand* index = UseRegister(instr->index()); | 2442 LOperand* index = UseRegister(instr->index()); |
2418 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2443 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
2419 } | 2444 } |
2420 | 2445 |
2421 | 2446 |
2422 } } // namespace v8::internal | 2447 } } // namespace v8::internal |
OLD | NEW |