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

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

Issue 12051058: Allow monomorphic loads when static type is known. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 11 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/hydrogen-instructions.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 752 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 763
764 // Printing support. 764 // Printing support.
765 virtual void PrintTo(StringStream* stream) = 0; 765 virtual void PrintTo(StringStream* stream) = 0;
766 void PrintNameTo(StringStream* stream); 766 void PrintNameTo(StringStream* stream);
767 void PrintTypeTo(StringStream* stream); 767 void PrintTypeTo(StringStream* stream);
768 void PrintRangeTo(StringStream* stream); 768 void PrintRangeTo(StringStream* stream);
769 void PrintChangesTo(StringStream* stream); 769 void PrintChangesTo(StringStream* stream);
770 770
771 const char* Mnemonic() const; 771 const char* Mnemonic() const;
772 772
773 // Type information helpers.
774 bool HasMonomorphicJSObjectType();
775
776 // TODO(mstarzinger): For now instructions can override this function to
777 // specify statically known types, once HType can convey more information
778 // it should be based on the HType.
779 virtual Handle<Map> GetMonomorphicJSObjectMap() { return Handle<Map>(); }
780
773 // Updated the inferred type of this instruction and returns true if 781 // Updated the inferred type of this instruction and returns true if
774 // it has changed. 782 // it has changed.
775 bool UpdateInferredType(); 783 bool UpdateInferredType();
776 784
777 virtual HType CalculateInferredType(); 785 virtual HType CalculateInferredType();
778 786
779 // This function must be overridden for instructions which have the 787 // This function must be overridden for instructions which have the
780 // kTrackSideEffectDominators flag set, to track instructions that are 788 // kTrackSideEffectDominators flag set, to track instructions that are
781 // dominating side effects. 789 // dominating side effects.
782 virtual void SetSideEffectDominator(GVNFlag side_effect, HValue* dominator) { 790 virtual void SetSideEffectDominator(GVNFlag side_effect, HValue* dominator) {
(...skipping 4229 matching lines...) Expand 10 before | Expand all | Expand 10 after
5012 5020
5013 // Maximum instance size for which allocations will be inlined. 5021 // Maximum instance size for which allocations will be inlined.
5014 static const int kMaxSize = 64 * kPointerSize; 5022 static const int kMaxSize = 64 * kPointerSize;
5015 5023
5016 HValue* context() { return OperandAt(0); } 5024 HValue* context() { return OperandAt(0); }
5017 Handle<JSFunction> constructor() { return constructor_; } 5025 Handle<JSFunction> constructor() { return constructor_; }
5018 5026
5019 virtual Representation RequiredInputRepresentation(int index) { 5027 virtual Representation RequiredInputRepresentation(int index) {
5020 return Representation::Tagged(); 5028 return Representation::Tagged();
5021 } 5029 }
5030 virtual Handle<Map> GetMonomorphicJSObjectMap() {
5031 ASSERT(constructor()->has_initial_map());
5032 return Handle<Map>(constructor()->initial_map());
5033 }
5022 virtual HType CalculateInferredType(); 5034 virtual HType CalculateInferredType();
5023 5035
5024 DECLARE_CONCRETE_INSTRUCTION(AllocateObject) 5036 DECLARE_CONCRETE_INSTRUCTION(AllocateObject)
5025 5037
5026 private: 5038 private:
5027 // TODO(svenpanne) Might be safe, but leave it out until we know for sure. 5039 // TODO(svenpanne) Might be safe, but leave it out until we know for sure.
5028 // virtual bool IsDeletable() const { return true; } 5040 // virtual bool IsDeletable() const { return true; }
5029 5041
5030 Handle<JSFunction> constructor_; 5042 Handle<JSFunction> constructor_;
5031 }; 5043 };
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
5079 // graphs to be considered for fast deep-copying. 5091 // graphs to be considered for fast deep-copying.
5080 static const int kMaxLiteralDepth = 3; 5092 static const int kMaxLiteralDepth = 3;
5081 static const int kMaxLiteralProperties = 8; 5093 static const int kMaxLiteralProperties = 8;
5082 5094
5083 HValue* context() { return OperandAt(0); } 5095 HValue* context() { return OperandAt(0); }
5084 Handle<JSObject> boilerplate() const { return boilerplate_; } 5096 Handle<JSObject> boilerplate() const { return boilerplate_; }
5085 int total_size() const { return total_size_; } 5097 int total_size() const { return total_size_; }
5086 virtual Representation RequiredInputRepresentation(int index) { 5098 virtual Representation RequiredInputRepresentation(int index) {
5087 return Representation::Tagged(); 5099 return Representation::Tagged();
5088 } 5100 }
5101 virtual Handle<Map> GetMonomorphicJSObjectMap() {
5102 return Handle<Map>(boilerplate()->map());
5103 }
5089 virtual HType CalculateInferredType(); 5104 virtual HType CalculateInferredType();
5090 5105
5091 DECLARE_CONCRETE_INSTRUCTION(FastLiteral) 5106 DECLARE_CONCRETE_INSTRUCTION(FastLiteral)
5092 5107
5093 private: 5108 private:
5094 Handle<JSObject> boilerplate_; 5109 Handle<JSObject> boilerplate_;
5095 int total_size_; 5110 int total_size_;
5096 }; 5111 };
5097 5112
5098 5113
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
5524 virtual bool IsDeletable() const { return true; } 5539 virtual bool IsDeletable() const { return true; }
5525 }; 5540 };
5526 5541
5527 5542
5528 #undef DECLARE_INSTRUCTION 5543 #undef DECLARE_INSTRUCTION
5529 #undef DECLARE_CONCRETE_INSTRUCTION 5544 #undef DECLARE_CONCRETE_INSTRUCTION
5530 5545
5531 } } // namespace v8::internal 5546 } } // namespace v8::internal
5532 5547
5533 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 5548 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698