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

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

Issue 1131713004: Revert of Remove Scope::scope_uses_this_ flag (Closed) Base URL: https://chromium.googlesource.com/v8/v8@master
Patch Set: Created 5 years, 7 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/compiler.cc ('k') | src/preparser.h » ('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 2643 matching lines...) Expand 10 before | Expand all | Expand 10 after
2654 return value; 2654 return value;
2655 } 2655 }
2656 2656
2657 2657
2658 Node* AstGraphBuilder::BuildPatchReceiverToGlobalProxy(Node* receiver) { 2658 Node* AstGraphBuilder::BuildPatchReceiverToGlobalProxy(Node* receiver) {
2659 // Sloppy mode functions and builtins need to replace the receiver with the 2659 // Sloppy mode functions and builtins need to replace the receiver with the
2660 // global proxy when called as functions (without an explicit receiver 2660 // global proxy when called as functions (without an explicit receiver
2661 // object). Otherwise there is nothing left to do here. 2661 // object). Otherwise there is nothing left to do here.
2662 if (is_strict(language_mode()) || info()->is_native()) return receiver; 2662 if (is_strict(language_mode()) || info()->is_native()) return receiver;
2663 2663
2664 // There is no need to perform patching if the receiver will never be used. 2664 // There is no need to perform patching if the receiver is never used. Note
2665 // that scope predicates are purely syntactical, a call to eval might still
2666 // inspect the receiver value.
2665 if (!info()->MayUseThis()) return receiver; 2667 if (!info()->MayUseThis()) return receiver;
2666 2668
2667 IfBuilder receiver_check(this); 2669 IfBuilder receiver_check(this);
2668 Node* undefined = jsgraph()->UndefinedConstant(); 2670 Node* undefined = jsgraph()->UndefinedConstant();
2669 Node* check = NewNode(javascript()->StrictEqual(), receiver, undefined); 2671 Node* check = NewNode(javascript()->StrictEqual(), receiver, undefined);
2670 receiver_check.If(check); 2672 receiver_check.If(check);
2671 receiver_check.Then(); 2673 receiver_check.Then();
2672 Node* proxy = BuildLoadGlobalProxy(); 2674 Node* proxy = BuildLoadGlobalProxy();
2673 environment()->Push(proxy); 2675 environment()->Push(proxy);
2674 receiver_check.Else(); 2676 receiver_check.Else();
(...skipping 924 matching lines...) Expand 10 before | Expand all | Expand 10 after
3599 // Phi does not exist yet, introduce one. 3601 // Phi does not exist yet, introduce one.
3600 value = NewPhi(inputs, value, control); 3602 value = NewPhi(inputs, value, control);
3601 value->ReplaceInput(inputs - 1, other); 3603 value->ReplaceInput(inputs - 1, other);
3602 } 3604 }
3603 return value; 3605 return value;
3604 } 3606 }
3605 3607
3606 } // namespace compiler 3608 } // namespace compiler
3607 } // namespace internal 3609 } // namespace internal
3608 } // namespace v8 3610 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler.cc ('k') | src/preparser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698