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

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

Issue 896643003: Class methods should be non enumerable (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Use LanguageMode Created 5 years, 10 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
« no previous file with comments | « src/arm64/full-codegen-arm64.cc ('k') | src/ia32/full-codegen-ia32.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 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/linkage.h" 10 #include "src/compiler/linkage.h"
(...skipping 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after
1336 case ObjectLiteral::Property::MATERIALIZED_LITERAL: 1336 case ObjectLiteral::Property::MATERIALIZED_LITERAL:
1337 case ObjectLiteral::Property::PROTOTYPE: 1337 case ObjectLiteral::Property::PROTOTYPE:
1338 UNREACHABLE(); 1338 UNREACHABLE();
1339 case ObjectLiteral::Property::COMPUTED: { 1339 case ObjectLiteral::Property::COMPUTED: {
1340 const Operator* op = 1340 const Operator* op =
1341 javascript()->CallRuntime(Runtime::kDefineClassMethod, 3); 1341 javascript()->CallRuntime(Runtime::kDefineClassMethod, 3);
1342 NewNode(op, receiver, key, value); 1342 NewNode(op, receiver, key, value);
1343 break; 1343 break;
1344 } 1344 }
1345 case ObjectLiteral::Property::GETTER: { 1345 case ObjectLiteral::Property::GETTER: {
1346 Node* attr = jsgraph()->Constant(DONT_ENUM);
1346 const Operator* op = javascript()->CallRuntime( 1347 const Operator* op = javascript()->CallRuntime(
1347 Runtime::kDefineGetterPropertyUnchecked, 3); 1348 Runtime::kDefineGetterPropertyUnchecked, 4);
1348 NewNode(op, receiver, key, value); 1349 NewNode(op, receiver, key, value, attr);
1349 break; 1350 break;
1350 } 1351 }
1351 case ObjectLiteral::Property::SETTER: { 1352 case ObjectLiteral::Property::SETTER: {
1353 Node* attr = jsgraph()->Constant(DONT_ENUM);
1352 const Operator* op = javascript()->CallRuntime( 1354 const Operator* op = javascript()->CallRuntime(
1353 Runtime::kDefineSetterPropertyUnchecked, 3); 1355 Runtime::kDefineSetterPropertyUnchecked, 4);
1354 NewNode(op, receiver, key, value); 1356 NewNode(op, receiver, key, value, attr);
1355 break; 1357 break;
1356 } 1358 }
1357 } 1359 }
1358 1360
1359 // TODO(mstarzinger): This is temporary to make "super" work and replicates 1361 // TODO(mstarzinger): This is temporary to make "super" work and replicates
1360 // the existing FullCodeGenerator::NeedsHomeObject predicate. 1362 // the existing FullCodeGenerator::NeedsHomeObject predicate.
1361 if (FunctionLiteral::NeedsHomeObject(property->value())) { 1363 if (FunctionLiteral::NeedsHomeObject(property->value())) {
1362 Unique<Name> name = 1364 Unique<Name> name =
1363 MakeUnique(isolate()->factory()->home_object_symbol()); 1365 MakeUnique(isolate()->factory()->home_object_symbol());
1364 Node* store = NewNode(javascript()->StoreNamed(language_mode(), name), 1366 Node* store = NewNode(javascript()->StoreNamed(language_mode(), name),
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
1580 break; 1582 break;
1581 } 1583 }
1582 case ObjectLiteral::Property::PROTOTYPE: { 1584 case ObjectLiteral::Property::PROTOTYPE: {
1583 const Operator* op = 1585 const Operator* op =
1584 javascript()->CallRuntime(Runtime::kInternalSetPrototype, 2); 1586 javascript()->CallRuntime(Runtime::kInternalSetPrototype, 2);
1585 Node* call = NewNode(op, receiver, value); 1587 Node* call = NewNode(op, receiver, value);
1586 PrepareFrameState(call, BailoutId::None()); 1588 PrepareFrameState(call, BailoutId::None());
1587 break; 1589 break;
1588 } 1590 }
1589 case ObjectLiteral::Property::GETTER: { 1591 case ObjectLiteral::Property::GETTER: {
1592 Node* attr = jsgraph()->Constant(NONE);
1590 const Operator* op = javascript()->CallRuntime( 1593 const Operator* op = javascript()->CallRuntime(
1591 Runtime::kDefineGetterPropertyUnchecked, 3); 1594 Runtime::kDefineGetterPropertyUnchecked, 4);
1592 Node* call = NewNode(op, receiver, key, value); 1595 Node* call = NewNode(op, receiver, key, value, attr);
1593 PrepareFrameState(call, BailoutId::None()); 1596 PrepareFrameState(call, BailoutId::None());
1594 break; 1597 break;
1595 } 1598 }
1596 case ObjectLiteral::Property::SETTER: { 1599 case ObjectLiteral::Property::SETTER: {
1600 Node* attr = jsgraph()->Constant(NONE);
1597 const Operator* op = javascript()->CallRuntime( 1601 const Operator* op = javascript()->CallRuntime(
1598 Runtime::kDefineSetterPropertyUnchecked, 3); 1602 Runtime::kDefineSetterPropertyUnchecked, 4);
1599 Node* call = NewNode(op, receiver, key, value); 1603 Node* call = NewNode(op, receiver, key, value, attr);
1600 PrepareFrameState(call, BailoutId::None()); 1604 PrepareFrameState(call, BailoutId::None());
1601 break; 1605 break;
1602 } 1606 }
1603 } 1607 }
1604 } 1608 }
1605 1609
1606 // Transform literals that contain functions to fast properties. 1610 // Transform literals that contain functions to fast properties.
1607 if (expr->has_function()) { 1611 if (expr->has_function()) {
1608 const Operator* op = 1612 const Operator* op =
1609 javascript()->CallRuntime(Runtime::kToFastProperties, 1); 1613 javascript()->CallRuntime(Runtime::kToFastProperties, 1);
(...skipping 1514 matching lines...) Expand 10 before | Expand all | Expand 10 after
3124 Node* dead_node = graph()->NewNode(common()->Dead()); 3128 Node* dead_node = graph()->NewNode(common()->Dead());
3125 dead_control_.set(dead_node); 3129 dead_control_.set(dead_node);
3126 return dead_node; 3130 return dead_node;
3127 } 3131 }
3128 return dead_control_.get(); 3132 return dead_control_.get();
3129 } 3133 }
3130 3134
3131 } // namespace compiler 3135 } // namespace compiler
3132 } // namespace internal 3136 } // namespace internal
3133 } // namespace v8 3137 } // namespace v8
OLDNEW
« no previous file with comments | « src/arm64/full-codegen-arm64.cc ('k') | src/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698