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

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

Issue 146623003: Improve HConstant::ImmortalImmovable() to check for all immortal immovable roots. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 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/hydrogen-instructions.h ('k') | src/objects.h » ('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 2593 matching lines...) Expand 10 before | Expand all | Expand 10 after
2604 } 2604 }
2605 } 2605 }
2606 r = Representation::Tagged(); 2606 r = Representation::Tagged();
2607 } 2607 }
2608 } 2608 }
2609 set_representation(r); 2609 set_representation(r);
2610 SetFlag(kUseGVN); 2610 SetFlag(kUseGVN);
2611 } 2611 }
2612 2612
2613 2613
2614 bool HConstant::ImmortalImmovable() const {
2615 if (has_int32_value_) {
2616 return false;
2617 }
2618 if (has_double_value_) {
2619 if (IsSpecialDouble()) {
2620 return true;
2621 }
2622 return false;
2623 }
2624 if (has_external_reference_value_) {
2625 return false;
2626 }
2627
2628 ASSERT(!object_.handle().is_null());
2629 Heap* heap = isolate()->heap();
2630 ASSERT(!object_.IsKnownGlobal(heap->minus_zero_value()));
2631 ASSERT(!object_.IsKnownGlobal(heap->nan_value()));
2632 return
2633 #define IMMORTAL_IMMOVABLE_ROOT(name) \
2634 object_.IsKnownGlobal(heap->name()) ||
2635 IMMORTAL_IMMOVABLE_ROOT_LIST(IMMORTAL_IMMOVABLE_ROOT)
2636 #undef IMMORTAL_IMMOVABLE_ROOT
2637 #define INTERNALIZED_STRING(name, value) \
2638 object_.IsKnownGlobal(heap->name()) ||
2639 INTERNALIZED_STRING_LIST(INTERNALIZED_STRING)
2640 #undef INTERNALIZED_STRING
2641 #define STRING_TYPE(NAME, size, name, Name) \
2642 object_.IsKnownGlobal(heap->name##_map()) ||
2643 STRING_TYPE_LIST(STRING_TYPE)
2644 #undef STRING_TYPE
2645 false;
2646 }
2647
2648
2614 bool HConstant::EmitAtUses() { 2649 bool HConstant::EmitAtUses() {
2615 ASSERT(IsLinked()); 2650 ASSERT(IsLinked());
2616 if (block()->graph()->has_osr() && 2651 if (block()->graph()->has_osr() &&
2617 block()->graph()->IsStandardConstant(this)) { 2652 block()->graph()->IsStandardConstant(this)) {
2618 // TODO(titzer): this seems like a hack that should be fixed by custom OSR. 2653 // TODO(titzer): this seems like a hack that should be fixed by custom OSR.
2619 return true; 2654 return true;
2620 } 2655 }
2621 if (UseCount() == 0) return true; 2656 if (UseCount() == 0) return true;
2622 if (IsCell()) return false; 2657 if (IsCell()) return false;
2623 if (representation().IsDouble()) return false; 2658 if (representation().IsDouble()) return false;
(...skipping 1792 matching lines...) Expand 10 before | Expand all | Expand 10 after
4416 break; 4451 break;
4417 case kExternalMemory: 4452 case kExternalMemory:
4418 stream->Add("[external-memory]"); 4453 stream->Add("[external-memory]");
4419 break; 4454 break;
4420 } 4455 }
4421 4456
4422 stream->Add("@%d", offset()); 4457 stream->Add("@%d", offset());
4423 } 4458 }
4424 4459
4425 } } // namespace v8::internal 4460 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698