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

Side by Side Diff: src/ppc/lithium-ppc.h

Issue 1314263002: PPC: Correctify instanceof and make it optimizable. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 5 years, 3 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/ppc/lithium-codegen-ppc.cc ('k') | src/ppc/lithium-ppc.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 #ifndef V8_PPC_LITHIUM_PPC_H_ 5 #ifndef V8_PPC_LITHIUM_PPC_H_
6 #define V8_PPC_LITHIUM_PPC_H_ 6 #define V8_PPC_LITHIUM_PPC_H_
7 7
8 #include "src/hydrogen.h" 8 #include "src/hydrogen.h"
9 #include "src/lithium.h" 9 #include "src/lithium.h"
10 #include "src/lithium-allocator.h" 10 #include "src/lithium-allocator.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 V(DummyUse) \ 76 V(DummyUse) \
77 V(FlooringDivByConstI) \ 77 V(FlooringDivByConstI) \
78 V(FlooringDivByPowerOf2I) \ 78 V(FlooringDivByPowerOf2I) \
79 V(FlooringDivI) \ 79 V(FlooringDivI) \
80 V(ForInCacheArray) \ 80 V(ForInCacheArray) \
81 V(ForInPrepareMap) \ 81 V(ForInPrepareMap) \
82 V(FunctionLiteral) \ 82 V(FunctionLiteral) \
83 V(GetCachedArrayIndex) \ 83 V(GetCachedArrayIndex) \
84 V(Goto) \ 84 V(Goto) \
85 V(HasCachedArrayIndexAndBranch) \ 85 V(HasCachedArrayIndexAndBranch) \
86 V(HasInPrototypeChainAndBranch) \
86 V(HasInstanceTypeAndBranch) \ 87 V(HasInstanceTypeAndBranch) \
87 V(InnerAllocatedObject) \ 88 V(InnerAllocatedObject) \
88 V(InstanceOf) \ 89 V(InstanceOf) \
89 V(InstanceOfKnownGlobal) \
90 V(InstructionGap) \ 90 V(InstructionGap) \
91 V(Integer32ToDouble) \ 91 V(Integer32ToDouble) \
92 V(InvokeFunction) \ 92 V(InvokeFunction) \
93 V(IsConstructCallAndBranch) \ 93 V(IsConstructCallAndBranch) \
94 V(IsStringAndBranch) \ 94 V(IsStringAndBranch) \
95 V(IsSmiAndBranch) \ 95 V(IsSmiAndBranch) \
96 V(IsUndetectableAndBranch) \ 96 V(IsUndetectableAndBranch) \
97 V(Label) \ 97 V(Label) \
98 V(LazyBailout) \ 98 V(LazyBailout) \
99 V(LoadContextSlot) \ 99 V(LoadContextSlot) \
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 LEnvironment* environment() const { return environment_; } 223 LEnvironment* environment() const { return environment_; }
224 bool HasEnvironment() const { return environment_ != NULL; } 224 bool HasEnvironment() const { return environment_ != NULL; }
225 225
226 void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); } 226 void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); }
227 LPointerMap* pointer_map() const { return pointer_map_.get(); } 227 LPointerMap* pointer_map() const { return pointer_map_.get(); }
228 bool HasPointerMap() const { return pointer_map_.is_set(); } 228 bool HasPointerMap() const { return pointer_map_.is_set(); }
229 229
230 void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; } 230 void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; }
231 HValue* hydrogen_value() const { return hydrogen_value_; } 231 HValue* hydrogen_value() const { return hydrogen_value_; }
232 232
233 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) {}
234
235 void MarkAsCall() { bit_field_ = IsCallBits::update(bit_field_, true); } 233 void MarkAsCall() { bit_field_ = IsCallBits::update(bit_field_, true); }
236 bool IsCall() const { return IsCallBits::decode(bit_field_); } 234 bool IsCall() const { return IsCallBits::decode(bit_field_); }
237 235
238 // Interface to the register allocator and iterators. 236 // Interface to the register allocator and iterators.
239 bool ClobbersTemps() const { return IsCall(); } 237 bool ClobbersTemps() const { return IsCall(); }
240 bool ClobbersRegisters() const { return IsCall(); } 238 bool ClobbersRegisters() const { return IsCall(); }
241 virtual bool ClobbersDoubleRegisters(Isolate* isolate) const { 239 virtual bool ClobbersDoubleRegisters(Isolate* isolate) const {
242 return IsCall(); 240 return IsCall();
243 } 241 }
244 242
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after
1122 1120
1123 1121
1124 class LInstanceOf final : public LTemplateInstruction<1, 3, 0> { 1122 class LInstanceOf final : public LTemplateInstruction<1, 3, 0> {
1125 public: 1123 public:
1126 LInstanceOf(LOperand* context, LOperand* left, LOperand* right) { 1124 LInstanceOf(LOperand* context, LOperand* left, LOperand* right) {
1127 inputs_[0] = context; 1125 inputs_[0] = context;
1128 inputs_[1] = left; 1126 inputs_[1] = left;
1129 inputs_[2] = right; 1127 inputs_[2] = right;
1130 } 1128 }
1131 1129
1132 LOperand* context() { return inputs_[0]; } 1130 LOperand* context() const { return inputs_[0]; }
1133 LOperand* left() { return inputs_[1]; } 1131 LOperand* left() const { return inputs_[1]; }
1134 LOperand* right() { return inputs_[2]; } 1132 LOperand* right() const { return inputs_[2]; }
1135 1133
1136 DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of") 1134 DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of")
1137 }; 1135 };
1138 1136
1139 1137
1140 class LInstanceOfKnownGlobal final : public LTemplateInstruction<1, 2, 1> { 1138 class LHasInPrototypeChainAndBranch final : public LControlInstruction<2, 0> {
1141 public: 1139 public:
1142 LInstanceOfKnownGlobal(LOperand* context, LOperand* value, LOperand* temp) { 1140 LHasInPrototypeChainAndBranch(LOperand* object, LOperand* prototype) {
1143 inputs_[0] = context; 1141 inputs_[0] = object;
1144 inputs_[1] = value; 1142 inputs_[1] = prototype;
1145 temps_[0] = temp;
1146 } 1143 }
1147 1144
1148 LOperand* context() { return inputs_[0]; } 1145 LOperand* object() const { return inputs_[0]; }
1149 LOperand* value() { return inputs_[1]; } 1146 LOperand* prototype() const { return inputs_[1]; }
1150 LOperand* temp() { return temps_[0]; }
1151 1147
1152 DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal, 1148 DECLARE_CONCRETE_INSTRUCTION(HasInPrototypeChainAndBranch,
1153 "instance-of-known-global") 1149 "has-in-prototype-chain-and-branch")
1154 DECLARE_HYDROGEN_ACCESSOR(InstanceOfKnownGlobal) 1150 DECLARE_HYDROGEN_ACCESSOR(HasInPrototypeChainAndBranch)
1155
1156 Handle<JSFunction> function() const { return hydrogen()->function(); }
1157 LEnvironment* GetDeferredLazyDeoptimizationEnvironment() {
1158 return lazy_deopt_env_;
1159 }
1160 virtual void SetDeferredLazyDeoptimizationEnvironment(
1161 LEnvironment* env) override {
1162 lazy_deopt_env_ = env;
1163 }
1164
1165 private:
1166 LEnvironment* lazy_deopt_env_;
1167 }; 1151 };
1168 1152
1169 1153
1170 class LBoundsCheck final : public LTemplateInstruction<0, 2, 0> { 1154 class LBoundsCheck final : public LTemplateInstruction<0, 2, 0> {
1171 public: 1155 public:
1172 LBoundsCheck(LOperand* index, LOperand* length) { 1156 LBoundsCheck(LOperand* index, LOperand* length) {
1173 inputs_[0] = index; 1157 inputs_[0] = index;
1174 inputs_[1] = length; 1158 inputs_[1] = length;
1175 } 1159 }
1176 1160
(...skipping 1601 matching lines...) Expand 10 before | Expand all | Expand 10 after
2778 2762
2779 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2763 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2780 }; 2764 };
2781 2765
2782 #undef DECLARE_HYDROGEN_ACCESSOR 2766 #undef DECLARE_HYDROGEN_ACCESSOR
2783 #undef DECLARE_CONCRETE_INSTRUCTION 2767 #undef DECLARE_CONCRETE_INSTRUCTION
2784 } 2768 }
2785 } // namespace v8::internal 2769 } // namespace v8::internal
2786 2770
2787 #endif // V8_PPC_LITHIUM_PPC_H_ 2771 #endif // V8_PPC_LITHIUM_PPC_H_
OLDNEW
« no previous file with comments | « src/ppc/lithium-codegen-ppc.cc ('k') | src/ppc/lithium-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698