| 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 1975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1986 | 1986 |
| 1987 class HEnterInlined V8_FINAL : public HTemplateInstruction<0> { | 1987 class HEnterInlined V8_FINAL : public HTemplateInstruction<0> { |
| 1988 public: | 1988 public: |
| 1989 static HEnterInlined* New(Zone* zone, | 1989 static HEnterInlined* New(Zone* zone, |
| 1990 HValue* context, | 1990 HValue* context, |
| 1991 Handle<JSFunction> closure, | 1991 Handle<JSFunction> closure, |
| 1992 int arguments_count, | 1992 int arguments_count, |
| 1993 FunctionLiteral* function, | 1993 FunctionLiteral* function, |
| 1994 InliningKind inlining_kind, | 1994 InliningKind inlining_kind, |
| 1995 Variable* arguments_var, | 1995 Variable* arguments_var, |
| 1996 HArgumentsObject* arguments_object, | 1996 HArgumentsObject* arguments_object) { |
| 1997 bool undefined_receiver) { | |
| 1998 return new(zone) HEnterInlined(closure, arguments_count, function, | 1997 return new(zone) HEnterInlined(closure, arguments_count, function, |
| 1999 inlining_kind, arguments_var, | 1998 inlining_kind, arguments_var, |
| 2000 arguments_object, undefined_receiver, zone); | 1999 arguments_object, zone); |
| 2001 } | 2000 } |
| 2002 | 2001 |
| 2003 void RegisterReturnTarget(HBasicBlock* return_target, Zone* zone); | 2002 void RegisterReturnTarget(HBasicBlock* return_target, Zone* zone); |
| 2004 ZoneList<HBasicBlock*>* return_targets() { return &return_targets_; } | 2003 ZoneList<HBasicBlock*>* return_targets() { return &return_targets_; } |
| 2005 | 2004 |
| 2006 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 2005 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
| 2007 | 2006 |
| 2008 Handle<JSFunction> closure() const { return closure_; } | 2007 Handle<JSFunction> closure() const { return closure_; } |
| 2009 int arguments_count() const { return arguments_count_; } | 2008 int arguments_count() const { return arguments_count_; } |
| 2010 bool arguments_pushed() const { return arguments_pushed_; } | 2009 bool arguments_pushed() const { return arguments_pushed_; } |
| 2011 void set_arguments_pushed() { arguments_pushed_ = true; } | 2010 void set_arguments_pushed() { arguments_pushed_ = true; } |
| 2012 FunctionLiteral* function() const { return function_; } | 2011 FunctionLiteral* function() const { return function_; } |
| 2013 InliningKind inlining_kind() const { return inlining_kind_; } | 2012 InliningKind inlining_kind() const { return inlining_kind_; } |
| 2014 bool undefined_receiver() const { return undefined_receiver_; } | |
| 2015 | 2013 |
| 2016 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { | 2014 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { |
| 2017 return Representation::None(); | 2015 return Representation::None(); |
| 2018 } | 2016 } |
| 2019 | 2017 |
| 2020 Variable* arguments_var() { return arguments_var_; } | 2018 Variable* arguments_var() { return arguments_var_; } |
| 2021 HArgumentsObject* arguments_object() { return arguments_object_; } | 2019 HArgumentsObject* arguments_object() { return arguments_object_; } |
| 2022 | 2020 |
| 2023 DECLARE_CONCRETE_INSTRUCTION(EnterInlined) | 2021 DECLARE_CONCRETE_INSTRUCTION(EnterInlined) |
| 2024 | 2022 |
| 2025 private: | 2023 private: |
| 2026 HEnterInlined(Handle<JSFunction> closure, | 2024 HEnterInlined(Handle<JSFunction> closure, |
| 2027 int arguments_count, | 2025 int arguments_count, |
| 2028 FunctionLiteral* function, | 2026 FunctionLiteral* function, |
| 2029 InliningKind inlining_kind, | 2027 InliningKind inlining_kind, |
| 2030 Variable* arguments_var, | 2028 Variable* arguments_var, |
| 2031 HArgumentsObject* arguments_object, | 2029 HArgumentsObject* arguments_object, |
| 2032 bool undefined_receiver, | |
| 2033 Zone* zone) | 2030 Zone* zone) |
| 2034 : closure_(closure), | 2031 : closure_(closure), |
| 2035 arguments_count_(arguments_count), | 2032 arguments_count_(arguments_count), |
| 2036 arguments_pushed_(false), | 2033 arguments_pushed_(false), |
| 2037 function_(function), | 2034 function_(function), |
| 2038 inlining_kind_(inlining_kind), | 2035 inlining_kind_(inlining_kind), |
| 2039 arguments_var_(arguments_var), | 2036 arguments_var_(arguments_var), |
| 2040 arguments_object_(arguments_object), | 2037 arguments_object_(arguments_object), |
| 2041 undefined_receiver_(undefined_receiver), | |
| 2042 return_targets_(2, zone) { | 2038 return_targets_(2, zone) { |
| 2043 } | 2039 } |
| 2044 | 2040 |
| 2045 Handle<JSFunction> closure_; | 2041 Handle<JSFunction> closure_; |
| 2046 int arguments_count_; | 2042 int arguments_count_; |
| 2047 bool arguments_pushed_; | 2043 bool arguments_pushed_; |
| 2048 FunctionLiteral* function_; | 2044 FunctionLiteral* function_; |
| 2049 InliningKind inlining_kind_; | 2045 InliningKind inlining_kind_; |
| 2050 Variable* arguments_var_; | 2046 Variable* arguments_var_; |
| 2051 HArgumentsObject* arguments_object_; | 2047 HArgumentsObject* arguments_object_; |
| 2052 bool undefined_receiver_; | |
| 2053 ZoneList<HBasicBlock*> return_targets_; | 2048 ZoneList<HBasicBlock*> return_targets_; |
| 2054 }; | 2049 }; |
| 2055 | 2050 |
| 2056 | 2051 |
| 2057 class HLeaveInlined V8_FINAL : public HTemplateInstruction<0> { | 2052 class HLeaveInlined V8_FINAL : public HTemplateInstruction<0> { |
| 2058 public: | 2053 public: |
| 2059 HLeaveInlined(HEnterInlined* entry, | 2054 HLeaveInlined(HEnterInlined* entry, |
| 2060 int drop_count) | 2055 int drop_count) |
| 2061 : entry_(entry), | 2056 : entry_(entry), |
| 2062 drop_count_(drop_count) { } | 2057 drop_count_(drop_count) { } |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2407 HCallNamed(HValue* context, Handle<String> name, int argument_count) | 2402 HCallNamed(HValue* context, Handle<String> name, int argument_count) |
| 2408 : HUnaryCall(context, argument_count), name_(name) { | 2403 : HUnaryCall(context, argument_count), name_(name) { |
| 2409 } | 2404 } |
| 2410 | 2405 |
| 2411 Handle<String> name_; | 2406 Handle<String> name_; |
| 2412 }; | 2407 }; |
| 2413 | 2408 |
| 2414 | 2409 |
| 2415 enum CallMode { | 2410 enum CallMode { |
| 2416 NORMAL_CALL, | 2411 NORMAL_CALL, |
| 2417 TAIL_CALL | 2412 TAIL_CALL, |
| 2413 NORMAL_CONTEXTUAL_CALL |
| 2418 }; | 2414 }; |
| 2419 | 2415 |
| 2420 | 2416 |
| 2421 class HCallFunction V8_FINAL : public HBinaryCall { | 2417 class HCallFunction V8_FINAL : public HBinaryCall { |
| 2422 public: | 2418 public: |
| 2423 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HCallFunction, HValue*, int); | 2419 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HCallFunction, HValue*, int); |
| 2424 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3( | 2420 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3( |
| 2425 HCallFunction, HValue*, int, CallMode); | 2421 HCallFunction, HValue*, int, CallMode); |
| 2426 | 2422 |
| 2427 bool IsTailCall() const { return call_mode_ == TAIL_CALL; } | 2423 bool IsTailCall() const { return call_mode_ == TAIL_CALL; } |
| 2428 | 2424 bool IsContextualCall() const { return call_mode_ == NORMAL_CONTEXTUAL_CALL; } |
| 2429 HValue* context() { return first(); } | 2425 HValue* context() { return first(); } |
| 2430 HValue* function() { return second(); } | 2426 HValue* function() { return second(); } |
| 2431 | 2427 |
| 2432 DECLARE_CONCRETE_INSTRUCTION(CallFunction) | 2428 DECLARE_CONCRETE_INSTRUCTION(CallFunction) |
| 2433 | 2429 |
| 2434 virtual int argument_delta() const V8_OVERRIDE { | 2430 virtual int argument_delta() const V8_OVERRIDE { |
| 2435 if (IsTailCall()) return 0; | 2431 if (IsTailCall()) return 0; |
| 2436 return -argument_count(); | 2432 return -argument_count(); |
| 2437 } | 2433 } |
| 2438 | 2434 |
| (...skipping 3500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5939 } | 5935 } |
| 5940 | 5936 |
| 5941 inline Representation representation() const { | 5937 inline Representation representation() const { |
| 5942 return Representation::FromKind(RepresentationField::decode(value_)); | 5938 return Representation::FromKind(RepresentationField::decode(value_)); |
| 5943 } | 5939 } |
| 5944 | 5940 |
| 5945 inline Handle<String> name() const { | 5941 inline Handle<String> name() const { |
| 5946 return name_; | 5942 return name_; |
| 5947 } | 5943 } |
| 5948 | 5944 |
| 5945 inline bool immutable() const { |
| 5946 return ImmutableField::decode(value_); |
| 5947 } |
| 5948 |
| 5949 inline HObjectAccess WithRepresentation(Representation representation) { | 5949 inline HObjectAccess WithRepresentation(Representation representation) { |
| 5950 return HObjectAccess(portion(), offset(), representation, name()); | 5950 return HObjectAccess(portion(), offset(), representation, name()); |
| 5951 } | 5951 } |
| 5952 | 5952 |
| 5953 static HObjectAccess ForHeapNumberValue() { | 5953 static HObjectAccess ForHeapNumberValue() { |
| 5954 return HObjectAccess( | 5954 return HObjectAccess( |
| 5955 kDouble, HeapNumber::kValueOffset, Representation::Double()); | 5955 kDouble, HeapNumber::kValueOffset, Representation::Double()); |
| 5956 } | 5956 } |
| 5957 | 5957 |
| 5958 static HObjectAccess ForHeapNumberValueLowestBits() { | 5958 static HObjectAccess ForHeapNumberValueLowestBits() { |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6173 kStringLengths, // the length of a string | 6173 kStringLengths, // the length of a string |
| 6174 kElementsPointer, // elements pointer | 6174 kElementsPointer, // elements pointer |
| 6175 kBackingStore, // some field in the backing store | 6175 kBackingStore, // some field in the backing store |
| 6176 kDouble, // some double field | 6176 kDouble, // some double field |
| 6177 kInobject, // some other in-object field | 6177 kInobject, // some other in-object field |
| 6178 kExternalMemory // some field in external memory | 6178 kExternalMemory // some field in external memory |
| 6179 }; | 6179 }; |
| 6180 | 6180 |
| 6181 HObjectAccess(Portion portion, int offset, | 6181 HObjectAccess(Portion portion, int offset, |
| 6182 Representation representation = Representation::Tagged(), | 6182 Representation representation = Representation::Tagged(), |
| 6183 Handle<String> name = Handle<String>::null()) | 6183 Handle<String> name = Handle<String>::null(), |
| 6184 bool immutable = false) |
| 6184 : value_(PortionField::encode(portion) | | 6185 : value_(PortionField::encode(portion) | |
| 6185 RepresentationField::encode(representation.kind()) | | 6186 RepresentationField::encode(representation.kind()) | |
| 6187 ImmutableField::encode(immutable ? 1 : 0) | |
| 6186 OffsetField::encode(offset)), | 6188 OffsetField::encode(offset)), |
| 6187 name_(name) { | 6189 name_(name) { |
| 6188 // assert that the fields decode correctly | 6190 // assert that the fields decode correctly |
| 6189 ASSERT(this->offset() == offset); | 6191 ASSERT(this->offset() == offset); |
| 6190 ASSERT(this->portion() == portion); | 6192 ASSERT(this->portion() == portion); |
| 6193 ASSERT(this->immutable() == immutable); |
| 6191 ASSERT(RepresentationField::decode(value_) == representation.kind()); | 6194 ASSERT(RepresentationField::decode(value_) == representation.kind()); |
| 6192 } | 6195 } |
| 6193 | 6196 |
| 6194 class PortionField : public BitField<Portion, 0, 3> {}; | 6197 class PortionField : public BitField<Portion, 0, 3> {}; |
| 6195 class RepresentationField : public BitField<Representation::Kind, 3, 4> {}; | 6198 class RepresentationField : public BitField<Representation::Kind, 3, 4> {}; |
| 6196 class OffsetField : public BitField<int, 7, 25> {}; | 6199 class ImmutableField : public BitField<bool, 7, 1> {}; |
| 6200 class OffsetField : public BitField<int, 8, 24> {}; |
| 6197 | 6201 |
| 6198 uint32_t value_; // encodes portion, representation, and offset | 6202 uint32_t value_; // encodes portion, representation, immutable, and offset |
| 6199 Handle<String> name_; | 6203 Handle<String> name_; |
| 6200 | 6204 |
| 6201 friend class HLoadNamedField; | 6205 friend class HLoadNamedField; |
| 6202 friend class HStoreNamedField; | 6206 friend class HStoreNamedField; |
| 6203 | 6207 |
| 6204 inline Portion portion() const { | 6208 inline Portion portion() const { |
| 6205 return PortionField::decode(value_); | 6209 return PortionField::decode(value_); |
| 6206 } | 6210 } |
| 6207 }; | 6211 }; |
| 6208 | 6212 |
| (...skipping 1367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7576 virtual bool IsDeletable() const V8_OVERRIDE { return true; } | 7580 virtual bool IsDeletable() const V8_OVERRIDE { return true; } |
| 7577 }; | 7581 }; |
| 7578 | 7582 |
| 7579 | 7583 |
| 7580 #undef DECLARE_INSTRUCTION | 7584 #undef DECLARE_INSTRUCTION |
| 7581 #undef DECLARE_CONCRETE_INSTRUCTION | 7585 #undef DECLARE_CONCRETE_INSTRUCTION |
| 7582 | 7586 |
| 7583 } } // namespace v8::internal | 7587 } } // namespace v8::internal |
| 7584 | 7588 |
| 7585 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 7589 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |