| OLD | NEW |
| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 #define HYDROGEN_CONCRETE_INSTRUCTION_LIST(V) \ | 63 #define HYDROGEN_CONCRETE_INSTRUCTION_LIST(V) \ |
| 64 V(AbnormalExit) \ | 64 V(AbnormalExit) \ |
| 65 V(AccessArgumentsAt) \ | 65 V(AccessArgumentsAt) \ |
| 66 V(Add) \ | 66 V(Add) \ |
| 67 V(Allocate) \ | 67 V(Allocate) \ |
| 68 V(AllocateObject) \ | 68 V(AllocateObject) \ |
| 69 V(ApplyArguments) \ | 69 V(ApplyArguments) \ |
| 70 V(ArgumentsElements) \ | 70 V(ArgumentsElements) \ |
| 71 V(ArgumentsLength) \ | 71 V(ArgumentsLength) \ |
| 72 V(ArgumentsObject) \ | 72 V(ArgumentsObject) \ |
| 73 V(ArrayLiteral) \ | |
| 74 V(Bitwise) \ | 73 V(Bitwise) \ |
| 75 V(BitNot) \ | 74 V(BitNot) \ |
| 76 V(BlockEntry) \ | 75 V(BlockEntry) \ |
| 77 V(BoundsCheck) \ | 76 V(BoundsCheck) \ |
| 78 V(BoundsCheckBaseIndexInformation) \ | 77 V(BoundsCheckBaseIndexInformation) \ |
| 79 V(Branch) \ | 78 V(Branch) \ |
| 80 V(CallConstantFunction) \ | 79 V(CallConstantFunction) \ |
| 81 V(CallFunction) \ | 80 V(CallFunction) \ |
| 82 V(CallGlobal) \ | 81 V(CallGlobal) \ |
| 83 V(CallKeyed) \ | 82 V(CallKeyed) \ |
| (...skipping 5967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6051 | 6050 |
| 6052 private: | 6051 private: |
| 6053 virtual bool IsDeletable() const { return true; } | 6052 virtual bool IsDeletable() const { return true; } |
| 6054 | 6053 |
| 6055 int literal_index_; | 6054 int literal_index_; |
| 6056 int depth_; | 6055 int depth_; |
| 6057 AllocationSiteMode allocation_site_mode_; | 6056 AllocationSiteMode allocation_site_mode_; |
| 6058 }; | 6057 }; |
| 6059 | 6058 |
| 6060 | 6059 |
| 6061 class HArrayLiteral: public HMaterializedLiteral<1> { | |
| 6062 public: | |
| 6063 HArrayLiteral(HValue* context, | |
| 6064 Handle<HeapObject> boilerplate_object, | |
| 6065 Handle<FixedArray> literals, | |
| 6066 int length, | |
| 6067 int literal_index, | |
| 6068 int depth, | |
| 6069 AllocationSiteMode mode) | |
| 6070 : HMaterializedLiteral<1>(literal_index, depth, mode), | |
| 6071 length_(length), | |
| 6072 boilerplate_object_(boilerplate_object), | |
| 6073 literals_(literals) { | |
| 6074 SetOperandAt(0, context); | |
| 6075 SetGVNFlag(kChangesNewSpacePromotion); | |
| 6076 | |
| 6077 boilerplate_elements_kind_ = boilerplate_object_->IsJSObject() | |
| 6078 ? Handle<JSObject>::cast(boilerplate_object_)->GetElementsKind() | |
| 6079 : TERMINAL_FAST_ELEMENTS_KIND; | |
| 6080 | |
| 6081 is_copy_on_write_ = boilerplate_object_->IsJSObject() && | |
| 6082 (Handle<JSObject>::cast(boilerplate_object_)->elements()->map() == | |
| 6083 HEAP->fixed_cow_array_map()); | |
| 6084 } | |
| 6085 | |
| 6086 HValue* context() { return OperandAt(0); } | |
| 6087 ElementsKind boilerplate_elements_kind() const { | |
| 6088 return boilerplate_elements_kind_; | |
| 6089 } | |
| 6090 Handle<HeapObject> boilerplate_object() const { return boilerplate_object_; } | |
| 6091 Handle<FixedArray> literals() const { return literals_; } | |
| 6092 int length() const { return length_; } | |
| 6093 bool IsCopyOnWrite() const { return is_copy_on_write_; } | |
| 6094 | |
| 6095 virtual Representation RequiredInputRepresentation(int index) { | |
| 6096 return Representation::Tagged(); | |
| 6097 } | |
| 6098 virtual HType CalculateInferredType(); | |
| 6099 | |
| 6100 DECLARE_CONCRETE_INSTRUCTION(ArrayLiteral) | |
| 6101 | |
| 6102 private: | |
| 6103 int length_; | |
| 6104 Handle<HeapObject> boilerplate_object_; | |
| 6105 Handle<FixedArray> literals_; | |
| 6106 ElementsKind boilerplate_elements_kind_; | |
| 6107 bool is_copy_on_write_; | |
| 6108 }; | |
| 6109 | |
| 6110 | |
| 6111 class HRegExpLiteral: public HMaterializedLiteral<1> { | 6060 class HRegExpLiteral: public HMaterializedLiteral<1> { |
| 6112 public: | 6061 public: |
| 6113 HRegExpLiteral(HValue* context, | 6062 HRegExpLiteral(HValue* context, |
| 6114 Handle<FixedArray> literals, | 6063 Handle<FixedArray> literals, |
| 6115 Handle<String> pattern, | 6064 Handle<String> pattern, |
| 6116 Handle<String> flags, | 6065 Handle<String> flags, |
| 6117 int literal_index) | 6066 int literal_index) |
| 6118 : HMaterializedLiteral<1>(literal_index, 0), | 6067 : HMaterializedLiteral<1>(literal_index, 0), |
| 6119 literals_(literals), | 6068 literals_(literals), |
| 6120 pattern_(pattern), | 6069 pattern_(pattern), |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6491 virtual bool IsDeletable() const { return true; } | 6440 virtual bool IsDeletable() const { return true; } |
| 6492 }; | 6441 }; |
| 6493 | 6442 |
| 6494 | 6443 |
| 6495 #undef DECLARE_INSTRUCTION | 6444 #undef DECLARE_INSTRUCTION |
| 6496 #undef DECLARE_CONCRETE_INSTRUCTION | 6445 #undef DECLARE_CONCRETE_INSTRUCTION |
| 6497 | 6446 |
| 6498 } } // namespace v8::internal | 6447 } } // namespace v8::internal |
| 6499 | 6448 |
| 6500 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 6449 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |