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/js-type-feedback.h" | 10 #include "src/compiler/js-type-feedback.h" |
(...skipping 3441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3452 TypeFeedbackId id) { | 3452 TypeFeedbackId id) { |
3453 if (js_type_feedback) { | 3453 if (js_type_feedback) { |
3454 js_type_feedback->Record(node, id); | 3454 js_type_feedback->Record(node, id); |
3455 } | 3455 } |
3456 return node; | 3456 return node; |
3457 } | 3457 } |
3458 | 3458 |
3459 | 3459 |
3460 Node* AstGraphBuilder::BuildKeyedLoad(Node* object, Node* key, | 3460 Node* AstGraphBuilder::BuildKeyedLoad(Node* object, Node* key, |
3461 const ResolvedFeedbackSlot& feedback) { | 3461 const ResolvedFeedbackSlot& feedback) { |
3462 const Operator* op = javascript()->LoadProperty(feedback); | 3462 const Operator* op = javascript()->LoadProperty(feedback, language_mode()); |
3463 return Record(js_type_feedback_, | 3463 return Record(js_type_feedback_, |
3464 NewNode(op, object, key, GetFeedbackVector()), feedback.slot()); | 3464 NewNode(op, object, key, GetFeedbackVector()), feedback.slot()); |
3465 } | 3465 } |
3466 | 3466 |
3467 | 3467 |
3468 Node* AstGraphBuilder::BuildNamedLoad(Node* object, Handle<Name> name, | 3468 Node* AstGraphBuilder::BuildNamedLoad(Node* object, Handle<Name> name, |
3469 const ResolvedFeedbackSlot& feedback, | 3469 const ResolvedFeedbackSlot& feedback, |
3470 ContextualMode mode) { | 3470 ContextualMode mode) { |
3471 const Operator* op = | 3471 const Operator* op = javascript()->LoadNamed(MakeUnique(name), feedback, |
3472 javascript()->LoadNamed(MakeUnique(name), feedback, mode); | 3472 language_mode(), mode); |
3473 return Record(js_type_feedback_, NewNode(op, object, GetFeedbackVector()), | 3473 return Record(js_type_feedback_, NewNode(op, object, GetFeedbackVector()), |
3474 feedback.slot()); | 3474 feedback.slot()); |
3475 } | 3475 } |
3476 | 3476 |
3477 | 3477 |
3478 Node* AstGraphBuilder::BuildKeyedStore(Node* object, Node* key, Node* value, | 3478 Node* AstGraphBuilder::BuildKeyedStore(Node* object, Node* key, Node* value, |
3479 TypeFeedbackId id) { | 3479 TypeFeedbackId id) { |
3480 const Operator* op = javascript()->StoreProperty(language_mode()); | 3480 const Operator* op = javascript()->StoreProperty(language_mode()); |
3481 return Record(js_type_feedback_, NewNode(op, object, key, value), id); | 3481 return Record(js_type_feedback_, NewNode(op, object, key, value), id); |
3482 } | 3482 } |
3483 | 3483 |
3484 | 3484 |
3485 Node* AstGraphBuilder::BuildNamedStore(Node* object, Handle<Name> name, | 3485 Node* AstGraphBuilder::BuildNamedStore(Node* object, Handle<Name> name, |
3486 Node* value, TypeFeedbackId id) { | 3486 Node* value, TypeFeedbackId id) { |
3487 const Operator* op = | 3487 const Operator* op = |
3488 javascript()->StoreNamed(language_mode(), MakeUnique(name)); | 3488 javascript()->StoreNamed(language_mode(), MakeUnique(name)); |
3489 return Record(js_type_feedback_, NewNode(op, object, value), id); | 3489 return Record(js_type_feedback_, NewNode(op, object, value), id); |
3490 } | 3490 } |
3491 | 3491 |
3492 | 3492 |
3493 Node* AstGraphBuilder::BuildNamedSuperLoad( | 3493 Node* AstGraphBuilder::BuildNamedSuperLoad( |
3494 Node* receiver, Node* home_object, Handle<Name> name, | 3494 Node* receiver, Node* home_object, Handle<Name> name, |
3495 const ResolvedFeedbackSlot& feedback) { | 3495 const ResolvedFeedbackSlot& feedback) { |
3496 Node* name_node = jsgraph()->Constant(name); | 3496 Node* name_node = jsgraph()->Constant(name); |
3497 const Operator* op = javascript()->CallRuntime(Runtime::kLoadFromSuper, 3); | 3497 Node* language = jsgraph()->Constant(language_mode()); |
3498 Node* value = NewNode(op, receiver, home_object, name_node); | 3498 const Operator* op = javascript()->CallRuntime(Runtime::kLoadFromSuper, 4); |
| 3499 Node* value = NewNode(op, receiver, home_object, name_node, language); |
3499 return Record(js_type_feedback_, value, feedback.slot()); | 3500 return Record(js_type_feedback_, value, feedback.slot()); |
3500 } | 3501 } |
3501 | 3502 |
3502 | 3503 |
3503 Node* AstGraphBuilder::BuildKeyedSuperLoad( | 3504 Node* AstGraphBuilder::BuildKeyedSuperLoad( |
3504 Node* receiver, Node* home_object, Node* key, | 3505 Node* receiver, Node* home_object, Node* key, |
3505 const ResolvedFeedbackSlot& feedback) { | 3506 const ResolvedFeedbackSlot& feedback) { |
| 3507 Node* language = jsgraph()->Constant(language_mode()); |
3506 const Operator* op = | 3508 const Operator* op = |
3507 javascript()->CallRuntime(Runtime::kLoadKeyedFromSuper, 3); | 3509 javascript()->CallRuntime(Runtime::kLoadKeyedFromSuper, 4); |
3508 Node* value = NewNode(op, receiver, home_object, key); | 3510 Node* value = NewNode(op, receiver, home_object, key, language); |
3509 return Record(js_type_feedback_, value, feedback.slot()); | 3511 return Record(js_type_feedback_, value, feedback.slot()); |
3510 } | 3512 } |
3511 | 3513 |
3512 | 3514 |
3513 Node* AstGraphBuilder::BuildKeyedSuperStore(Node* receiver, Node* home_object, | 3515 Node* AstGraphBuilder::BuildKeyedSuperStore(Node* receiver, Node* home_object, |
3514 Node* key, Node* value, | 3516 Node* key, Node* value, |
3515 TypeFeedbackId id) { | 3517 TypeFeedbackId id) { |
3516 Runtime::FunctionId function_id = is_strict(language_mode()) | 3518 Runtime::FunctionId function_id = is_strict(language_mode()) |
3517 ? Runtime::kStoreKeyedToSuper_Strict | 3519 ? Runtime::kStoreKeyedToSuper_Strict |
3518 : Runtime::kStoreKeyedToSuper_Sloppy; | 3520 : Runtime::kStoreKeyedToSuper_Sloppy; |
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4076 // Phi does not exist yet, introduce one. | 4078 // Phi does not exist yet, introduce one. |
4077 value = NewPhi(inputs, value, control); | 4079 value = NewPhi(inputs, value, control); |
4078 value->ReplaceInput(inputs - 1, other); | 4080 value->ReplaceInput(inputs - 1, other); |
4079 } | 4081 } |
4080 return value; | 4082 return value; |
4081 } | 4083 } |
4082 | 4084 |
4083 } // namespace compiler | 4085 } // namespace compiler |
4084 } // namespace internal | 4086 } // namespace internal |
4085 } // namespace v8 | 4087 } // namespace v8 |
OLD | NEW |