| 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 3239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3250 } | 3250 } |
| 3251 | 3251 |
| 3252 protected: | 3252 protected: |
| 3253 virtual void InternalSetOperandAt(int index, | 3253 virtual void InternalSetOperandAt(int index, |
| 3254 HValue* value) V8_FINAL V8_OVERRIDE { | 3254 HValue* value) V8_FINAL V8_OVERRIDE { |
| 3255 values_[index] = value; | 3255 values_[index] = value; |
| 3256 } | 3256 } |
| 3257 | 3257 |
| 3258 // List of values tracked by this marker. | 3258 // List of values tracked by this marker. |
| 3259 ZoneList<HValue*> values_; | 3259 ZoneList<HValue*> values_; |
| 3260 | |
| 3261 private: | |
| 3262 virtual bool IsDeletable() const V8_FINAL V8_OVERRIDE { return true; } | |
| 3263 }; | 3260 }; |
| 3264 | 3261 |
| 3265 | 3262 |
| 3266 class HArgumentsObject V8_FINAL : public HDematerializedObject { | 3263 class HArgumentsObject V8_FINAL : public HDematerializedObject { |
| 3267 public: | 3264 public: |
| 3268 static HArgumentsObject* New(Zone* zone, HValue* context, int count) { | 3265 static HArgumentsObject* New(Zone* zone, HValue* context, int count) { |
| 3269 return new(zone) HArgumentsObject(count, zone); | 3266 return new(zone) HArgumentsObject(count, zone); |
| 3270 } | 3267 } |
| 3271 | 3268 |
| 3272 // The values contain a list of all elements in the arguments object | 3269 // The values contain a list of all elements in the arguments object |
| 3273 // including the receiver object, which is skipped when materializing. | 3270 // including the receiver object, which is skipped when materializing. |
| 3274 const ZoneList<HValue*>* arguments_values() const { return &values_; } | 3271 const ZoneList<HValue*>* arguments_values() const { return &values_; } |
| 3275 int arguments_count() const { return values_.length(); } | 3272 int arguments_count() const { return values_.length(); } |
| 3276 | 3273 |
| 3277 void AddArgument(HValue* argument, Zone* zone) { | 3274 void AddArgument(HValue* argument, Zone* zone) { |
| 3278 values_.Add(NULL, zone); // Resize list. | 3275 values_.Add(NULL, zone); // Resize list. |
| 3279 SetOperandAt(values_.length() - 1, argument); | 3276 SetOperandAt(values_.length() - 1, argument); |
| 3280 } | 3277 } |
| 3281 | 3278 |
| 3282 DECLARE_CONCRETE_INSTRUCTION(ArgumentsObject) | 3279 DECLARE_CONCRETE_INSTRUCTION(ArgumentsObject) |
| 3283 | 3280 |
| 3284 private: | 3281 private: |
| 3285 HArgumentsObject(int count, Zone* zone) | 3282 HArgumentsObject(int count, Zone* zone) |
| 3286 : HDematerializedObject(count, zone) { | 3283 : HDematerializedObject(count, zone) { |
| 3287 set_representation(Representation::Tagged()); | 3284 set_representation(Representation::Tagged()); |
| 3288 SetFlag(kIsArguments); | 3285 SetFlag(kIsArguments); |
| 3289 } | 3286 } |
| 3287 |
| 3288 virtual bool IsDeletable() const V8_FINAL V8_OVERRIDE { return true; } |
| 3290 }; | 3289 }; |
| 3291 | 3290 |
| 3292 | 3291 |
| 3293 class HCapturedObject V8_FINAL : public HDematerializedObject { | 3292 class HCapturedObject V8_FINAL : public HDematerializedObject { |
| 3294 public: | 3293 public: |
| 3295 HCapturedObject(int length, int id, Zone* zone) | 3294 HCapturedObject(int length, int id, Zone* zone) |
| 3296 : HDematerializedObject(length, zone), capture_id_(id) { | 3295 : HDematerializedObject(length, zone), capture_id_(id) { |
| 3297 set_representation(Representation::Tagged()); | 3296 set_representation(Representation::Tagged()); |
| 3298 values_.AddBlock(NULL, length, zone); // Resize list. | 3297 values_.AddBlock(NULL, length, zone); // Resize list. |
| 3299 } | 3298 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 3316 | 3315 |
| 3317 // Replay effects of this instruction on the given environment. | 3316 // Replay effects of this instruction on the given environment. |
| 3318 void ReplayEnvironment(HEnvironment* env); | 3317 void ReplayEnvironment(HEnvironment* env); |
| 3319 | 3318 |
| 3320 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 3319 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
| 3321 | 3320 |
| 3322 DECLARE_CONCRETE_INSTRUCTION(CapturedObject) | 3321 DECLARE_CONCRETE_INSTRUCTION(CapturedObject) |
| 3323 | 3322 |
| 3324 private: | 3323 private: |
| 3325 int capture_id_; | 3324 int capture_id_; |
| 3325 |
| 3326 // Note that we cannot DCE captured objects as they are used to replay |
| 3327 // the environment. This method is here as an explicit reminder. |
| 3328 // TODO(mstarzinger): Turn HSimulates into full snapshots maybe? |
| 3329 virtual bool IsDeletable() const V8_FINAL V8_OVERRIDE { return false; } |
| 3326 }; | 3330 }; |
| 3327 | 3331 |
| 3328 | 3332 |
| 3329 class HConstant V8_FINAL : public HTemplateInstruction<0> { | 3333 class HConstant V8_FINAL : public HTemplateInstruction<0> { |
| 3330 public: | 3334 public: |
| 3331 DECLARE_INSTRUCTION_FACTORY_P1(HConstant, int32_t); | 3335 DECLARE_INSTRUCTION_FACTORY_P1(HConstant, int32_t); |
| 3332 DECLARE_INSTRUCTION_FACTORY_P2(HConstant, int32_t, Representation); | 3336 DECLARE_INSTRUCTION_FACTORY_P2(HConstant, int32_t, Representation); |
| 3333 DECLARE_INSTRUCTION_FACTORY_P1(HConstant, double); | 3337 DECLARE_INSTRUCTION_FACTORY_P1(HConstant, double); |
| 3334 DECLARE_INSTRUCTION_FACTORY_P1(HConstant, Handle<Object>); | 3338 DECLARE_INSTRUCTION_FACTORY_P1(HConstant, Handle<Object>); |
| 3335 DECLARE_INSTRUCTION_FACTORY_P1(HConstant, ExternalReference); | 3339 DECLARE_INSTRUCTION_FACTORY_P1(HConstant, ExternalReference); |
| (...skipping 3854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7190 virtual bool IsDeletable() const V8_OVERRIDE { return true; } | 7194 virtual bool IsDeletable() const V8_OVERRIDE { return true; } |
| 7191 }; | 7195 }; |
| 7192 | 7196 |
| 7193 | 7197 |
| 7194 #undef DECLARE_INSTRUCTION | 7198 #undef DECLARE_INSTRUCTION |
| 7195 #undef DECLARE_CONCRETE_INSTRUCTION | 7199 #undef DECLARE_CONCRETE_INSTRUCTION |
| 7196 | 7200 |
| 7197 } } // namespace v8::internal | 7201 } } // namespace v8::internal |
| 7198 | 7202 |
| 7199 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 7203 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |