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

Side by Side Diff: src/hydrogen.h

Issue 11414201: Make HJSArrayLength more likely to have identical GVNs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years 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 | src/hydrogen.cc » ('j') | src/hydrogen.cc » ('J')
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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 return is_recursive_; 363 return is_recursive_;
364 } 364 }
365 365
366 void RecordUint32Instruction(HInstruction* instr) { 366 void RecordUint32Instruction(HInstruction* instr) {
367 if (uint32_instructions_ == NULL) { 367 if (uint32_instructions_ == NULL) {
368 uint32_instructions_ = new(zone()) ZoneList<HInstruction*>(4, zone()); 368 uint32_instructions_ = new(zone()) ZoneList<HInstruction*>(4, zone());
369 } 369 }
370 uint32_instructions_->Add(instr, zone()); 370 uint32_instructions_->Add(instr, zone());
371 } 371 }
372 372
373 // We record all HJSArrayLength instructions to process them later.
374 void RecordJSArrayLength(HJSArrayLength* inst) {
375 array_lengths_.Add(inst, zone());
376 }
377 // To make it likely that GVN will match two HJSArrayLength instructions
378 // we need to make sure that they depend on the same map check and that
379 // they have the same type (hopefully Smi and not Tagged).
380 // In this method we group all HJSArrayLength insts by the array they
381 // operate on and try to make the checks uniform in each group.
382 void ProcessJSArrayLengths();
383
373 private: 384 private:
374 HConstant* GetConstant(SetOncePointer<HConstant>* pointer, 385 HConstant* GetConstant(SetOncePointer<HConstant>* pointer,
375 Handle<Object> value); 386 Handle<Object> value);
376 HConstant* GetConstantInt32(SetOncePointer<HConstant>* pointer, 387 HConstant* GetConstantInt32(SetOncePointer<HConstant>* pointer,
377 int32_t integer_value); 388 int32_t integer_value);
378 389
379 void MarkAsDeoptimizingRecursively(HBasicBlock* block); 390 void MarkAsDeoptimizingRecursively(HBasicBlock* block);
380 void InsertTypeConversions(HInstruction* instr); 391 void InsertTypeConversions(HInstruction* instr);
381 void PropagateMinusZeroChecks(HValue* value, BitVector* visited); 392 void PropagateMinusZeroChecks(HValue* value, BitVector* visited);
382 void RecursivelyMarkPhiDeoptimizeOnUndefined(HPhi* phi); 393 void RecursivelyMarkPhiDeoptimizeOnUndefined(HPhi* phi);
383 void InsertRepresentationChangeForUse(HValue* value, 394 void InsertRepresentationChangeForUse(HValue* value,
384 HValue* use_value, 395 HValue* use_value,
385 int use_index, 396 int use_index,
386 Representation to); 397 Representation to);
387 void InsertRepresentationChangesForValue(HValue* value); 398 void InsertRepresentationChangesForValue(HValue* value);
388 void InferTypes(ZoneList<HValue*>* worklist); 399 void InferTypes(ZoneList<HValue*>* worklist);
389 void InitializeInferredTypes(int from_inclusive, int to_inclusive); 400 void InitializeInferredTypes(int from_inclusive, int to_inclusive);
390 void CheckForBackEdge(HBasicBlock* block, HBasicBlock* successor); 401 void CheckForBackEdge(HBasicBlock* block, HBasicBlock* successor);
391 void EliminateRedundantBoundsChecks(HBasicBlock* bb, BoundsCheckTable* table); 402 void EliminateRedundantBoundsChecks(HBasicBlock* bb, BoundsCheckTable* table);
392 403
393 Isolate* isolate_; 404 Isolate* isolate_;
394 int next_block_id_; 405 int next_block_id_;
395 HBasicBlock* entry_block_; 406 HBasicBlock* entry_block_;
396 HEnvironment* start_environment_; 407 HEnvironment* start_environment_;
397 ZoneList<HBasicBlock*> blocks_; 408 ZoneList<HBasicBlock*> blocks_;
398 ZoneList<HValue*> values_; 409 ZoneList<HValue*> values_;
399 ZoneList<HPhi*>* phi_list_; 410 ZoneList<HPhi*>* phi_list_;
411 ZoneList<HJSArrayLength*> array_lengths_;
400 ZoneList<HInstruction*>* uint32_instructions_; 412 ZoneList<HInstruction*>* uint32_instructions_;
401 SetOncePointer<HConstant> undefined_constant_; 413 SetOncePointer<HConstant> undefined_constant_;
402 SetOncePointer<HConstant> constant_1_; 414 SetOncePointer<HConstant> constant_1_;
403 SetOncePointer<HConstant> constant_minus1_; 415 SetOncePointer<HConstant> constant_minus1_;
404 SetOncePointer<HConstant> constant_true_; 416 SetOncePointer<HConstant> constant_true_;
405 SetOncePointer<HConstant> constant_false_; 417 SetOncePointer<HConstant> constant_false_;
406 SetOncePointer<HConstant> constant_hole_; 418 SetOncePointer<HConstant> constant_hole_;
407 SetOncePointer<HArgumentsObject> arguments_object_; 419 SetOncePointer<HArgumentsObject> arguments_object_;
408 420
409 SetOncePointer<HBasicBlock> osr_loop_entry_; 421 SetOncePointer<HBasicBlock> osr_loop_entry_;
(...skipping 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after
1527 const char* filename_; 1539 const char* filename_;
1528 HeapStringAllocator string_allocator_; 1540 HeapStringAllocator string_allocator_;
1529 StringStream trace_; 1541 StringStream trace_;
1530 int indent_; 1542 int indent_;
1531 }; 1543 };
1532 1544
1533 1545
1534 } } // namespace v8::internal 1546 } } // namespace v8::internal
1535 1547
1536 #endif // V8_HYDROGEN_H_ 1548 #endif // V8_HYDROGEN_H_
OLDNEW
« no previous file with comments | « no previous file | src/hydrogen.cc » ('j') | src/hydrogen.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698