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

Side by Side Diff: src/hydrogen-instructions.h

Issue 135593006: Optimize HWrapReceiver (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Syntax fixes Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « src/hydrogen.cc ('k') | src/ia32/lithium-codegen-ia32.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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 3673 matching lines...) Expand 10 before | Expand all | Expand 10 after
3684 3684
3685 Representation observed_input_representation_[2]; 3685 Representation observed_input_representation_[2];
3686 Representation observed_output_representation_; 3686 Representation observed_output_representation_;
3687 }; 3687 };
3688 3688
3689 3689
3690 class HWrapReceiver V8_FINAL : public HTemplateInstruction<2> { 3690 class HWrapReceiver V8_FINAL : public HTemplateInstruction<2> {
3691 public: 3691 public:
3692 DECLARE_INSTRUCTION_FACTORY_P2(HWrapReceiver, HValue*, HValue*); 3692 DECLARE_INSTRUCTION_FACTORY_P2(HWrapReceiver, HValue*, HValue*);
3693 3693
3694 virtual bool DataEquals(HValue* other) V8_OVERRIDE { return true; }
3695
3694 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { 3696 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
3695 return Representation::Tagged(); 3697 return Representation::Tagged();
3696 } 3698 }
3697 3699
3698 HValue* receiver() { return OperandAt(0); } 3700 HValue* receiver() { return OperandAt(0); }
3699 HValue* function() { return OperandAt(1); } 3701 HValue* function() { return OperandAt(1); }
3700 3702
3701 virtual HValue* Canonicalize() V8_OVERRIDE; 3703 virtual HValue* Canonicalize() V8_OVERRIDE;
3702 3704
3703 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; 3705 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
3706 bool known_function() const { return known_function_; }
3704 3707
3705 DECLARE_CONCRETE_INSTRUCTION(WrapReceiver) 3708 DECLARE_CONCRETE_INSTRUCTION(WrapReceiver)
3706 3709
3707 private: 3710 private:
3708 HWrapReceiver(HValue* receiver, HValue* function) { 3711 HWrapReceiver(HValue* receiver, HValue* function) {
3712 known_function_ = function->IsConstant() &&
3713 HConstant::cast(function)->handle(function->isolate())->IsJSFunction();
3709 set_representation(Representation::Tagged()); 3714 set_representation(Representation::Tagged());
3710 SetOperandAt(0, receiver); 3715 SetOperandAt(0, receiver);
3711 SetOperandAt(1, function); 3716 SetOperandAt(1, function);
3717 SetFlag(kUseGVN);
3712 } 3718 }
3719
3720 bool known_function_;
3713 }; 3721 };
3714 3722
3715 3723
3716 class HApplyArguments V8_FINAL : public HTemplateInstruction<4> { 3724 class HApplyArguments V8_FINAL : public HTemplateInstruction<4> {
3717 public: 3725 public:
3718 DECLARE_INSTRUCTION_FACTORY_P4(HApplyArguments, HValue*, HValue*, HValue*, 3726 DECLARE_INSTRUCTION_FACTORY_P4(HApplyArguments, HValue*, HValue*, HValue*,
3719 HValue*); 3727 HValue*);
3720 3728
3721 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { 3729 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
3722 // The length is untagged, all other inputs are tagged. 3730 // The length is untagged, all other inputs are tagged.
(...skipping 3687 matching lines...) Expand 10 before | Expand all | Expand 10 after
7410 virtual bool IsDeletable() const V8_OVERRIDE { return true; } 7418 virtual bool IsDeletable() const V8_OVERRIDE { return true; }
7411 }; 7419 };
7412 7420
7413 7421
7414 #undef DECLARE_INSTRUCTION 7422 #undef DECLARE_INSTRUCTION
7415 #undef DECLARE_CONCRETE_INSTRUCTION 7423 #undef DECLARE_CONCRETE_INSTRUCTION
7416 7424
7417 } } // namespace v8::internal 7425 } } // namespace v8::internal
7418 7426
7419 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 7427 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698