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

Side by Side Diff: src/ast.cc

Issue 8688007: Statically check for assignments to const in harmony mode. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed second round of comments. Created 9 years 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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 return AsLiteral() != NULL && AsLiteral()->handle()->IsNull(); 63 return AsLiteral() != NULL && AsLiteral()->handle()->IsNull();
64 } 64 }
65 65
66 66
67 VariableProxy::VariableProxy(Isolate* isolate, Variable* var) 67 VariableProxy::VariableProxy(Isolate* isolate, Variable* var)
68 : Expression(isolate), 68 : Expression(isolate),
69 name_(var->name()), 69 name_(var->name()),
70 var_(NULL), // Will be set by the call to BindTo. 70 var_(NULL), // Will be set by the call to BindTo.
71 is_this_(var->is_this()), 71 is_this_(var->is_this()),
72 is_trivial_(false), 72 is_trivial_(false),
73 is_lvalue_(false),
73 position_(RelocInfo::kNoPosition) { 74 position_(RelocInfo::kNoPosition) {
74 BindTo(var); 75 BindTo(var);
75 } 76 }
76 77
77 78
78 VariableProxy::VariableProxy(Isolate* isolate, 79 VariableProxy::VariableProxy(Isolate* isolate,
79 Handle<String> name, 80 Handle<String> name,
80 bool is_this, 81 bool is_this,
81 int position) 82 int position)
82 : Expression(isolate), 83 : Expression(isolate),
83 name_(name), 84 name_(name),
84 var_(NULL), 85 var_(NULL),
85 is_this_(is_this), 86 is_this_(is_this),
86 is_trivial_(false), 87 is_trivial_(false),
88 is_lvalue_(false),
87 position_(position) { 89 position_(position) {
88 // Names must be canonicalized for fast equality checks. 90 // Names must be canonicalized for fast equality checks.
89 ASSERT(name->IsSymbol()); 91 ASSERT(name->IsSymbol());
90 } 92 }
91 93
92 94
93 void VariableProxy::BindTo(Variable* var) { 95 void VariableProxy::BindTo(Variable* var) {
94 ASSERT(var_ == NULL); // must be bound only once 96 ASSERT(var_ == NULL); // must be bound only once
95 ASSERT(var != NULL); // must bind 97 ASSERT(var != NULL); // must bind
96 ASSERT((is_this() && var->is_this()) || name_.is_identical_to(var->name())); 98 ASSERT((is_this() && var->is_this()) || name_.is_identical_to(var->name()));
(...skipping 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after
1208 int pos) 1210 int pos)
1209 : label_(label), 1211 : label_(label),
1210 statements_(statements), 1212 statements_(statements),
1211 position_(pos), 1213 position_(pos),
1212 compare_type_(NONE), 1214 compare_type_(NONE),
1213 compare_id_(AstNode::GetNextId(isolate)), 1215 compare_id_(AstNode::GetNextId(isolate)),
1214 entry_id_(AstNode::GetNextId(isolate)) { 1216 entry_id_(AstNode::GetNextId(isolate)) {
1215 } 1217 }
1216 1218
1217 } } // namespace v8::internal 1219 } } // 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