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

Side by Side Diff: src/ast.cc

Issue 669155: Add an assigned variables analysis.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 9 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 | « src/ast.h ('k') | src/compiler.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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 if (v->CheckStackOverflow()) return; \ 51 if (v->CheckStackOverflow()) return; \
52 v->Visit##type(this); \ 52 v->Visit##type(this); \
53 } 53 }
54 AST_NODE_LIST(DECL_ACCEPT) 54 AST_NODE_LIST(DECL_ACCEPT)
55 #undef DECL_ACCEPT 55 #undef DECL_ACCEPT
56 56
57 57
58 // ---------------------------------------------------------------------------- 58 // ----------------------------------------------------------------------------
59 // Implementation of other node functionality. 59 // Implementation of other node functionality.
60 60
61 Assignment* ExpressionStatement::StatementAsSimpleAssignment() {
62 return (expression()->AsAssignment() != NULL &&
63 !expression()->AsAssignment()->is_compound())
64 ? expression()->AsAssignment()
65 : NULL;
66 }
67
68
69 CountOperation* ExpressionStatement::StatementAsCountOperation() {
70 return expression()->AsCountOperation();
71 }
72
73
61 VariableProxy::VariableProxy(Handle<String> name, 74 VariableProxy::VariableProxy(Handle<String> name,
62 bool is_this, 75 bool is_this,
63 bool inside_with) 76 bool inside_with)
64 : name_(name), 77 : name_(name),
65 var_(NULL), 78 var_(NULL),
66 is_this_(is_this), 79 is_this_(is_this),
67 inside_with_(inside_with) { 80 inside_with_(inside_with),
81 is_trivial_(false) {
68 // names must be canonicalized for fast equality checks 82 // names must be canonicalized for fast equality checks
69 ASSERT(name->IsSymbol()); 83 ASSERT(name->IsSymbol());
70 } 84 }
71 85
72 86
73 VariableProxy::VariableProxy(bool is_this) 87 VariableProxy::VariableProxy(bool is_this)
74 : is_this_(is_this) { 88 : is_this_(is_this) {
75 } 89 }
76 90
77 91
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 if (kInfinity - max_match_ < node_max_match) { 493 if (kInfinity - max_match_ < node_max_match) {
480 max_match_ = kInfinity; 494 max_match_ = kInfinity;
481 } else { 495 } else {
482 max_match_ += node->max_match(); 496 max_match_ += node->max_match();
483 } 497 }
484 } 498 }
485 } 499 }
486 500
487 501
488 } } // namespace v8::internal 502 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ast.h ('k') | src/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698