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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 | 326 |
327 enum InnerPosition { | 327 enum InnerPosition { |
328 BEFORE, | 328 BEFORE, |
329 START, | 329 START, |
330 END, | 330 END, |
331 AFTER, | 331 AFTER, |
332 FIRST_INNER_POSITION = BEFORE, | 332 FIRST_INNER_POSITION = BEFORE, |
333 LAST_INNER_POSITION = AFTER | 333 LAST_INNER_POSITION = AFTER |
334 }; | 334 }; |
335 | 335 |
336 LParallelMove* GetOrCreateParallelMove(InnerPosition pos) { | 336 LParallelMove* GetOrCreateParallelMove(InnerPosition pos, |
337 if (parallel_moves_[pos] == NULL) parallel_moves_[pos] = new LParallelMove; | 337 Zone* zone) { |
| 338 if (parallel_moves_[pos] == NULL) { |
| 339 parallel_moves_[pos] = new(zone) LParallelMove(zone); |
| 340 } |
338 return parallel_moves_[pos]; | 341 return parallel_moves_[pos]; |
339 } | 342 } |
340 | 343 |
341 LParallelMove* GetParallelMove(InnerPosition pos) { | 344 LParallelMove* GetParallelMove(InnerPosition pos) { |
342 return parallel_moves_[pos]; | 345 return parallel_moves_[pos]; |
343 } | 346 } |
344 | 347 |
345 private: | 348 private: |
346 LParallelMove* parallel_moves_[LAST_INNER_POSITION + 1]; | 349 LParallelMove* parallel_moves_[LAST_INNER_POSITION + 1]; |
347 HBasicBlock* block_; | 350 HBasicBlock* block_; |
(...skipping 1806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2154 LOperand* object() { return inputs_[0]; } | 2157 LOperand* object() { return inputs_[0]; } |
2155 LOperand* index() { return inputs_[1]; } | 2158 LOperand* index() { return inputs_[1]; } |
2156 | 2159 |
2157 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex, "load-field-by-index") | 2160 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex, "load-field-by-index") |
2158 }; | 2161 }; |
2159 | 2162 |
2160 | 2163 |
2161 class LChunkBuilder; | 2164 class LChunkBuilder; |
2162 class LChunk: public ZoneObject { | 2165 class LChunk: public ZoneObject { |
2163 public: | 2166 public: |
2164 explicit LChunk(CompilationInfo* info, HGraph* graph) | 2167 LChunk(CompilationInfo* info, HGraph* graph) |
2165 : spill_slot_count_(0), | 2168 : spill_slot_count_(0), |
2166 info_(info), | 2169 info_(info), |
2167 graph_(graph), | 2170 graph_(graph), |
2168 instructions_(32), | 2171 instructions_(32, graph->zone()), |
2169 pointer_maps_(8), | 2172 pointer_maps_(8, graph->zone()), |
2170 inlined_closures_(1) { } | 2173 inlined_closures_(1, graph->zone()) { } |
2171 | 2174 |
2172 void AddInstruction(LInstruction* instruction, HBasicBlock* block); | 2175 void AddInstruction(LInstruction* instruction, HBasicBlock* block); |
2173 LConstantOperand* DefineConstantOperand(HConstant* constant); | 2176 LConstantOperand* DefineConstantOperand(HConstant* constant); |
2174 Handle<Object> LookupLiteral(LConstantOperand* operand) const; | 2177 Handle<Object> LookupLiteral(LConstantOperand* operand) const; |
2175 Representation LookupLiteralRepresentation(LConstantOperand* operand) const; | 2178 Representation LookupLiteralRepresentation(LConstantOperand* operand) const; |
2176 | 2179 |
2177 int GetNextSpillIndex(bool is_double); | 2180 int GetNextSpillIndex(bool is_double); |
2178 LOperand* GetNextSpillSlot(bool is_double); | 2181 LOperand* GetNextSpillSlot(bool is_double); |
2179 | 2182 |
2180 int ParameterAt(int index); | 2183 int ParameterAt(int index); |
(...skipping 24 matching lines...) Expand all Loading... |
2205 LLabel* label = GetLabel(block_id); | 2208 LLabel* label = GetLabel(block_id); |
2206 ASSERT(!label->HasReplacement()); | 2209 ASSERT(!label->HasReplacement()); |
2207 return label->label(); | 2210 return label->label(); |
2208 } | 2211 } |
2209 | 2212 |
2210 const ZoneList<Handle<JSFunction> >* inlined_closures() const { | 2213 const ZoneList<Handle<JSFunction> >* inlined_closures() const { |
2211 return &inlined_closures_; | 2214 return &inlined_closures_; |
2212 } | 2215 } |
2213 | 2216 |
2214 void AddInlinedClosure(Handle<JSFunction> closure) { | 2217 void AddInlinedClosure(Handle<JSFunction> closure) { |
2215 inlined_closures_.Add(closure); | 2218 inlined_closures_.Add(closure, zone()); |
2216 } | 2219 } |
2217 | 2220 |
| 2221 Zone* zone() { return graph_->zone(); } |
| 2222 |
2218 private: | 2223 private: |
2219 int spill_slot_count_; | 2224 int spill_slot_count_; |
2220 CompilationInfo* info_; | 2225 CompilationInfo* info_; |
2221 HGraph* const graph_; | 2226 HGraph* const graph_; |
2222 ZoneList<LInstruction*> instructions_; | 2227 ZoneList<LInstruction*> instructions_; |
2223 ZoneList<LPointerMap*> pointer_maps_; | 2228 ZoneList<LPointerMap*> pointer_maps_; |
2224 ZoneList<Handle<JSFunction> > inlined_closures_; | 2229 ZoneList<Handle<JSFunction> > inlined_closures_; |
2225 }; | 2230 }; |
2226 | 2231 |
2227 | 2232 |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2378 | 2383 |
2379 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2384 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2380 }; | 2385 }; |
2381 | 2386 |
2382 #undef DECLARE_HYDROGEN_ACCESSOR | 2387 #undef DECLARE_HYDROGEN_ACCESSOR |
2383 #undef DECLARE_CONCRETE_INSTRUCTION | 2388 #undef DECLARE_CONCRETE_INSTRUCTION |
2384 | 2389 |
2385 } } // namespace v8::int | 2390 } } // namespace v8::int |
2386 | 2391 |
2387 #endif // V8_X64_LITHIUM_X64_H_ | 2392 #endif // V8_X64_LITHIUM_X64_H_ |
OLD | NEW |