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

Side by Side Diff: src/x64/lithium-x64.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/x64/lithium-codegen-x64.cc ('k') | src/x64/lithium-x64.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_X64_LITHIUM_X64_H_ 5 #ifndef V8_X64_LITHIUM_X64_H_
6 #define V8_X64_LITHIUM_X64_H_ 6 #define V8_X64_LITHIUM_X64_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(Dummy) \ 76 V(Dummy) \
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(IsObjectAndBranch) \ 94 V(IsObjectAndBranch) \
95 V(IsStringAndBranch) \ 95 V(IsStringAndBranch) \
96 V(IsSmiAndBranch) \ 96 V(IsSmiAndBranch) \
97 V(IsUndetectableAndBranch) \ 97 V(IsUndetectableAndBranch) \
98 V(Label) \ 98 V(Label) \
99 V(LazyBailout) \ 99 V(LazyBailout) \
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 void MarkAsCall() { bit_field_ = IsCallBits::update(bit_field_, true); } 235 void MarkAsCall() { bit_field_ = IsCallBits::update(bit_field_, true); }
236 bool IsCall() const { return IsCallBits::decode(bit_field_); } 236 bool IsCall() const { return IsCallBits::decode(bit_field_); }
237 237
238 // Interface to the register allocator and iterators. 238 // Interface to the register allocator and iterators.
239 bool ClobbersTemps() const { return IsCall(); } 239 bool ClobbersTemps() const { return IsCall(); }
240 bool ClobbersRegisters() const { return IsCall(); } 240 bool ClobbersRegisters() const { return IsCall(); }
241 virtual bool ClobbersDoubleRegisters(Isolate* isolate) const { 241 virtual bool ClobbersDoubleRegisters(Isolate* isolate) const {
242 return IsCall(); 242 return IsCall();
243 } 243 }
244 244
245 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { }
246
247 // Interface to the register allocator and iterators. 245 // Interface to the register allocator and iterators.
248 bool IsMarkedAsCall() const { return IsCall(); } 246 bool IsMarkedAsCall() const { return IsCall(); }
249 247
250 virtual bool HasResult() const = 0; 248 virtual bool HasResult() const = 0;
251 virtual LOperand* result() const = 0; 249 virtual LOperand* result() const = 0;
252 250
253 LOperand* FirstInput() { return InputAt(0); } 251 LOperand* FirstInput() { return InputAt(0); }
254 LOperand* Output() { return HasResult() ? result() : NULL; } 252 LOperand* Output() { return HasResult() ? result() : NULL; }
255 253
256 virtual bool HasInterestingComment(LCodeGen* gen) const { return true; } 254 virtual bool HasInterestingComment(LCodeGen* gen) const { return true; }
(...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after
1169 } 1167 }
1170 1168
1171 LOperand* context() { return inputs_[0]; } 1169 LOperand* context() { return inputs_[0]; }
1172 LOperand* left() { return inputs_[1]; } 1170 LOperand* left() { return inputs_[1]; }
1173 LOperand* right() { return inputs_[2]; } 1171 LOperand* right() { return inputs_[2]; }
1174 1172
1175 DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of") 1173 DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of")
1176 }; 1174 };
1177 1175
1178 1176
1179 class LInstanceOfKnownGlobal final : public LTemplateInstruction<1, 2, 1> { 1177 class LHasInPrototypeChainAndBranch final : public LControlInstruction<2, 0> {
1180 public: 1178 public:
1181 LInstanceOfKnownGlobal(LOperand* context, LOperand* value, LOperand* temp) { 1179 LHasInPrototypeChainAndBranch(LOperand* object, LOperand* prototype) {
1182 inputs_[0] = context; 1180 inputs_[0] = object;
1183 inputs_[1] = value; 1181 inputs_[1] = prototype;
1184 temps_[0] = temp;
1185 } 1182 }
1186 1183
1187 LOperand* context() { return inputs_[0]; } 1184 LOperand* object() const { return inputs_[0]; }
1188 LOperand* value() { return inputs_[1]; } 1185 LOperand* prototype() const { return inputs_[1]; }
1189 LOperand* temp() { return temps_[0]; }
1190 1186
1191 DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal, 1187 DECLARE_CONCRETE_INSTRUCTION(HasInPrototypeChainAndBranch,
1192 "instance-of-known-global") 1188 "has-in-prototype-chain-and-branch")
1193 DECLARE_HYDROGEN_ACCESSOR(InstanceOfKnownGlobal) 1189 DECLARE_HYDROGEN_ACCESSOR(HasInPrototypeChainAndBranch)
1194
1195 Handle<JSFunction> function() const { return hydrogen()->function(); }
1196 LEnvironment* GetDeferredLazyDeoptimizationEnvironment() {
1197 return lazy_deopt_env_;
1198 }
1199 virtual void SetDeferredLazyDeoptimizationEnvironment(
1200 LEnvironment* env) override {
1201 lazy_deopt_env_ = env;
1202 }
1203
1204 private:
1205 LEnvironment* lazy_deopt_env_;
1206 }; 1190 };
1207 1191
1208 1192
1209 class LBoundsCheck final : public LTemplateInstruction<0, 2, 0> { 1193 class LBoundsCheck final : public LTemplateInstruction<0, 2, 0> {
1210 public: 1194 public:
1211 LBoundsCheck(LOperand* index, LOperand* length) { 1195 LBoundsCheck(LOperand* index, LOperand* length) {
1212 inputs_[0] = index; 1196 inputs_[0] = index;
1213 inputs_[1] = length; 1197 inputs_[1] = length;
1214 } 1198 }
1215 1199
(...skipping 1683 matching lines...) Expand 10 before | Expand all | Expand 10 after
2899 2883
2900 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2884 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2901 }; 2885 };
2902 2886
2903 #undef DECLARE_HYDROGEN_ACCESSOR 2887 #undef DECLARE_HYDROGEN_ACCESSOR
2904 #undef DECLARE_CONCRETE_INSTRUCTION 2888 #undef DECLARE_CONCRETE_INSTRUCTION
2905 2889
2906 } } // namespace v8::int 2890 } } // namespace v8::int
2907 2891
2908 #endif // V8_X64_LITHIUM_X64_H_ 2892 #endif // V8_X64_LITHIUM_X64_H_
OLDNEW
« no previous file with comments | « src/x64/lithium-codegen-x64.cc ('k') | src/x64/lithium-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698