OLD | NEW |
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 Loading... |
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 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1083 // We currently do not optimize any modules. | 1087 // We currently do not optimize any modules. |
1084 DONT_OPTIMIZE_NODE(ModuleDeclaration) | 1088 DONT_OPTIMIZE_NODE(ModuleDeclaration) |
1085 DONT_OPTIMIZE_NODE(ImportDeclaration) | 1089 DONT_OPTIMIZE_NODE(ImportDeclaration) |
1086 DONT_OPTIMIZE_NODE(ExportDeclaration) | 1090 DONT_OPTIMIZE_NODE(ExportDeclaration) |
1087 DONT_OPTIMIZE_NODE(ModuleVariable) | 1091 DONT_OPTIMIZE_NODE(ModuleVariable) |
1088 DONT_OPTIMIZE_NODE(ModulePath) | 1092 DONT_OPTIMIZE_NODE(ModulePath) |
1089 DONT_OPTIMIZE_NODE(ModuleUrl) | 1093 DONT_OPTIMIZE_NODE(ModuleUrl) |
1090 DONT_OPTIMIZE_NODE(ModuleStatement) | 1094 DONT_OPTIMIZE_NODE(ModuleStatement) |
1091 DONT_OPTIMIZE_NODE(WithStatement) | 1095 DONT_OPTIMIZE_NODE(WithStatement) |
1092 DONT_OPTIMIZE_NODE(DebuggerStatement) | 1096 DONT_OPTIMIZE_NODE(DebuggerStatement) |
| 1097 DONT_OPTIMIZE_NODE(ClassLiteral) |
1093 DONT_OPTIMIZE_NODE(NativeFunctionLiteral) | 1098 DONT_OPTIMIZE_NODE(NativeFunctionLiteral) |
1094 DONT_OPTIMIZE_NODE(SuperReference) | 1099 DONT_OPTIMIZE_NODE(SuperReference) |
1095 | 1100 |
1096 DONT_OPTIMIZE_NODE_WITH_FEEDBACK_SLOTS(Yield) | 1101 DONT_OPTIMIZE_NODE_WITH_FEEDBACK_SLOTS(Yield) |
1097 | 1102 |
1098 // TODO(turbofan): Remove the dont_turbofan_reason once this list is empty. | 1103 // TODO(turbofan): Remove the dont_turbofan_reason once this list is empty. |
1099 DONT_TURBOFAN_NODE(ForOfStatement) | 1104 DONT_TURBOFAN_NODE(ForOfStatement) |
1100 DONT_TURBOFAN_NODE(TryCatchStatement) | 1105 DONT_TURBOFAN_NODE(TryCatchStatement) |
1101 DONT_TURBOFAN_NODE(TryFinallyStatement) | 1106 DONT_TURBOFAN_NODE(TryFinallyStatement) |
1102 | 1107 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1135 SNPrintF(buffer, "%d", Smi::cast(*value())->value()); | 1140 SNPrintF(buffer, "%d", Smi::cast(*value())->value()); |
1136 str = arr; | 1141 str = arr; |
1137 } else { | 1142 } else { |
1138 str = DoubleToCString(value()->Number(), buffer); | 1143 str = DoubleToCString(value()->Number(), buffer); |
1139 } | 1144 } |
1140 return isolate_->factory()->NewStringFromAsciiChecked(str); | 1145 return isolate_->factory()->NewStringFromAsciiChecked(str); |
1141 } | 1146 } |
1142 | 1147 |
1143 | 1148 |
1144 } } // namespace v8::internal | 1149 } } // namespace v8::internal |
OLD | NEW |