OLD | NEW |
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_HYDROGEN_INSTRUCTIONS_H_ | 5 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_ |
6 #define V8_HYDROGEN_INSTRUCTIONS_H_ | 6 #define V8_HYDROGEN_INSTRUCTIONS_H_ |
7 | 7 |
8 #include <cstring> | 8 #include <cstring> |
9 #include <iosfwd> | 9 #include <iosfwd> |
10 | 10 |
(...skipping 5273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5284 : HUnaryCall(context, argument_count), | 5284 : HUnaryCall(context, argument_count), |
5285 major_key_(major_key) { | 5285 major_key_(major_key) { |
5286 } | 5286 } |
5287 | 5287 |
5288 CodeStub::Major major_key_; | 5288 CodeStub::Major major_key_; |
5289 }; | 5289 }; |
5290 | 5290 |
5291 | 5291 |
5292 class HTailCallThroughMegamorphicCache FINAL : public HInstruction { | 5292 class HTailCallThroughMegamorphicCache FINAL : public HInstruction { |
5293 public: | 5293 public: |
5294 enum Flags { | |
5295 NONE = 0, | |
5296 CALLED_FROM_KEYED_LOAD = 1 << 0, | |
5297 PERFORM_MISS_ONLY = 1 << 1 | |
5298 }; | |
5299 | |
5300 static Flags ComputeFlags(bool called_from_keyed_load, | |
5301 bool perform_miss_only) { | |
5302 Flags flags = NONE; | |
5303 if (called_from_keyed_load) { | |
5304 flags = static_cast<Flags>(flags | CALLED_FROM_KEYED_LOAD); | |
5305 } | |
5306 if (perform_miss_only) { | |
5307 flags = static_cast<Flags>(flags | PERFORM_MISS_ONLY); | |
5308 } | |
5309 return flags; | |
5310 } | |
5311 | |
5312 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P5( | |
5313 HTailCallThroughMegamorphicCache, HValue*, HValue*, HValue*, HValue*, | |
5314 HTailCallThroughMegamorphicCache::Flags); | |
5315 | |
5316 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HTailCallThroughMegamorphicCache, | 5294 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HTailCallThroughMegamorphicCache, |
5317 HValue*, HValue*); | 5295 HValue*, HValue*); |
5318 | 5296 |
5319 Representation RequiredInputRepresentation(int index) OVERRIDE { | 5297 Representation RequiredInputRepresentation(int index) OVERRIDE { |
5320 return Representation::Tagged(); | 5298 return Representation::Tagged(); |
5321 } | 5299 } |
5322 | 5300 |
5323 virtual int OperandCount() const FINAL OVERRIDE { | 5301 virtual int OperandCount() const FINAL OVERRIDE { return 3; } |
5324 return FLAG_vector_ics ? 5 : 3; | |
5325 } | |
5326 virtual HValue* OperandAt(int i) const FINAL OVERRIDE { return inputs_[i]; } | 5302 virtual HValue* OperandAt(int i) const FINAL OVERRIDE { return inputs_[i]; } |
5327 | 5303 |
5328 HValue* context() const { return OperandAt(0); } | 5304 HValue* context() const { return OperandAt(0); } |
5329 HValue* receiver() const { return OperandAt(1); } | 5305 HValue* receiver() const { return OperandAt(1); } |
5330 HValue* name() const { return OperandAt(2); } | 5306 HValue* name() const { return OperandAt(2); } |
5331 HValue* slot() const { | |
5332 DCHECK(FLAG_vector_ics); | |
5333 return OperandAt(3); | |
5334 } | |
5335 HValue* vector() const { | |
5336 DCHECK(FLAG_vector_ics); | |
5337 return OperandAt(4); | |
5338 } | |
5339 Code::Flags flags() const; | 5307 Code::Flags flags() const; |
5340 | 5308 |
5341 bool is_keyed_load() const { return flags_ & CALLED_FROM_KEYED_LOAD; } | |
5342 bool is_just_miss() const { return flags_ & PERFORM_MISS_ONLY; } | |
5343 | |
5344 std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT | 5309 std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
5345 | 5310 |
5346 DECLARE_CONCRETE_INSTRUCTION(TailCallThroughMegamorphicCache) | 5311 DECLARE_CONCRETE_INSTRUCTION(TailCallThroughMegamorphicCache) |
5347 | 5312 |
5348 protected: | 5313 protected: |
5349 virtual void InternalSetOperandAt(int i, HValue* value) FINAL OVERRIDE { | 5314 virtual void InternalSetOperandAt(int i, HValue* value) FINAL OVERRIDE { |
5350 inputs_[i] = value; | 5315 inputs_[i] = value; |
5351 } | 5316 } |
5352 | 5317 |
5353 private: | 5318 private: |
5354 HTailCallThroughMegamorphicCache(HValue* context, HValue* receiver, | 5319 HTailCallThroughMegamorphicCache(HValue* context, HValue* receiver, |
5355 HValue* name, HValue* slot, HValue* vector, | 5320 HValue* name) { |
5356 Flags flags) | |
5357 : flags_(flags) { | |
5358 DCHECK(FLAG_vector_ics); | |
5359 SetOperandAt(0, context); | |
5360 SetOperandAt(1, receiver); | |
5361 SetOperandAt(2, name); | |
5362 SetOperandAt(3, slot); | |
5363 SetOperandAt(4, vector); | |
5364 } | |
5365 | |
5366 HTailCallThroughMegamorphicCache(HValue* context, HValue* receiver, | |
5367 HValue* name) | |
5368 : flags_(NONE) { | |
5369 SetOperandAt(0, context); | 5321 SetOperandAt(0, context); |
5370 SetOperandAt(1, receiver); | 5322 SetOperandAt(1, receiver); |
5371 SetOperandAt(2, name); | 5323 SetOperandAt(2, name); |
5372 } | 5324 } |
5373 | 5325 |
5374 EmbeddedContainer<HValue*, 5> inputs_; | 5326 EmbeddedContainer<HValue*, 3> inputs_; |
5375 Flags flags_; | |
5376 }; | 5327 }; |
5377 | 5328 |
5378 | 5329 |
5379 class HUnknownOSRValue FINAL : public HTemplateInstruction<0> { | 5330 class HUnknownOSRValue FINAL : public HTemplateInstruction<0> { |
5380 public: | 5331 public: |
5381 DECLARE_INSTRUCTION_FACTORY_P2(HUnknownOSRValue, HEnvironment*, int); | 5332 DECLARE_INSTRUCTION_FACTORY_P2(HUnknownOSRValue, HEnvironment*, int); |
5382 | 5333 |
5383 std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT | 5334 std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT |
5384 | 5335 |
5385 Representation RequiredInputRepresentation(int index) OVERRIDE { | 5336 Representation RequiredInputRepresentation(int index) OVERRIDE { |
(...skipping 2487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7873 }; | 7824 }; |
7874 | 7825 |
7875 | 7826 |
7876 | 7827 |
7877 #undef DECLARE_INSTRUCTION | 7828 #undef DECLARE_INSTRUCTION |
7878 #undef DECLARE_CONCRETE_INSTRUCTION | 7829 #undef DECLARE_CONCRETE_INSTRUCTION |
7879 | 7830 |
7880 } } // namespace v8::internal | 7831 } } // namespace v8::internal |
7881 | 7832 |
7882 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 7833 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |