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

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

Issue 1189153002: Revert of [strong] Implement strong mode restrictions on property access (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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/code-stubs-hydrogen.cc ('k') | src/compiler/js-generic-lowering.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/js-type-feedback.h" 10 #include "src/compiler/js-type-feedback.h"
(...skipping 3441 matching lines...) Expand 10 before | Expand all | Expand 10 after
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, language_mode()); 3462 const Operator* op = javascript()->LoadProperty(feedback);
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 = javascript()->LoadNamed(MakeUnique(name), feedback, 3471 const Operator* op =
3472 language_mode(), mode); 3472 javascript()->LoadNamed(MakeUnique(name), feedback, 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 Node* language = jsgraph()->Constant(language_mode()); 3497 const Operator* op = javascript()->CallRuntime(Runtime::kLoadFromSuper, 3);
3498 const Operator* op = javascript()->CallRuntime(Runtime::kLoadFromSuper, 4); 3498 Node* value = NewNode(op, receiver, home_object, name_node);
3499 Node* value = NewNode(op, receiver, home_object, name_node, language);
3500 return Record(js_type_feedback_, value, feedback.slot()); 3499 return Record(js_type_feedback_, value, feedback.slot());
3501 } 3500 }
3502 3501
3503 3502
3504 Node* AstGraphBuilder::BuildKeyedSuperLoad( 3503 Node* AstGraphBuilder::BuildKeyedSuperLoad(
3505 Node* receiver, Node* home_object, Node* key, 3504 Node* receiver, Node* home_object, Node* key,
3506 const ResolvedFeedbackSlot& feedback) { 3505 const ResolvedFeedbackSlot& feedback) {
3507 Node* language = jsgraph()->Constant(language_mode());
3508 const Operator* op = 3506 const Operator* op =
3509 javascript()->CallRuntime(Runtime::kLoadKeyedFromSuper, 4); 3507 javascript()->CallRuntime(Runtime::kLoadKeyedFromSuper, 3);
3510 Node* value = NewNode(op, receiver, home_object, key, language); 3508 Node* value = NewNode(op, receiver, home_object, key);
3511 return Record(js_type_feedback_, value, feedback.slot()); 3509 return Record(js_type_feedback_, value, feedback.slot());
3512 } 3510 }
3513 3511
3514 3512
3515 Node* AstGraphBuilder::BuildKeyedSuperStore(Node* receiver, Node* home_object, 3513 Node* AstGraphBuilder::BuildKeyedSuperStore(Node* receiver, Node* home_object,
3516 Node* key, Node* value, 3514 Node* key, Node* value,
3517 TypeFeedbackId id) { 3515 TypeFeedbackId id) {
3518 Runtime::FunctionId function_id = is_strict(language_mode()) 3516 Runtime::FunctionId function_id = is_strict(language_mode())
3519 ? Runtime::kStoreKeyedToSuper_Strict 3517 ? Runtime::kStoreKeyedToSuper_Strict
3520 : Runtime::kStoreKeyedToSuper_Sloppy; 3518 : Runtime::kStoreKeyedToSuper_Sloppy;
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after
4078 // Phi does not exist yet, introduce one. 4076 // Phi does not exist yet, introduce one.
4079 value = NewPhi(inputs, value, control); 4077 value = NewPhi(inputs, value, control);
4080 value->ReplaceInput(inputs - 1, other); 4078 value->ReplaceInput(inputs - 1, other);
4081 } 4079 }
4082 return value; 4080 return value;
4083 } 4081 }
4084 4082
4085 } // namespace compiler 4083 } // namespace compiler
4086 } // namespace internal 4084 } // namespace internal
4087 } // namespace v8 4085 } // namespace v8
OLDNEW
« no previous file with comments | « src/code-stubs-hydrogen.cc ('k') | src/compiler/js-generic-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698