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

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

Issue 15014020: Elide hole checks on KeyedLoads of holey double arrays. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Implement missing platforms and add tests Created 7 years, 7 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
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 2663 matching lines...) Expand 10 before | Expand all | Expand 10 after
2674 2674
2675 bool HLoadKeyed::UsesMustHandleHole() const { 2675 bool HLoadKeyed::UsesMustHandleHole() const {
2676 if (IsFastPackedElementsKind(elements_kind())) { 2676 if (IsFastPackedElementsKind(elements_kind())) {
2677 return false; 2677 return false;
2678 } 2678 }
2679 2679
2680 if (IsExternalArrayElementsKind(elements_kind())) { 2680 if (IsExternalArrayElementsKind(elements_kind())) {
2681 return false; 2681 return false;
2682 } 2682 }
2683 2683
2684 if (hole_mode() == ALLOW_RETURN_HOLE) return true; 2684 if (hole_mode() == ALLOW_RETURN_HOLE) {
2685 if (IsFastDoubleElementsKind(elements_kind())) {
2686 return AllUsesCanTreatHoleAsNaN();
2687 }
2688 return true;
2689 }
2685 2690
2686 if (IsFastDoubleElementsKind(elements_kind())) { 2691 if (IsFastDoubleElementsKind(elements_kind())) {
2687 return false; 2692 return false;
2688 } 2693 }
2689 2694
2690 for (HUseIterator it(uses()); !it.Done(); it.Advance()) { 2695 for (HUseIterator it(uses()); !it.Done(); it.Advance()) {
2691 HValue* use = it.value(); 2696 HValue* use = it.value();
2692 if (!use->IsChange()) { 2697 if (!use->IsChange()) {
2693 return false; 2698 return false;
2694 } 2699 }
2695 } 2700 }
2696 2701
2697 return true; 2702 return true;
2698 } 2703 }
2699 2704
2700 2705
2706 bool HLoadKeyed::AllUsesCanTreatHoleAsNaN() const {
2707 if (!IsFastDoubleElementsKind(elements_kind())) {
2708 return false;
2709 }
2710
2711 for (HUseIterator it(uses()); !it.Done(); it.Advance()) {
2712 HValue* use = it.value();
2713 if (use->CheckFlag(HValue::kDeoptimizeOnUndefined)) {
2714 return false;
2715 }
2716 }
2717
2718 return true;
2719 }
2720
2721
2701 bool HLoadKeyed::RequiresHoleCheck() const { 2722 bool HLoadKeyed::RequiresHoleCheck() const {
2702 if (IsFastPackedElementsKind(elements_kind())) { 2723 if (IsFastPackedElementsKind(elements_kind())) {
2703 return false; 2724 return false;
2704 } 2725 }
2705 2726
2706 if (IsExternalArrayElementsKind(elements_kind())) { 2727 if (IsExternalArrayElementsKind(elements_kind())) {
2707 return false; 2728 return false;
2708 } 2729 }
2709 2730
2710 return !UsesMustHandleHole(); 2731 return !UsesMustHandleHole();
(...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after
3630 3651
3631 3652
3632 void HCheckFunction::Verify() { 3653 void HCheckFunction::Verify() {
3633 HInstruction::Verify(); 3654 HInstruction::Verify();
3634 ASSERT(HasNoUses()); 3655 ASSERT(HasNoUses());
3635 } 3656 }
3636 3657
3637 #endif 3658 #endif
3638 3659
3639 } } // namespace v8::internal 3660 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | src/isolate.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698