OLD | NEW |
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 1390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1401 // during evaluation of the method values. | 1401 // during evaluation of the method values. |
1402 environment()->Push(literal); | 1402 environment()->Push(literal); |
1403 environment()->Push(proto); | 1403 environment()->Push(proto); |
1404 | 1404 |
1405 // Create nodes to store method values into the literal. | 1405 // Create nodes to store method values into the literal. |
1406 for (int i = 0; i < expr->properties()->length(); i++) { | 1406 for (int i = 0; i < expr->properties()->length(); i++) { |
1407 ObjectLiteral::Property* property = expr->properties()->at(i); | 1407 ObjectLiteral::Property* property = expr->properties()->at(i); |
1408 environment()->Push(property->is_static() ? literal : proto); | 1408 environment()->Push(property->is_static() ? literal : proto); |
1409 | 1409 |
1410 VisitForValue(property->key()); | 1410 VisitForValue(property->key()); |
1411 environment()->Push( | 1411 Node* name = BuildToName(environment()->Pop(), expr->GetIdForProperty(i)); |
1412 BuildToName(environment()->Pop(), expr->GetIdForProperty(i))); | 1412 environment()->Push(name); |
1413 | 1413 |
1414 // The static prototype property is read only. We handle the non computed | 1414 // The static prototype property is read only. We handle the non computed |
1415 // property name case in the parser. Since this is the only case where we | 1415 // property name case in the parser. Since this is the only case where we |
1416 // need to check for an own read only property we special case this so we do | 1416 // need to check for an own read only property we special case this so we do |
1417 // not need to do this for every property. | 1417 // not need to do this for every property. |
1418 if (property->is_static() && property->is_computed_name()) { | 1418 if (property->is_static() && property->is_computed_name()) { |
1419 Node* name = environment()->Pop(); | 1419 Node* check = BuildThrowIfStaticPrototype(environment()->Pop(), |
1420 environment()->Push( | 1420 expr->GetIdForProperty(i)); |
1421 BuildThrowIfStaticPrototype(name, expr->GetIdForProperty(i))); | 1421 environment()->Push(check); |
1422 } | 1422 } |
1423 | 1423 |
1424 VisitForValue(property->value()); | 1424 VisitForValue(property->value()); |
1425 Node* value = environment()->Pop(); | 1425 Node* value = environment()->Pop(); |
1426 Node* key = environment()->Pop(); | 1426 Node* key = environment()->Pop(); |
1427 Node* receiver = environment()->Pop(); | 1427 Node* receiver = environment()->Pop(); |
1428 BuildSetHomeObject(value, receiver, property->value()); | 1428 BuildSetHomeObject(value, receiver, property->value()); |
1429 | 1429 |
1430 switch (property->kind()) { | 1430 switch (property->kind()) { |
1431 case ObjectLiteral::Property::CONSTANT: | 1431 case ObjectLiteral::Property::CONSTANT: |
(...skipping 1921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3353 // Phi does not exist yet, introduce one. | 3353 // Phi does not exist yet, introduce one. |
3354 value = NewPhi(inputs, value, control); | 3354 value = NewPhi(inputs, value, control); |
3355 value->ReplaceInput(inputs - 1, other); | 3355 value->ReplaceInput(inputs - 1, other); |
3356 } | 3356 } |
3357 return value; | 3357 return value; |
3358 } | 3358 } |
3359 | 3359 |
3360 } // namespace compiler | 3360 } // namespace compiler |
3361 } // namespace internal | 3361 } // namespace internal |
3362 } // namespace v8 | 3362 } // namespace v8 |
OLD | NEW |