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

Side by Side Diff: src/hydrogen.h

Issue 31943002: Allow constants to be deleted by reinserting them into the graph as needed. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 2 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/code-stubs-hydrogen.cc ('k') | src/hydrogen.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 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 // Returns false if there are phi-uses of the arguments-object 331 // Returns false if there are phi-uses of the arguments-object
332 // which are not supported by the optimizing compiler. 332 // which are not supported by the optimizing compiler.
333 bool CheckArgumentsPhiUses(); 333 bool CheckArgumentsPhiUses();
334 334
335 // Returns false if there are phi-uses of an uninitialized const 335 // Returns false if there are phi-uses of an uninitialized const
336 // which are not supported by the optimizing compiler. 336 // which are not supported by the optimizing compiler.
337 bool CheckConstPhiUses(); 337 bool CheckConstPhiUses();
338 338
339 void CollectPhis(); 339 void CollectPhis();
340 340
341 void set_undefined_constant(HConstant* constant) { 341 HConstant* GetConstantUndefined();
342 undefined_constant_.set(constant);
343 }
344 HConstant* GetConstantUndefined() const { return undefined_constant_.get(); }
345 HConstant* GetConstant0(); 342 HConstant* GetConstant0();
346 HConstant* GetConstant1(); 343 HConstant* GetConstant1();
347 HConstant* GetConstantMinus1(); 344 HConstant* GetConstantMinus1();
348 HConstant* GetConstantTrue(); 345 HConstant* GetConstantTrue();
349 HConstant* GetConstantFalse(); 346 HConstant* GetConstantFalse();
350 HConstant* GetConstantHole(); 347 HConstant* GetConstantHole();
351 HConstant* GetConstantNull(); 348 HConstant* GetConstantNull();
352 HConstant* GetInvalidContext(); 349 HConstant* GetInvalidContext();
353 350
354 bool IsStandardConstant(HConstant* constant); 351 bool IsStandardConstant(HConstant* constant);
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 uint32_instructions_ = new(zone()) ZoneList<HInstruction*>(4, zone()); 446 uint32_instructions_ = new(zone()) ZoneList<HInstruction*>(4, zone());
450 } 447 }
451 uint32_instructions_->Add(instr, zone()); 448 uint32_instructions_->Add(instr, zone());
452 } 449 }
453 450
454 void IncrementInNoSideEffectsScope() { no_side_effects_scope_count_++; } 451 void IncrementInNoSideEffectsScope() { no_side_effects_scope_count_++; }
455 void DecrementInNoSideEffectsScope() { no_side_effects_scope_count_--; } 452 void DecrementInNoSideEffectsScope() { no_side_effects_scope_count_--; }
456 bool IsInsideNoSideEffectsScope() { return no_side_effects_scope_count_ > 0; } 453 bool IsInsideNoSideEffectsScope() { return no_side_effects_scope_count_ > 0; }
457 454
458 private: 455 private:
456 HConstant* ReinsertConstantIfNecessary(HConstant* constant);
459 HConstant* GetConstant(SetOncePointer<HConstant>* pointer, 457 HConstant* GetConstant(SetOncePointer<HConstant>* pointer,
460 int32_t integer_value); 458 int32_t integer_value);
461 459
462 template<class Phase> 460 template<class Phase>
463 void Run() { 461 void Run() {
464 Phase phase(this); 462 Phase phase(this);
465 phase.Run(); 463 phase.Run();
466 } 464 }
467 465
468 void EliminateRedundantBoundsChecksUsingInductionVariables(); 466 void EliminateRedundantBoundsChecksUsingInductionVariables();
469 467
470 Isolate* isolate_; 468 Isolate* isolate_;
471 int next_block_id_; 469 int next_block_id_;
472 HBasicBlock* entry_block_; 470 HBasicBlock* entry_block_;
473 HEnvironment* start_environment_; 471 HEnvironment* start_environment_;
474 ZoneList<HBasicBlock*> blocks_; 472 ZoneList<HBasicBlock*> blocks_;
475 ZoneList<HValue*> values_; 473 ZoneList<HValue*> values_;
476 ZoneList<HPhi*>* phi_list_; 474 ZoneList<HPhi*>* phi_list_;
477 ZoneList<HInstruction*>* uint32_instructions_; 475 ZoneList<HInstruction*>* uint32_instructions_;
478 SetOncePointer<HConstant> undefined_constant_; 476 SetOncePointer<HConstant> constant_undefined_;
479 SetOncePointer<HConstant> constant_0_; 477 SetOncePointer<HConstant> constant_0_;
480 SetOncePointer<HConstant> constant_1_; 478 SetOncePointer<HConstant> constant_1_;
481 SetOncePointer<HConstant> constant_minus1_; 479 SetOncePointer<HConstant> constant_minus1_;
482 SetOncePointer<HConstant> constant_true_; 480 SetOncePointer<HConstant> constant_true_;
483 SetOncePointer<HConstant> constant_false_; 481 SetOncePointer<HConstant> constant_false_;
484 SetOncePointer<HConstant> constant_the_hole_; 482 SetOncePointer<HConstant> constant_the_hole_;
485 SetOncePointer<HConstant> constant_null_; 483 SetOncePointer<HConstant> constant_null_;
486 SetOncePointer<HConstant> constant_invalid_context_; 484 SetOncePointer<HConstant> constant_invalid_context_;
487 SetOncePointer<HArgumentsObject> arguments_object_; 485 SetOncePointer<HArgumentsObject> arguments_object_;
488 486
(...skipping 1978 matching lines...) Expand 10 before | Expand all | Expand 10 after
2467 } 2465 }
2468 2466
2469 private: 2467 private:
2470 HGraphBuilder* builder_; 2468 HGraphBuilder* builder_;
2471 }; 2469 };
2472 2470
2473 2471
2474 } } // namespace v8::internal 2472 } } // namespace v8::internal
2475 2473
2476 #endif // V8_HYDROGEN_H_ 2474 #endif // V8_HYDROGEN_H_
OLDNEW
« no previous file with comments | « src/code-stubs-hydrogen.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698