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

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

Issue 1304633002: Correctify instanceof and make it optimizable. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE. Add MIPS/MIPS64 ports. Created 5 years, 4 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/mips64/lithium-codegen-mips64.cc ('k') | src/mips64/lithium-mips64.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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_MIPS_LITHIUM_MIPS_H_ 5 #ifndef V8_MIPS_LITHIUM_MIPS_H_
6 #define V8_MIPS_LITHIUM_MIPS_H_ 6 #define V8_MIPS_LITHIUM_MIPS_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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 V(DummyUse) \ 78 V(DummyUse) \
79 V(FlooringDivByConstI) \ 79 V(FlooringDivByConstI) \
80 V(FlooringDivByPowerOf2I) \ 80 V(FlooringDivByPowerOf2I) \
81 V(FlooringDivI) \ 81 V(FlooringDivI) \
82 V(ForInCacheArray) \ 82 V(ForInCacheArray) \
83 V(ForInPrepareMap) \ 83 V(ForInPrepareMap) \
84 V(FunctionLiteral) \ 84 V(FunctionLiteral) \
85 V(GetCachedArrayIndex) \ 85 V(GetCachedArrayIndex) \
86 V(Goto) \ 86 V(Goto) \
87 V(HasCachedArrayIndexAndBranch) \ 87 V(HasCachedArrayIndexAndBranch) \
88 V(HasInPrototypeChainAndBranch) \
88 V(HasInstanceTypeAndBranch) \ 89 V(HasInstanceTypeAndBranch) \
89 V(InnerAllocatedObject) \ 90 V(InnerAllocatedObject) \
90 V(InstanceOf) \ 91 V(InstanceOf) \
91 V(InstanceOfKnownGlobal) \
92 V(InstructionGap) \ 92 V(InstructionGap) \
93 V(Integer32ToDouble) \ 93 V(Integer32ToDouble) \
94 V(InvokeFunction) \ 94 V(InvokeFunction) \
95 V(IsConstructCallAndBranch) \ 95 V(IsConstructCallAndBranch) \
96 V(IsObjectAndBranch) \ 96 V(IsObjectAndBranch) \
97 V(IsStringAndBranch) \ 97 V(IsStringAndBranch) \
98 V(IsSmiAndBranch) \ 98 V(IsSmiAndBranch) \
99 V(IsUndetectableAndBranch) \ 99 V(IsUndetectableAndBranch) \
100 V(Label) \ 100 V(Label) \
101 V(LazyBailout) \ 101 V(LazyBailout) \
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 LEnvironment* environment() const { return environment_; } 228 LEnvironment* environment() const { return environment_; }
229 bool HasEnvironment() const { return environment_ != NULL; } 229 bool HasEnvironment() const { return environment_ != NULL; }
230 230
231 void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); } 231 void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); }
232 LPointerMap* pointer_map() const { return pointer_map_.get(); } 232 LPointerMap* pointer_map() const { return pointer_map_.get(); }
233 bool HasPointerMap() const { return pointer_map_.is_set(); } 233 bool HasPointerMap() const { return pointer_map_.is_set(); }
234 234
235 void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; } 235 void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; }
236 HValue* hydrogen_value() const { return hydrogen_value_; } 236 HValue* hydrogen_value() const { return hydrogen_value_; }
237 237
238 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { }
239
240 void MarkAsCall() { bit_field_ = IsCallBits::update(bit_field_, true); } 238 void MarkAsCall() { bit_field_ = IsCallBits::update(bit_field_, true); }
241 bool IsCall() const { return IsCallBits::decode(bit_field_); } 239 bool IsCall() const { return IsCallBits::decode(bit_field_); }
242 240
243 // Interface to the register allocator and iterators. 241 // Interface to the register allocator and iterators.
244 bool ClobbersTemps() const { return IsCall(); } 242 bool ClobbersTemps() const { return IsCall(); }
245 bool ClobbersRegisters() const { return IsCall(); } 243 bool ClobbersRegisters() const { return IsCall(); }
246 virtual bool ClobbersDoubleRegisters(Isolate* isolate) const { 244 virtual bool ClobbersDoubleRegisters(Isolate* isolate) const {
247 return IsCall(); 245 return IsCall();
248 } 246 }
249 247
(...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after
1181 1179
1182 1180
1183 class LInstanceOf final : public LTemplateInstruction<1, 3, 0> { 1181 class LInstanceOf final : public LTemplateInstruction<1, 3, 0> {
1184 public: 1182 public:
1185 LInstanceOf(LOperand* context, LOperand* left, LOperand* right) { 1183 LInstanceOf(LOperand* context, LOperand* left, LOperand* right) {
1186 inputs_[0] = context; 1184 inputs_[0] = context;
1187 inputs_[1] = left; 1185 inputs_[1] = left;
1188 inputs_[2] = right; 1186 inputs_[2] = right;
1189 } 1187 }
1190 1188
1191 LOperand* context() { return inputs_[0]; } 1189 LOperand* context() const { return inputs_[0]; }
1192 LOperand* left() { return inputs_[1]; } 1190 LOperand* left() const { return inputs_[1]; }
1193 LOperand* right() { return inputs_[2]; } 1191 LOperand* right() const { return inputs_[2]; }
1194 1192
1195 DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of") 1193 DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of")
1196 }; 1194 };
1197 1195
1198 1196
1199 class LInstanceOfKnownGlobal final : public LTemplateInstruction<1, 2, 1> { 1197 class LHasInPrototypeChainAndBranch final : public LControlInstruction<2, 0> {
1200 public: 1198 public:
1201 LInstanceOfKnownGlobal(LOperand* context, LOperand* value, LOperand* temp) { 1199 LHasInPrototypeChainAndBranch(LOperand* object, LOperand* prototype) {
1202 inputs_[0] = context; 1200 inputs_[0] = object;
1203 inputs_[1] = value; 1201 inputs_[1] = prototype;
1204 temps_[0] = temp;
1205 } 1202 }
1206 1203
1207 LOperand* context() { return inputs_[0]; } 1204 LOperand* object() const { return inputs_[0]; }
1208 LOperand* value() { return inputs_[1]; } 1205 LOperand* prototype() const { return inputs_[1]; }
1209 LOperand* temp() { return temps_[0]; }
1210 1206
1211 DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal, 1207 DECLARE_CONCRETE_INSTRUCTION(HasInPrototypeChainAndBranch,
1212 "instance-of-known-global") 1208 "has-in-prototype-chain-and-branch")
1213 DECLARE_HYDROGEN_ACCESSOR(InstanceOfKnownGlobal) 1209 DECLARE_HYDROGEN_ACCESSOR(HasInPrototypeChainAndBranch)
1214
1215 Handle<JSFunction> function() const { return hydrogen()->function(); }
1216 LEnvironment* GetDeferredLazyDeoptimizationEnvironment() {
1217 return lazy_deopt_env_;
1218 }
1219 virtual void SetDeferredLazyDeoptimizationEnvironment(
1220 LEnvironment* env) override {
1221 lazy_deopt_env_ = env;
1222 }
1223
1224 private:
1225 LEnvironment* lazy_deopt_env_;
1226 }; 1210 };
1227 1211
1228 1212
1229 class LBoundsCheck final : public LTemplateInstruction<0, 2, 0> { 1213 class LBoundsCheck final : public LTemplateInstruction<0, 2, 0> {
1230 public: 1214 public:
1231 LBoundsCheck(LOperand* index, LOperand* length) { 1215 LBoundsCheck(LOperand* index, LOperand* length) {
1232 inputs_[0] = index; 1216 inputs_[0] = index;
1233 inputs_[1] = length; 1217 inputs_[1] = length;
1234 } 1218 }
1235 1219
(...skipping 1690 matching lines...) Expand 10 before | Expand all | Expand 10 after
2926 2910
2927 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2911 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2928 }; 2912 };
2929 2913
2930 #undef DECLARE_HYDROGEN_ACCESSOR 2914 #undef DECLARE_HYDROGEN_ACCESSOR
2931 #undef DECLARE_CONCRETE_INSTRUCTION 2915 #undef DECLARE_CONCRETE_INSTRUCTION
2932 2916
2933 } } // namespace v8::internal 2917 } } // namespace v8::internal
2934 2918
2935 #endif // V8_MIPS_LITHIUM_MIPS_H_ 2919 #endif // V8_MIPS_LITHIUM_MIPS_H_
OLDNEW
« no previous file with comments | « src/mips64/lithium-codegen-mips64.cc ('k') | src/mips64/lithium-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698