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

Side by Side Diff: src/arm64/lithium-arm64.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, 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/arm64/interface-descriptors-arm64.cc ('k') | src/arm64/lithium-arm64.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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_ARM64_LITHIUM_ARM64_H_ 5 #ifndef V8_ARM64_LITHIUM_ARM64_H_
6 #define V8_ARM64_LITHIUM_ARM64_H_ 6 #define V8_ARM64_LITHIUM_ARM64_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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 V(DummyUse) \ 79 V(DummyUse) \
80 V(FlooringDivByConstI) \ 80 V(FlooringDivByConstI) \
81 V(FlooringDivByPowerOf2I) \ 81 V(FlooringDivByPowerOf2I) \
82 V(FlooringDivI) \ 82 V(FlooringDivI) \
83 V(ForInCacheArray) \ 83 V(ForInCacheArray) \
84 V(ForInPrepareMap) \ 84 V(ForInPrepareMap) \
85 V(FunctionLiteral) \ 85 V(FunctionLiteral) \
86 V(GetCachedArrayIndex) \ 86 V(GetCachedArrayIndex) \
87 V(Goto) \ 87 V(Goto) \
88 V(HasCachedArrayIndexAndBranch) \ 88 V(HasCachedArrayIndexAndBranch) \
89 V(HasInPrototypeChainAndBranch) \
89 V(HasInstanceTypeAndBranch) \ 90 V(HasInstanceTypeAndBranch) \
90 V(InnerAllocatedObject) \ 91 V(InnerAllocatedObject) \
91 V(InstanceOf) \ 92 V(InstanceOf) \
92 V(InstanceOfKnownGlobal) \
93 V(InstructionGap) \ 93 V(InstructionGap) \
94 V(Integer32ToDouble) \ 94 V(Integer32ToDouble) \
95 V(InvokeFunction) \ 95 V(InvokeFunction) \
96 V(IsConstructCallAndBranch) \ 96 V(IsConstructCallAndBranch) \
97 V(IsObjectAndBranch) \ 97 V(IsObjectAndBranch) \
98 V(IsSmiAndBranch) \ 98 V(IsSmiAndBranch) \
99 V(IsStringAndBranch) \ 99 V(IsStringAndBranch) \
100 V(IsUndetectableAndBranch) \ 100 V(IsUndetectableAndBranch) \
101 V(Label) \ 101 V(Label) \
102 V(LazyBailout) \ 102 V(LazyBailout) \
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 LEnvironment* environment() const { return environment_; } 239 LEnvironment* environment() const { return environment_; }
240 bool HasEnvironment() const { return environment_ != NULL; } 240 bool HasEnvironment() const { return environment_ != NULL; }
241 241
242 void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); } 242 void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); }
243 LPointerMap* pointer_map() const { return pointer_map_.get(); } 243 LPointerMap* pointer_map() const { return pointer_map_.get(); }
244 bool HasPointerMap() const { return pointer_map_.is_set(); } 244 bool HasPointerMap() const { return pointer_map_.is_set(); }
245 245
246 void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; } 246 void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; }
247 HValue* hydrogen_value() const { return hydrogen_value_; } 247 HValue* hydrogen_value() const { return hydrogen_value_; }
248 248
249 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { }
250
251 void MarkAsCall() { bit_field_ = IsCallBits::update(bit_field_, true); } 249 void MarkAsCall() { bit_field_ = IsCallBits::update(bit_field_, true); }
252 bool IsCall() const { return IsCallBits::decode(bit_field_); } 250 bool IsCall() const { return IsCallBits::decode(bit_field_); }
253 251
254 // Interface to the register allocator and iterators. 252 // Interface to the register allocator and iterators.
255 bool ClobbersTemps() const { return IsCall(); } 253 bool ClobbersTemps() const { return IsCall(); }
256 bool ClobbersRegisters() const { return IsCall(); } 254 bool ClobbersRegisters() const { return IsCall(); }
257 virtual bool ClobbersDoubleRegisters(Isolate* isolate) const { 255 virtual bool ClobbersDoubleRegisters(Isolate* isolate) const {
258 return IsCall(); 256 return IsCall();
259 } 257 }
260 bool IsMarkedAsCall() const { return IsCall(); } 258 bool IsMarkedAsCall() const { return IsCall(); }
(...skipping 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after
1474 1472
1475 1473
1476 class LInstanceOf final : public LTemplateInstruction<1, 3, 0> { 1474 class LInstanceOf final : public LTemplateInstruction<1, 3, 0> {
1477 public: 1475 public:
1478 LInstanceOf(LOperand* context, LOperand* left, LOperand* right) { 1476 LInstanceOf(LOperand* context, LOperand* left, LOperand* right) {
1479 inputs_[0] = context; 1477 inputs_[0] = context;
1480 inputs_[1] = left; 1478 inputs_[1] = left;
1481 inputs_[2] = right; 1479 inputs_[2] = right;
1482 } 1480 }
1483 1481
1484 LOperand* context() { return inputs_[0]; } 1482 LOperand* context() const { return inputs_[0]; }
1485 LOperand* left() { return inputs_[1]; } 1483 LOperand* left() const { return inputs_[1]; }
1486 LOperand* right() { return inputs_[2]; } 1484 LOperand* right() const { return inputs_[2]; }
1487 1485
1488 DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of") 1486 DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of")
1489 }; 1487 };
1490 1488
1491 1489
1492 class LInstanceOfKnownGlobal final : public LTemplateInstruction<1, 2, 0> { 1490 class LHasInPrototypeChainAndBranch final : public LControlInstruction<2, 1> {
1493 public: 1491 public:
1494 LInstanceOfKnownGlobal(LOperand* context, LOperand* value) { 1492 LHasInPrototypeChainAndBranch(LOperand* object, LOperand* prototype,
1495 inputs_[0] = context; 1493 LOperand* scratch) {
1496 inputs_[1] = value; 1494 inputs_[0] = object;
1495 inputs_[1] = prototype;
1496 temps_[0] = scratch;
1497 } 1497 }
1498 1498
1499 LOperand* context() { return inputs_[0]; } 1499 LOperand* object() const { return inputs_[0]; }
1500 LOperand* value() { return inputs_[1]; } 1500 LOperand* prototype() const { return inputs_[1]; }
1501 LOperand* scratch() const { return temps_[0]; }
1501 1502
1502 DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal, 1503 DECLARE_CONCRETE_INSTRUCTION(HasInPrototypeChainAndBranch,
1503 "instance-of-known-global") 1504 "has-in-prototype-chain-and-branch")
1504 DECLARE_HYDROGEN_ACCESSOR(InstanceOfKnownGlobal) 1505 DECLARE_HYDROGEN_ACCESSOR(HasInPrototypeChainAndBranch)
1505
1506 Handle<JSFunction> function() const { return hydrogen()->function(); }
1507 LEnvironment* GetDeferredLazyDeoptimizationEnvironment() {
1508 return lazy_deopt_env_;
1509 }
1510 virtual void SetDeferredLazyDeoptimizationEnvironment(
1511 LEnvironment* env) override {
1512 lazy_deopt_env_ = env;
1513 }
1514
1515 private:
1516 LEnvironment* lazy_deopt_env_;
1517 }; 1506 };
1518 1507
1519 1508
1520 class LInteger32ToDouble final : public LTemplateInstruction<1, 1, 0> { 1509 class LInteger32ToDouble final : public LTemplateInstruction<1, 1, 0> {
1521 public: 1510 public:
1522 explicit LInteger32ToDouble(LOperand* value) { 1511 explicit LInteger32ToDouble(LOperand* value) {
1523 inputs_[0] = value; 1512 inputs_[0] = value;
1524 } 1513 }
1525 1514
1526 LOperand* value() { return inputs_[0]; } 1515 LOperand* value() { return inputs_[0]; }
(...skipping 1761 matching lines...) Expand 10 before | Expand all | Expand 10 after
3288 3277
3289 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 3278 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
3290 }; 3279 };
3291 3280
3292 #undef DECLARE_HYDROGEN_ACCESSOR 3281 #undef DECLARE_HYDROGEN_ACCESSOR
3293 #undef DECLARE_CONCRETE_INSTRUCTION 3282 #undef DECLARE_CONCRETE_INSTRUCTION
3294 3283
3295 } } // namespace v8::internal 3284 } } // namespace v8::internal
3296 3285
3297 #endif // V8_ARM64_LITHIUM_ARM64_H_ 3286 #endif // V8_ARM64_LITHIUM_ARM64_H_
OLDNEW
« no previous file with comments | « src/arm64/interface-descriptors-arm64.cc ('k') | src/arm64/lithium-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698