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

Side by Side Diff: src/compiler/js-generic-lowering.cc

Issue 1516843002: [proxy] fixing harmony/proxy.js tests and improving error messages + some drive-by fixes (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: WIP fix protoype walks with access checks 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
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/code-factory.h" 5 #include "src/code-factory.h"
6 #include "src/code-stubs.h" 6 #include "src/code-stubs.h"
7 #include "src/compiler/common-operator.h" 7 #include "src/compiler/common-operator.h"
8 #include "src/compiler/js-generic-lowering.h" 8 #include "src/compiler/js-generic-lowering.h"
9 #include "src/compiler/js-graph.h" 9 #include "src/compiler/js-graph.h"
10 #include "src/compiler/machine-operator.h" 10 #include "src/compiler/machine-operator.h"
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 cache_type_true0 = cache_type; 714 cache_type_true0 = cache_type;
715 } 715 }
716 716
717 Node* if_false0 = graph()->NewNode(common()->IfFalse(), branch0); 717 Node* if_false0 = graph()->NewNode(common()->IfFalse(), branch0);
718 Node* cache_array_false0; 718 Node* cache_array_false0;
719 Node* cache_length_false0; 719 Node* cache_length_false0;
720 Node* cache_type_false0; 720 Node* cache_type_false0;
721 Node* efalse0; 721 Node* efalse0;
722 { 722 {
723 // FixedArray case. 723 // FixedArray case.
724 Node* object_instance_type = efalse0 = graph()->NewNode( 724 cache_type_false0 = jsgraph()->OneConstant(); // Smi means slow check
725 machine()->Load(MachineType::Uint8()), object_map,
726 jsgraph()->IntPtrConstant(Map::kInstanceTypeOffset - kHeapObjectTag),
727 effect, if_false0);
728
729 Node* check1 =
730 graph()->NewNode(machine()->Word32Equal(), object_instance_type,
731 jsgraph()->Uint32Constant(JS_PROXY_TYPE));
732 Node* branch1 = graph()->NewNode(common()->Branch(BranchHint::kFalse),
733 check1, if_false0);
734
735 Node* if_true1 = graph()->NewNode(common()->IfTrue(), branch1);
736 Node* cache_type_true1 = jsgraph()->ZeroConstant(); // Zero indicates proxy
737
738 Node* if_false1 = graph()->NewNode(common()->IfFalse(), branch1);
739 Node* cache_type_false1 = jsgraph()->OneConstant(); // One means slow check
740
741 if_false0 = graph()->NewNode(common()->Merge(2), if_true1, if_false1);
742 cache_type_false0 =
743 graph()->NewNode(common()->Phi(MachineRepresentation::kTagged, 2),
744 cache_type_true1, cache_type_false1, if_false0);
745
746 cache_array_false0 = cache_type; 725 cache_array_false0 = cache_type;
747 cache_length_false0 = efalse0 = graph()->NewNode( 726 cache_length_false0 = efalse0 = graph()->NewNode(
748 machine()->Load(MachineType::AnyTagged()), cache_array_false0, 727 machine()->Load(MachineType::AnyTagged()), cache_array_false0,
749 jsgraph()->IntPtrConstant(FixedArray::kLengthOffset - kHeapObjectTag), 728 jsgraph()->IntPtrConstant(FixedArray::kLengthOffset - kHeapObjectTag),
750 efalse0, if_false0); 729 effect, if_false0);
751 } 730 }
752 731
753 control = graph()->NewNode(common()->Merge(2), if_true0, if_false0); 732 control = graph()->NewNode(common()->Merge(2), if_true0, if_false0);
754 effect = graph()->NewNode(common()->EffectPhi(2), etrue0, efalse0, control); 733 effect = graph()->NewNode(common()->EffectPhi(2), etrue0, efalse0, control);
755 Node* cache_array = 734 Node* cache_array =
756 graph()->NewNode(common()->Phi(MachineRepresentation::kTagged, 2), 735 graph()->NewNode(common()->Phi(MachineRepresentation::kTagged, 2),
757 cache_array_true0, cache_array_false0, control); 736 cache_array_true0, cache_array_false0, control);
758 Node* cache_length = 737 Node* cache_length =
759 graph()->NewNode(common()->Phi(MachineRepresentation::kTagged, 2), 738 graph()->NewNode(common()->Phi(MachineRepresentation::kTagged, 2),
760 cache_length_true0, cache_length_false0, control); 739 cache_length_true0, cache_length_false0, control);
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 } 864 }
886 865
887 866
888 MachineOperatorBuilder* JSGenericLowering::machine() const { 867 MachineOperatorBuilder* JSGenericLowering::machine() const {
889 return jsgraph()->machine(); 868 return jsgraph()->machine();
890 } 869 }
891 870
892 } // namespace compiler 871 } // namespace compiler
893 } // namespace internal 872 } // namespace internal
894 } // namespace v8 873 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698