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 2170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2181 } | 2181 } |
2182 | 2182 |
2183 LOperand* object() { return inputs_[0]; } | 2183 LOperand* object() { return inputs_[0]; } |
2184 LOperand* index() { return inputs_[1]; } | 2184 LOperand* index() { return inputs_[1]; } |
2185 | 2185 |
2186 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex, "load-field-by-index") | 2186 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex, "load-field-by-index") |
2187 }; | 2187 }; |
2188 | 2188 |
2189 | 2189 |
2190 class LChunkBuilder; | 2190 class LChunkBuilder; |
2191 class LChunk: public ZoneObject { | 2191 class LChunk: public LChunkBase { |
2192 public: | 2192 public: |
2193 explicit LChunk(CompilationInfo* info, HGraph* graph); | 2193 explicit LChunk(CompilationInfo* info, HGraph* graph) |
2194 | 2194 : LChunkBase(info, graph) { } |
2195 void AddInstruction(LInstruction* instruction, HBasicBlock* block); | |
2196 LConstantOperand* DefineConstantOperand(HConstant* constant); | |
2197 Handle<Object> LookupLiteral(LConstantOperand* operand) const; | |
2198 Representation LookupLiteralRepresentation(LConstantOperand* operand) const; | |
2199 | 2195 |
2200 int GetNextSpillIndex(bool is_double); | 2196 int GetNextSpillIndex(bool is_double); |
2201 LOperand* GetNextSpillSlot(bool is_double); | 2197 LOperand* GetNextSpillSlot(bool is_double); |
2202 | |
2203 int ParameterAt(int index); | |
2204 int GetParameterStackSlot(int index) const; | |
2205 int spill_slot_count() const { return spill_slot_count_; } | |
2206 CompilationInfo* info() const { return info_; } | |
2207 HGraph* graph() const { return graph_; } | |
2208 const ZoneList<LInstruction*>* instructions() const { return &instructions_; } | |
2209 void AddGapMove(int index, LOperand* from, LOperand* to); | |
2210 LGap* GetGapAt(int index) const; | |
2211 bool IsGapAt(int index) const; | |
2212 int NearestGapPos(int index) const; | |
2213 void MarkEmptyBlocks(); | |
2214 const ZoneList<LPointerMap*>* pointer_maps() const { return &pointer_maps_; } | |
2215 LLabel* GetLabel(int block_id) const { | |
2216 HBasicBlock* block = graph_->blocks()->at(block_id); | |
2217 int first_instruction = block->first_instruction_index(); | |
2218 return LLabel::cast(instructions_[first_instruction]); | |
2219 } | |
2220 int LookupDestination(int block_id) const { | |
2221 LLabel* cur = GetLabel(block_id); | |
2222 while (cur->replacement() != NULL) { | |
2223 cur = cur->replacement(); | |
2224 } | |
2225 return cur->block_id(); | |
2226 } | |
2227 Label* GetAssemblyLabel(int block_id) const { | |
2228 LLabel* label = GetLabel(block_id); | |
2229 ASSERT(!label->HasReplacement()); | |
2230 return label->label(); | |
2231 } | |
2232 | |
2233 const ZoneList<Handle<JSFunction> >* inlined_closures() const { | |
2234 return &inlined_closures_; | |
2235 } | |
2236 | |
2237 void AddInlinedClosure(Handle<JSFunction> closure) { | |
2238 inlined_closures_.Add(closure, zone()); | |
2239 } | |
2240 | |
2241 Zone* zone() const { return graph_->zone(); } | |
2242 | |
2243 private: | |
2244 int spill_slot_count_; | |
2245 CompilationInfo* info_; | |
2246 HGraph* const graph_; | |
2247 ZoneList<LInstruction*> instructions_; | |
2248 ZoneList<LPointerMap*> pointer_maps_; | |
2249 ZoneList<Handle<JSFunction> > inlined_closures_; | |
2250 }; | 2198 }; |
2251 | 2199 |
2252 | 2200 |
2253 class LChunkBuilder BASE_EMBEDDED { | 2201 class LChunkBuilder BASE_EMBEDDED { |
2254 public: | 2202 public: |
2255 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator) | 2203 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator) |
2256 : chunk_(NULL), | 2204 : chunk_(NULL), |
2257 info_(info), | 2205 info_(info), |
2258 graph_(graph), | 2206 graph_(graph), |
2259 zone_(graph->zone()), | 2207 zone_(graph->zone()), |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2400 | 2348 |
2401 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2349 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2402 }; | 2350 }; |
2403 | 2351 |
2404 #undef DECLARE_HYDROGEN_ACCESSOR | 2352 #undef DECLARE_HYDROGEN_ACCESSOR |
2405 #undef DECLARE_CONCRETE_INSTRUCTION | 2353 #undef DECLARE_CONCRETE_INSTRUCTION |
2406 | 2354 |
2407 } } // namespace v8::internal | 2355 } } // namespace v8::internal |
2408 | 2356 |
2409 #endif // V8_MIPS_LITHIUM_MIPS_H_ | 2357 #endif // V8_MIPS_LITHIUM_MIPS_H_ |
OLD | NEW |