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

Side by Side Diff: src/ast.cc

Issue 561913002: Class syntax parsing (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/ast.h" 5 #include "src/ast.h"
6 6
7 #include <cmath> // For isfinite. 7 #include <cmath> // For isfinite.
8 #include "src/builtins.h" 8 #include "src/builtins.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/contexts.h" 10 #include "src/contexts.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 shared_info_ = Handle<SharedFunctionInfo>(shared); 166 shared_info_ = Handle<SharedFunctionInfo>(shared);
167 break; 167 break;
168 } 168 }
169 } 169 }
170 } 170 }
171 } 171 }
172 172
173 173
174 ObjectLiteralProperty::ObjectLiteralProperty(Zone* zone, 174 ObjectLiteralProperty::ObjectLiteralProperty(Zone* zone,
175 AstValueFactory* ast_value_factory, 175 AstValueFactory* ast_value_factory,
176 Literal* key, Expression* value) { 176 Literal* key, Expression* value,
177 bool is_static) {
177 emit_store_ = true; 178 emit_store_ = true;
178 key_ = key; 179 key_ = key;
179 value_ = value; 180 value_ = value;
181 is_static_ = is_static;
180 if (key->raw_value()->EqualsString(ast_value_factory->proto_string())) { 182 if (key->raw_value()->EqualsString(ast_value_factory->proto_string())) {
181 kind_ = PROTOTYPE; 183 kind_ = PROTOTYPE;
182 } else if (value_->AsMaterializedLiteral() != NULL) { 184 } else if (value_->AsMaterializedLiteral() != NULL) {
183 kind_ = MATERIALIZED_LITERAL; 185 kind_ = MATERIALIZED_LITERAL;
184 } else if (value_->IsLiteral()) { 186 } else if (value_->IsLiteral()) {
185 kind_ = CONSTANT; 187 kind_ = CONSTANT;
186 } else { 188 } else {
187 kind_ = COMPUTED; 189 kind_ = COMPUTED;
188 } 190 }
189 } 191 }
190 192
191 193
192 ObjectLiteralProperty::ObjectLiteralProperty( 194 ObjectLiteralProperty::ObjectLiteralProperty(Zone* zone, bool is_getter,
193 Zone* zone, bool is_getter, FunctionLiteral* value) { 195 FunctionLiteral* value,
196 bool is_static) {
194 emit_store_ = true; 197 emit_store_ = true;
195 value_ = value; 198 value_ = value;
196 kind_ = is_getter ? GETTER : SETTER; 199 kind_ = is_getter ? GETTER : SETTER;
200 is_static_ = is_static;
197 } 201 }
198 202
199 203
200 bool ObjectLiteral::Property::IsCompileTimeValue() { 204 bool ObjectLiteral::Property::IsCompileTimeValue() {
201 return kind_ == CONSTANT || 205 return kind_ == CONSTANT ||
202 (kind_ == MATERIALIZED_LITERAL && 206 (kind_ == MATERIALIZED_LITERAL &&
203 CompileTimeValue::IsCompileTimeValue(value_)); 207 CompileTimeValue::IsCompileTimeValue(value_));
204 } 208 }
205 209
206 210
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after
1079 DONT_OPTIMIZE_NODE(ExportDeclaration) 1083 DONT_OPTIMIZE_NODE(ExportDeclaration)
1080 DONT_OPTIMIZE_NODE(ModuleVariable) 1084 DONT_OPTIMIZE_NODE(ModuleVariable)
1081 DONT_OPTIMIZE_NODE(ModulePath) 1085 DONT_OPTIMIZE_NODE(ModulePath)
1082 DONT_OPTIMIZE_NODE(ModuleUrl) 1086 DONT_OPTIMIZE_NODE(ModuleUrl)
1083 DONT_OPTIMIZE_NODE(ModuleStatement) 1087 DONT_OPTIMIZE_NODE(ModuleStatement)
1084 DONT_OPTIMIZE_NODE(WithStatement) 1088 DONT_OPTIMIZE_NODE(WithStatement)
1085 DONT_OPTIMIZE_NODE(ForOfStatement) 1089 DONT_OPTIMIZE_NODE(ForOfStatement)
1086 DONT_OPTIMIZE_NODE(TryCatchStatement) 1090 DONT_OPTIMIZE_NODE(TryCatchStatement)
1087 DONT_OPTIMIZE_NODE(TryFinallyStatement) 1091 DONT_OPTIMIZE_NODE(TryFinallyStatement)
1088 DONT_OPTIMIZE_NODE(DebuggerStatement) 1092 DONT_OPTIMIZE_NODE(DebuggerStatement)
1093 DONT_OPTIMIZE_NODE(ClassLiteral)
1089 DONT_OPTIMIZE_NODE(NativeFunctionLiteral) 1094 DONT_OPTIMIZE_NODE(NativeFunctionLiteral)
1090 DONT_OPTIMIZE_NODE(SuperReference) 1095 DONT_OPTIMIZE_NODE(SuperReference)
1091 1096
1092 DONT_OPTIMIZE_NODE_WITH_FEEDBACK_SLOTS(Yield) 1097 DONT_OPTIMIZE_NODE_WITH_FEEDBACK_SLOTS(Yield)
1093 1098
1094 DONT_SELFOPTIMIZE_NODE(DoWhileStatement) 1099 DONT_SELFOPTIMIZE_NODE(DoWhileStatement)
1095 DONT_SELFOPTIMIZE_NODE(WhileStatement) 1100 DONT_SELFOPTIMIZE_NODE(WhileStatement)
1096 DONT_SELFOPTIMIZE_NODE(ForStatement) 1101 DONT_SELFOPTIMIZE_NODE(ForStatement)
1097 1102
1098 DONT_SELFOPTIMIZE_NODE_WITH_FEEDBACK_SLOTS(ForInStatement) 1103 DONT_SELFOPTIMIZE_NODE_WITH_FEEDBACK_SLOTS(ForInStatement)
(...skipping 27 matching lines...) Expand all
1126 SNPrintF(buffer, "%d", Smi::cast(*value())->value()); 1131 SNPrintF(buffer, "%d", Smi::cast(*value())->value());
1127 str = arr; 1132 str = arr;
1128 } else { 1133 } else {
1129 str = DoubleToCString(value()->Number(), buffer); 1134 str = DoubleToCString(value()->Number(), buffer);
1130 } 1135 }
1131 return isolate_->factory()->NewStringFromAsciiChecked(str); 1136 return isolate_->factory()->NewStringFromAsciiChecked(str);
1132 } 1137 }
1133 1138
1134 1139
1135 } } // namespace v8::internal 1140 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698