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

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

Issue 1484723003: [runtime] Use "the hole" instead of smi 0 as sentinel for context extension. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comment. Created 5 years 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-typed-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/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/compiler.h" 8 #include "src/compiler.h"
9 #include "src/compiler/ast-loop-assignment-analyzer.h" 9 #include "src/compiler/ast-loop-assignment-analyzer.h"
10 #include "src/compiler/control-builders.h" 10 #include "src/compiler/control-builders.h"
(...skipping 3840 matching lines...) Expand 10 before | Expand all | Expand 10 after
3851 environment()->Pop(); 3851 environment()->Pop();
3852 fast_block.BeginBlock(); 3852 fast_block.BeginBlock();
3853 3853
3854 // Perform checks whether the fast mode applies, by looking for any 3854 // Perform checks whether the fast mode applies, by looking for any
3855 // extension object which might shadow the optimistic declaration. 3855 // extension object which might shadow the optimistic declaration.
3856 for (int depth = 0; bitset != 0; bitset >>= 1, depth++) { 3856 for (int depth = 0; bitset != 0; bitset >>= 1, depth++) {
3857 if ((bitset & 1) == 0) continue; 3857 if ((bitset & 1) == 0) continue;
3858 Node* load = NewNode( 3858 Node* load = NewNode(
3859 javascript()->LoadContext(depth, Context::EXTENSION_INDEX, false), 3859 javascript()->LoadContext(depth, Context::EXTENSION_INDEX, false),
3860 current_context()); 3860 current_context());
3861 Node* check = 3861 Node* check = NewNode(javascript()->StrictEqual(), load,
3862 NewNode(javascript()->CallRuntime(Runtime::kInlineIsSmi, 1), load); 3862 jsgraph()->TheHoleConstant());
3863 fast_block.BreakUnless(check, BranchHint::kTrue); 3863 fast_block.BreakUnless(check, BranchHint::kTrue);
3864 } 3864 }
3865 3865
3866 // Fast case, because variable is not shadowed. Perform global slot load. 3866 // Fast case, because variable is not shadowed. Perform global slot load.
3867 Node* fast = BuildGlobalLoad(name, feedback, typeof_mode); 3867 Node* fast = BuildGlobalLoad(name, feedback, typeof_mode);
3868 states.AddToNode(fast, bailout_id, combine); 3868 states.AddToNode(fast, bailout_id, combine);
3869 environment()->Push(fast); 3869 environment()->Push(fast);
3870 slow_block.Break(); 3870 slow_block.Break();
3871 environment()->Pop(); 3871 environment()->Pop();
3872 fast_block.EndBlock(); 3872 fast_block.EndBlock();
(...skipping 20 matching lines...) Expand all
3893 environment()->Pop(); 3893 environment()->Pop();
3894 fast_block.BeginBlock(); 3894 fast_block.BeginBlock();
3895 3895
3896 // Perform checks whether the fast mode applies, by looking for any 3896 // Perform checks whether the fast mode applies, by looking for any
3897 // extension object which might shadow the optimistic declaration. 3897 // extension object which might shadow the optimistic declaration.
3898 for (int depth = 0; bitset != 0; bitset >>= 1, depth++) { 3898 for (int depth = 0; bitset != 0; bitset >>= 1, depth++) {
3899 if ((bitset & 1) == 0) continue; 3899 if ((bitset & 1) == 0) continue;
3900 Node* load = NewNode( 3900 Node* load = NewNode(
3901 javascript()->LoadContext(depth, Context::EXTENSION_INDEX, false), 3901 javascript()->LoadContext(depth, Context::EXTENSION_INDEX, false),
3902 current_context()); 3902 current_context());
3903 Node* check = 3903 Node* check = NewNode(javascript()->StrictEqual(), load,
3904 NewNode(javascript()->CallRuntime(Runtime::kInlineIsSmi, 1), load); 3904 jsgraph()->TheHoleConstant());
3905 fast_block.BreakUnless(check, BranchHint::kTrue); 3905 fast_block.BreakUnless(check, BranchHint::kTrue);
3906 } 3906 }
3907 3907
3908 // Fast case, because variable is not shadowed. Perform context slot load. 3908 // Fast case, because variable is not shadowed. Perform context slot load.
3909 Variable* local = variable->local_if_not_shadowed(); 3909 Variable* local = variable->local_if_not_shadowed();
3910 DCHECK(local->location() == VariableLocation::CONTEXT); // Must be context. 3910 DCHECK(local->location() == VariableLocation::CONTEXT); // Must be context.
3911 Node* fast = BuildVariableLoad(local, bailout_id, states, feedback, combine, 3911 Node* fast = BuildVariableLoad(local, bailout_id, states, feedback, combine,
3912 typeof_mode); 3912 typeof_mode);
3913 environment()->Push(fast); 3913 environment()->Push(fast);
3914 slow_block.Break(); 3914 slow_block.Break();
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
4304 // Phi does not exist yet, introduce one. 4304 // Phi does not exist yet, introduce one.
4305 value = NewPhi(inputs, value, control); 4305 value = NewPhi(inputs, value, control);
4306 value->ReplaceInput(inputs - 1, other); 4306 value->ReplaceInput(inputs - 1, other);
4307 } 4307 }
4308 return value; 4308 return value;
4309 } 4309 }
4310 4310
4311 } // namespace compiler 4311 } // namespace compiler
4312 } // namespace internal 4312 } // namespace internal
4313 } // namespace v8 4313 } // namespace v8
OLDNEW
« no previous file with comments | « src/code-stubs-hydrogen.cc ('k') | src/compiler/js-typed-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698