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

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

Issue 1318663003: X87: Correctify instanceof and make it optimizable. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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/x87/lithium-codegen-x87.cc ('k') | src/x87/lithium-x87.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_X87_LITHIUM_X87_H_ 5 #ifndef V8_X87_LITHIUM_X87_H_
6 #define V8_X87_LITHIUM_X87_H_ 6 #define V8_X87_LITHIUM_X87_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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 V(DummyUse) \ 81 V(DummyUse) \
82 V(FlooringDivByConstI) \ 82 V(FlooringDivByConstI) \
83 V(FlooringDivByPowerOf2I) \ 83 V(FlooringDivByPowerOf2I) \
84 V(FlooringDivI) \ 84 V(FlooringDivI) \
85 V(ForInCacheArray) \ 85 V(ForInCacheArray) \
86 V(ForInPrepareMap) \ 86 V(ForInPrepareMap) \
87 V(FunctionLiteral) \ 87 V(FunctionLiteral) \
88 V(GetCachedArrayIndex) \ 88 V(GetCachedArrayIndex) \
89 V(Goto) \ 89 V(Goto) \
90 V(HasCachedArrayIndexAndBranch) \ 90 V(HasCachedArrayIndexAndBranch) \
91 V(HasInPrototypeChainAndBranch) \
91 V(HasInstanceTypeAndBranch) \ 92 V(HasInstanceTypeAndBranch) \
92 V(InnerAllocatedObject) \ 93 V(InnerAllocatedObject) \
93 V(InstanceOf) \ 94 V(InstanceOf) \
94 V(InstanceOfKnownGlobal) \
95 V(InstructionGap) \ 95 V(InstructionGap) \
96 V(Integer32ToDouble) \ 96 V(Integer32ToDouble) \
97 V(InvokeFunction) \ 97 V(InvokeFunction) \
98 V(IsConstructCallAndBranch) \ 98 V(IsConstructCallAndBranch) \
99 V(IsObjectAndBranch) \ 99 V(IsObjectAndBranch) \
100 V(IsStringAndBranch) \ 100 V(IsStringAndBranch) \
101 V(IsSmiAndBranch) \ 101 V(IsSmiAndBranch) \
102 V(IsUndetectableAndBranch) \ 102 V(IsUndetectableAndBranch) \
103 V(Label) \ 103 V(Label) \
104 V(LazyBailout) \ 104 V(LazyBailout) \
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 LEnvironment* environment() const { return environment_; } 230 LEnvironment* environment() const { return environment_; }
231 bool HasEnvironment() const { return environment_ != NULL; } 231 bool HasEnvironment() const { return environment_ != NULL; }
232 232
233 void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); } 233 void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); }
234 LPointerMap* pointer_map() const { return pointer_map_.get(); } 234 LPointerMap* pointer_map() const { return pointer_map_.get(); }
235 bool HasPointerMap() const { return pointer_map_.is_set(); } 235 bool HasPointerMap() const { return pointer_map_.is_set(); }
236 236
237 void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; } 237 void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; }
238 HValue* hydrogen_value() const { return hydrogen_value_; } 238 HValue* hydrogen_value() const { return hydrogen_value_; }
239 239
240 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { }
241
242 void MarkAsCall() { bit_field_ = IsCallBits::update(bit_field_, true); } 240 void MarkAsCall() { bit_field_ = IsCallBits::update(bit_field_, true); }
243 bool IsCall() const { return IsCallBits::decode(bit_field_); } 241 bool IsCall() const { return IsCallBits::decode(bit_field_); }
244 242
245 // Interface to the register allocator and iterators. 243 // Interface to the register allocator and iterators.
246 bool ClobbersTemps() const { return IsCall(); } 244 bool ClobbersTemps() const { return IsCall(); }
247 bool ClobbersRegisters() const { return IsCall(); } 245 bool ClobbersRegisters() const { return IsCall(); }
248 virtual bool ClobbersDoubleRegisters(Isolate* isolate) const { 246 virtual bool ClobbersDoubleRegisters(Isolate* isolate) const {
249 return IsCall() || 247 return IsCall() ||
250 // We only have rudimentary X87Stack tracking, thus in general 248 // We only have rudimentary X87Stack tracking, thus in general
251 // cannot handle phi-nodes. 249 // cannot handle phi-nodes.
(...skipping 940 matching lines...) Expand 10 before | Expand all | Expand 10 after
1192 1190
1193 1191
1194 class LInstanceOf final : public LTemplateInstruction<1, 3, 0> { 1192 class LInstanceOf final : public LTemplateInstruction<1, 3, 0> {
1195 public: 1193 public:
1196 LInstanceOf(LOperand* context, LOperand* left, LOperand* right) { 1194 LInstanceOf(LOperand* context, LOperand* left, LOperand* right) {
1197 inputs_[0] = context; 1195 inputs_[0] = context;
1198 inputs_[1] = left; 1196 inputs_[1] = left;
1199 inputs_[2] = right; 1197 inputs_[2] = right;
1200 } 1198 }
1201 1199
1202 LOperand* context() { return inputs_[0]; } 1200 LOperand* context() const { return inputs_[0]; }
1201 LOperand* left() const { return inputs_[1]; }
1202 LOperand* right() const { return inputs_[2]; }
1203 1203
1204 DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of") 1204 DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of")
1205 }; 1205 };
1206 1206
1207 1207
1208 class LInstanceOfKnownGlobal final : public LTemplateInstruction<1, 2, 1> { 1208 class LHasInPrototypeChainAndBranch final : public LControlInstruction<2, 1> {
1209 public: 1209 public:
1210 LInstanceOfKnownGlobal(LOperand* context, LOperand* value, LOperand* temp) { 1210 LHasInPrototypeChainAndBranch(LOperand* object, LOperand* prototype,
1211 inputs_[0] = context; 1211 LOperand* scratch) {
1212 inputs_[1] = value; 1212 inputs_[0] = object;
1213 temps_[0] = temp; 1213 inputs_[1] = prototype;
1214 temps_[0] = scratch;
1214 } 1215 }
1215 1216
1216 LOperand* context() { return inputs_[0]; } 1217 LOperand* object() const { return inputs_[0]; }
1217 LOperand* value() { return inputs_[1]; } 1218 LOperand* prototype() const { return inputs_[1]; }
1218 LOperand* temp() { return temps_[0]; } 1219 LOperand* scratch() const { return temps_[0]; }
1219 1220
1220 DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal, 1221 DECLARE_CONCRETE_INSTRUCTION(HasInPrototypeChainAndBranch,
1221 "instance-of-known-global") 1222 "has-in-prototype-chain-and-branch")
1222 DECLARE_HYDROGEN_ACCESSOR(InstanceOfKnownGlobal) 1223 DECLARE_HYDROGEN_ACCESSOR(HasInPrototypeChainAndBranch)
1223
1224 Handle<JSFunction> function() const { return hydrogen()->function(); }
1225 LEnvironment* GetDeferredLazyDeoptimizationEnvironment() {
1226 return lazy_deopt_env_;
1227 }
1228 virtual void SetDeferredLazyDeoptimizationEnvironment(
1229 LEnvironment* env) override {
1230 lazy_deopt_env_ = env;
1231 }
1232
1233 private:
1234 LEnvironment* lazy_deopt_env_;
1235 }; 1224 };
1236 1225
1237 1226
1238 class LBoundsCheck final : public LTemplateInstruction<0, 2, 0> { 1227 class LBoundsCheck final : public LTemplateInstruction<0, 2, 0> {
1239 public: 1228 public:
1240 LBoundsCheck(LOperand* index, LOperand* length) { 1229 LBoundsCheck(LOperand* index, LOperand* length) {
1241 inputs_[0] = index; 1230 inputs_[0] = index;
1242 inputs_[1] = length; 1231 inputs_[1] = length;
1243 } 1232 }
1244 1233
(...skipping 1683 matching lines...) Expand 10 before | Expand all | Expand 10 after
2928 2917
2929 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2918 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2930 }; 2919 };
2931 2920
2932 #undef DECLARE_HYDROGEN_ACCESSOR 2921 #undef DECLARE_HYDROGEN_ACCESSOR
2933 #undef DECLARE_CONCRETE_INSTRUCTION 2922 #undef DECLARE_CONCRETE_INSTRUCTION
2934 2923
2935 } } // namespace v8::internal 2924 } } // namespace v8::internal
2936 2925
2937 #endif // V8_X87_LITHIUM_X87_H_ 2926 #endif // V8_X87_LITHIUM_X87_H_
OLDNEW
« no previous file with comments | « src/x87/lithium-codegen-x87.cc ('k') | src/x87/lithium-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698