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

Side by Side Diff: src/data-flow.h

Issue 6849023: Remove unused AssignedVariableAnalyzer. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 8 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/data-flow.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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 return item; 328 return item;
329 } 329 }
330 330
331 private: 331 private:
332 int capacity_; // Including one empty slot. 332 int capacity_; // Including one empty slot.
333 int head_; // Where the first item is. 333 int head_; // Where the first item is.
334 int tail_; // Where the next inserted item will go. 334 int tail_; // Where the next inserted item will go.
335 List<T*> queue_; 335 List<T*> queue_;
336 }; 336 };
337 337
338
339 // Computes the set of assigned variables and annotates variables proxies
340 // that are trivial sub-expressions and for-loops where the loop variable
341 // is guaranteed to be a smi.
342 class AssignedVariablesAnalyzer : public AstVisitor {
343 public:
344 static bool Analyze(CompilationInfo* info);
345
346 private:
347 AssignedVariablesAnalyzer(CompilationInfo* info, int bits);
348 bool Analyze();
349
350 Variable* FindSmiLoopVariable(ForStatement* stmt);
351
352 int BitIndex(Variable* var);
353
354 void RecordAssignedVar(Variable* var);
355
356 void MarkIfTrivial(Expression* expr);
357
358 // Visits an expression saving the accumulator before, clearing
359 // it before visting and restoring it after visiting.
360 void ProcessExpression(Expression* expr);
361
362 // AST node visit functions.
363 #define DECLARE_VISIT(type) virtual void Visit##type(type* node);
364 AST_NODE_LIST(DECLARE_VISIT)
365 #undef DECLARE_VISIT
366
367 CompilationInfo* info_;
368
369 // Accumulator for assigned variables set.
370 BitVector av_;
371
372 DISALLOW_COPY_AND_ASSIGN(AssignedVariablesAnalyzer);
373 };
374
375
376 } } // namespace v8::internal 338 } } // namespace v8::internal
377 339
378 340
379 #endif // V8_DATAFLOW_H_ 341 #endif // V8_DATAFLOW_H_
OLDNEW
« no previous file with comments | « no previous file | src/data-flow.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698