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

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

Issue 12225099: Remove prototype checks for leaf maps in optimized code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add space after if Created 7 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/heap.cc ('k') | src/ia32/lithium-codegen-ia32.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 2749 matching lines...) Expand 10 before | Expand all | Expand 10 after
2760 // Dereferencing to use the object's raw address for hashing is safe. 2760 // Dereferencing to use the object's raw address for hashing is safe.
2761 AllowHandleDereference allow_handle_deref; 2761 AllowHandleDereference allow_handle_deref;
2762 intptr_t hash = 0; 2762 intptr_t hash = 0;
2763 for (int i = 0; i < prototypes_.length(); i++) { 2763 for (int i = 0; i < prototypes_.length(); i++) {
2764 hash = 17 * hash + reinterpret_cast<intptr_t>(*prototypes_[i]); 2764 hash = 17 * hash + reinterpret_cast<intptr_t>(*prototypes_[i]);
2765 hash = 17 * hash + reinterpret_cast<intptr_t>(*maps_[i]); 2765 hash = 17 * hash + reinterpret_cast<intptr_t>(*maps_[i]);
2766 } 2766 }
2767 return hash; 2767 return hash;
2768 } 2768 }
2769 2769
2770 bool CanOmitPrototypeChecks() {
2771 for (int i = 0; i < maps()->length(); i++) {
2772 if (!maps()->at(i)->CanOmitPrototypeChecks()) return false;
2773 }
2774 return true;
2775 }
2776
2770 protected: 2777 protected:
2771 virtual bool DataEquals(HValue* other) { 2778 virtual bool DataEquals(HValue* other) {
2772 HCheckPrototypeMaps* b = HCheckPrototypeMaps::cast(other); 2779 HCheckPrototypeMaps* b = HCheckPrototypeMaps::cast(other);
2773 #ifdef DEBUG 2780 #ifdef DEBUG
2774 if (prototypes_.length() != b->prototypes()->length()) return false; 2781 if (prototypes_.length() != b->prototypes()->length()) return false;
2775 for (int i = 0; i < prototypes_.length(); i++) { 2782 for (int i = 0; i < prototypes_.length(); i++) {
2776 if (!prototypes_[i].is_identical_to(b->prototypes()->at(i))) return false; 2783 if (!prototypes_[i].is_identical_to(b->prototypes()->at(i))) return false;
2777 if (!maps_[i].is_identical_to(b->maps()->at(i))) return false; 2784 if (!maps_[i].is_identical_to(b->maps()->at(i))) return false;
2778 } 2785 }
2779 return true; 2786 return true;
(...skipping 3245 matching lines...) Expand 10 before | Expand all | Expand 10 after
6025 virtual bool IsDeletable() const { return true; } 6032 virtual bool IsDeletable() const { return true; }
6026 }; 6033 };
6027 6034
6028 6035
6029 #undef DECLARE_INSTRUCTION 6036 #undef DECLARE_INSTRUCTION
6030 #undef DECLARE_CONCRETE_INSTRUCTION 6037 #undef DECLARE_CONCRETE_INSTRUCTION
6031 6038
6032 } } // namespace v8::internal 6039 } } // namespace v8::internal
6033 6040
6034 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 6041 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | src/ia32/lithium-codegen-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698