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

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

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

Powered by Google App Engine
This is Rietveld 408576698