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

Side by Side Diff: src/compiler/ast-graph-builder.cc

Issue 807173002: ES6 computed property names (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 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
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/compiler/ast-graph-builder.h" 5 #include "src/compiler/ast-graph-builder.h"
6 6
7 #include "src/compiler.h" 7 #include "src/compiler.h"
8 #include "src/compiler/ast-loop-assignment-analyzer.h" 8 #include "src/compiler/ast-loop-assignment-analyzer.h"
9 #include "src/compiler/control-builders.h" 9 #include "src/compiler/control-builders.h"
10 #include "src/compiler/machine-operator.h" 10 #include "src/compiler/machine-operator.h"
(...skipping 892 matching lines...) Expand 10 before | Expand all | Expand 10 after
903 // a later occurrence of the same key. For the marked expressions, no store 903 // a later occurrence of the same key. For the marked expressions, no store
904 // code is emitted. 904 // code is emitted.
905 expr->CalculateEmitStore(zone()); 905 expr->CalculateEmitStore(zone());
906 906
907 // Create nodes to store computed values into the literal. 907 // Create nodes to store computed values into the literal.
908 AccessorTable accessor_table(zone()); 908 AccessorTable accessor_table(zone());
909 for (int i = 0; i < expr->properties()->length(); i++) { 909 for (int i = 0; i < expr->properties()->length(); i++) {
910 ObjectLiteral::Property* property = expr->properties()->at(i); 910 ObjectLiteral::Property* property = expr->properties()->at(i);
911 if (property->IsCompileTimeValue()) continue; 911 if (property->IsCompileTimeValue()) continue;
912 912
913 Literal* key = property->key(); 913 Literal* key = property->key()->AsLiteral();
914 switch (property->kind()) { 914 switch (property->kind()) {
915 case ObjectLiteral::Property::CONSTANT: 915 case ObjectLiteral::Property::CONSTANT:
916 UNREACHABLE(); 916 UNREACHABLE();
917 case ObjectLiteral::Property::MATERIALIZED_LITERAL: 917 case ObjectLiteral::Property::MATERIALIZED_LITERAL:
918 DCHECK(!CompileTimeValue::IsCompileTimeValue(property->value())); 918 DCHECK(!CompileTimeValue::IsCompileTimeValue(property->value()));
919 // Fall through. 919 // Fall through.
920 case ObjectLiteral::Property::COMPUTED: { 920 case ObjectLiteral::Property::COMPUTED: {
921 // It is safe to use [[Put]] here because the boilerplate already 921 // It is safe to use [[Put]] here because the boilerplate already
922 // contains computed properties with an uninitialized value. 922 // contains computed properties with an uninitialized value.
923 if (key->value()->IsInternalizedString()) { 923 if (key->value()->IsInternalizedString()) {
(...skipping 1298 matching lines...) Expand 10 before | Expand all | Expand 10 after
2222 2222
2223 BitVector* AstGraphBuilder::GetVariablesAssignedInLoop( 2223 BitVector* AstGraphBuilder::GetVariablesAssignedInLoop(
2224 IterationStatement* stmt) { 2224 IterationStatement* stmt) {
2225 if (loop_assignment_analysis_ == NULL) return NULL; 2225 if (loop_assignment_analysis_ == NULL) return NULL;
2226 return loop_assignment_analysis_->GetVariablesAssignedInLoop(stmt); 2226 return loop_assignment_analysis_->GetVariablesAssignedInLoop(stmt);
2227 } 2227 }
2228 2228
2229 } // namespace compiler 2229 } // namespace compiler
2230 } // namespace internal 2230 } // namespace internal
2231 } // namespace v8 2231 } // namespace v8
OLDNEW
« no previous file with comments | « src/builtins.h ('k') | src/flag-definitions.h » ('j') | src/ia32/full-codegen-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698