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

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

Issue 12880017: Build fast literals in hydrogen. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 8 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 V(CompareConstantEqAndBranch) \ 104 V(CompareConstantEqAndBranch) \
105 V(Constant) \ 105 V(Constant) \
106 V(Context) \ 106 V(Context) \
107 V(DeclareGlobals) \ 107 V(DeclareGlobals) \
108 V(DeleteProperty) \ 108 V(DeleteProperty) \
109 V(Deoptimize) \ 109 V(Deoptimize) \
110 V(Div) \ 110 V(Div) \
111 V(DummyUse) \ 111 V(DummyUse) \
112 V(ElementsKind) \ 112 V(ElementsKind) \
113 V(EnterInlined) \ 113 V(EnterInlined) \
114 V(FastLiteral) \
115 V(FixedArrayBaseLength) \ 114 V(FixedArrayBaseLength) \
116 V(ForceRepresentation) \ 115 V(ForceRepresentation) \
117 V(FunctionLiteral) \ 116 V(FunctionLiteral) \
118 V(GetCachedArrayIndex) \ 117 V(GetCachedArrayIndex) \
119 V(GlobalObject) \ 118 V(GlobalObject) \
120 V(GlobalReceiver) \ 119 V(GlobalReceiver) \
121 V(Goto) \ 120 V(Goto) \
122 V(HasCachedArrayIndexAndBranch) \ 121 V(HasCachedArrayIndexAndBranch) \
123 V(HasInstanceTypeAndBranch) \ 122 V(HasInstanceTypeAndBranch) \
124 V(InductionVariableAnnotation) \ 123 V(InductionVariableAnnotation) \
(...skipping 4841 matching lines...) Expand 10 before | Expand all | Expand 10 after
4966 4965
4967 4966
4968 inline bool ReceiverObjectNeedsWriteBarrier(HValue* object, 4967 inline bool ReceiverObjectNeedsWriteBarrier(HValue* object,
4969 HValue* new_space_dominator) { 4968 HValue* new_space_dominator) {
4970 if (object->IsInnerAllocatedObject()) { 4969 if (object->IsInnerAllocatedObject()) {
4971 return ReceiverObjectNeedsWriteBarrier( 4970 return ReceiverObjectNeedsWriteBarrier(
4972 HInnerAllocatedObject::cast(object)->base_object(), 4971 HInnerAllocatedObject::cast(object)->base_object(),
4973 new_space_dominator); 4972 new_space_dominator);
4974 } 4973 }
4975 if (object != new_space_dominator) return true; 4974 if (object != new_space_dominator) return true;
4976 if (object->IsFastLiteral()) return false;
4977 if (object->IsAllocateObject()) return false; 4975 if (object->IsAllocateObject()) return false;
4978 if (object->IsAllocate()) { 4976 if (object->IsAllocate()) {
4979 return !HAllocate::cast(object)->GuaranteedInNewSpace(); 4977 return !HAllocate::cast(object)->GuaranteedInNewSpace();
4980 } 4978 }
4981 return true; 4979 return true;
4982 } 4980 }
4983 4981
4984 4982
4985 class HStoreGlobalCell: public HUnaryOperation { 4983 class HStoreGlobalCell: public HUnaryOperation {
4986 public: 4984 public:
(...skipping 994 matching lines...) Expand 10 before | Expand all | Expand 10 after
5981 5979
5982 private: 5980 private:
5983 virtual bool IsDeletable() const { return true; } 5981 virtual bool IsDeletable() const { return true; }
5984 5982
5985 int literal_index_; 5983 int literal_index_;
5986 int depth_; 5984 int depth_;
5987 AllocationSiteMode allocation_site_mode_; 5985 AllocationSiteMode allocation_site_mode_;
5988 }; 5986 };
5989 5987
5990 5988
5991 class HFastLiteral: public HMaterializedLiteral<1> {
5992 public:
5993 HFastLiteral(HValue* context,
5994 Handle<JSObject> boilerplate,
5995 int total_size,
5996 int literal_index,
5997 int depth,
5998 AllocationSiteMode mode)
5999 : HMaterializedLiteral<1>(literal_index, depth, mode),
6000 boilerplate_(boilerplate),
6001 total_size_(total_size) {
6002 SetOperandAt(0, context);
6003 SetGVNFlag(kChangesNewSpacePromotion);
6004 }
6005
6006 // Maximum depth and total number of elements and properties for literal
6007 // graphs to be considered for fast deep-copying.
6008 static const int kMaxLiteralDepth = 3;
6009 static const int kMaxLiteralProperties = 8;
6010
6011 HValue* context() { return OperandAt(0); }
6012 Handle<JSObject> boilerplate() const { return boilerplate_; }
6013 int total_size() const { return total_size_; }
6014 virtual Representation RequiredInputRepresentation(int index) {
6015 return Representation::Tagged();
6016 }
6017 virtual Handle<Map> GetMonomorphicJSObjectMap() {
6018 return Handle<Map>(boilerplate()->map());
6019 }
6020 virtual HType CalculateInferredType();
6021
6022 DECLARE_CONCRETE_INSTRUCTION(FastLiteral)
6023
6024 private:
6025 Handle<JSObject> boilerplate_;
6026 int total_size_;
6027 };
6028
6029
6030 class HArrayLiteral: public HMaterializedLiteral<1> { 5989 class HArrayLiteral: public HMaterializedLiteral<1> {
6031 public: 5990 public:
6032 HArrayLiteral(HValue* context, 5991 HArrayLiteral(HValue* context,
6033 Handle<HeapObject> boilerplate_object, 5992 Handle<HeapObject> boilerplate_object,
6034 int length, 5993 int length,
6035 int literal_index, 5994 int literal_index,
6036 int depth, 5995 int depth,
6037 AllocationSiteMode mode) 5996 AllocationSiteMode mode)
6038 : HMaterializedLiteral<1>(literal_index, depth, mode), 5997 : HMaterializedLiteral<1>(literal_index, depth, mode),
6039 length_(length), 5998 length_(length),
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
6207 DECLARE_CONCRETE_INSTRUCTION(TrapAllocationMemento) 6166 DECLARE_CONCRETE_INSTRUCTION(TrapAllocationMemento)
6208 }; 6167 };
6209 6168
6210 6169
6211 class HToFastProperties: public HUnaryOperation { 6170 class HToFastProperties: public HUnaryOperation {
6212 public: 6171 public:
6213 explicit HToFastProperties(HValue* value) : HUnaryOperation(value) { 6172 explicit HToFastProperties(HValue* value) : HUnaryOperation(value) {
6214 // This instruction is not marked as having side effects, but 6173 // This instruction is not marked as having side effects, but
6215 // changes the map of the input operand. Use it only when creating 6174 // changes the map of the input operand. Use it only when creating
6216 // object literals. 6175 // object literals.
6217 ASSERT(value->IsObjectLiteral() || value->IsFastLiteral()); 6176 ASSERT(value->IsObjectLiteral());
6218 set_representation(Representation::Tagged()); 6177 set_representation(Representation::Tagged());
6219 } 6178 }
6220 6179
6221 virtual Representation RequiredInputRepresentation(int index) { 6180 virtual Representation RequiredInputRepresentation(int index) {
6222 return Representation::Tagged(); 6181 return Representation::Tagged();
6223 } 6182 }
6224 6183
6225 DECLARE_CONCRETE_INSTRUCTION(ToFastProperties) 6184 DECLARE_CONCRETE_INSTRUCTION(ToFastProperties)
6226 6185
6227 private: 6186 private:
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
6471 virtual bool IsDeletable() const { return true; } 6430 virtual bool IsDeletable() const { return true; }
6472 }; 6431 };
6473 6432
6474 6433
6475 #undef DECLARE_INSTRUCTION 6434 #undef DECLARE_INSTRUCTION
6476 #undef DECLARE_CONCRETE_INSTRUCTION 6435 #undef DECLARE_CONCRETE_INSTRUCTION
6477 6436
6478 } } // namespace v8::internal 6437 } } // namespace v8::internal
6479 6438
6480 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 6439 #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