Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(596)

Side by Side Diff: src/arm/lithium-arm.h

Issue 10701141: Remove duplicated LChunk code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix nits. Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/arm/lithium-arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2204 matching lines...) Expand 10 before | Expand all | Expand 10 after
2215 } 2215 }
2216 2216
2217 LOperand* object() { return inputs_[0]; } 2217 LOperand* object() { return inputs_[0]; }
2218 LOperand* index() { return inputs_[1]; } 2218 LOperand* index() { return inputs_[1]; }
2219 2219
2220 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex, "load-field-by-index") 2220 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex, "load-field-by-index")
2221 }; 2221 };
2222 2222
2223 2223
2224 class LChunkBuilder; 2224 class LChunkBuilder;
2225 class LChunk: public ZoneObject { 2225 class LChunk: public LChunkBase {
2226 public: 2226 public:
2227 explicit LChunk(CompilationInfo* info, HGraph* graph); 2227 explicit LChunk(CompilationInfo* info, HGraph* graph)
2228 2228 : LChunkBase(info, graph) { }
2229 void AddInstruction(LInstruction* instruction, HBasicBlock* block);
2230 LConstantOperand* DefineConstantOperand(HConstant* constant);
2231 Handle<Object> LookupLiteral(LConstantOperand* operand) const;
2232 Representation LookupLiteralRepresentation(LConstantOperand* operand) const;
2233 2229
2234 int GetNextSpillIndex(bool is_double); 2230 int GetNextSpillIndex(bool is_double);
2235 LOperand* GetNextSpillSlot(bool is_double); 2231 LOperand* GetNextSpillSlot(bool is_double);
2236
2237 int ParameterAt(int index);
2238 int GetParameterStackSlot(int index) const;
2239 int spill_slot_count() const { return spill_slot_count_; }
2240 CompilationInfo* info() const { return info_; }
2241 HGraph* graph() const { return graph_; }
2242 const ZoneList<LInstruction*>* instructions() const { return &instructions_; }
2243 void AddGapMove(int index, LOperand* from, LOperand* to);
2244 LGap* GetGapAt(int index) const;
2245 bool IsGapAt(int index) const;
2246 int NearestGapPos(int index) const;
2247 void MarkEmptyBlocks();
2248 const ZoneList<LPointerMap*>* pointer_maps() const { return &pointer_maps_; }
2249 LLabel* GetLabel(int block_id) const {
2250 HBasicBlock* block = graph_->blocks()->at(block_id);
2251 int first_instruction = block->first_instruction_index();
2252 return LLabel::cast(instructions_[first_instruction]);
2253 }
2254 int LookupDestination(int block_id) const {
2255 LLabel* cur = GetLabel(block_id);
2256 while (cur->replacement() != NULL) {
2257 cur = cur->replacement();
2258 }
2259 return cur->block_id();
2260 }
2261 Label* GetAssemblyLabel(int block_id) const {
2262 LLabel* label = GetLabel(block_id);
2263 ASSERT(!label->HasReplacement());
2264 return label->label();
2265 }
2266
2267 const ZoneList<Handle<JSFunction> >* inlined_closures() const {
2268 return &inlined_closures_;
2269 }
2270
2271 void AddInlinedClosure(Handle<JSFunction> closure) {
2272 inlined_closures_.Add(closure, zone());
2273 }
2274
2275 Zone* zone() const { return graph_->zone(); }
2276
2277 private:
2278 int spill_slot_count_;
2279 CompilationInfo* info_;
2280 HGraph* const graph_;
2281 ZoneList<LInstruction*> instructions_;
2282 ZoneList<LPointerMap*> pointer_maps_;
2283 ZoneList<Handle<JSFunction> > inlined_closures_;
2284 }; 2232 };
2285 2233
2286 2234
2287 class LChunkBuilder BASE_EMBEDDED { 2235 class LChunkBuilder BASE_EMBEDDED {
2288 public: 2236 public:
2289 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator) 2237 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator)
2290 : chunk_(NULL), 2238 : chunk_(NULL),
2291 info_(info), 2239 info_(info),
2292 graph_(graph), 2240 graph_(graph),
2293 zone_(graph->zone()), 2241 zone_(graph->zone()),
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
2437 2385
2438 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2386 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2439 }; 2387 };
2440 2388
2441 #undef DECLARE_HYDROGEN_ACCESSOR 2389 #undef DECLARE_HYDROGEN_ACCESSOR
2442 #undef DECLARE_CONCRETE_INSTRUCTION 2390 #undef DECLARE_CONCRETE_INSTRUCTION
2443 2391
2444 } } // namespace v8::internal 2392 } } // namespace v8::internal
2445 2393
2446 #endif // V8_ARM_LITHIUM_ARM_H_ 2394 #endif // V8_ARM_LITHIUM_ARM_H_
OLDNEW
« no previous file with comments | « no previous file | src/arm/lithium-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698