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

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: Rename "dependent codes" and add comment. 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
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 2549 matching lines...) Expand 10 before | Expand all | Expand 10 after
2560 // Dereferencing to use the object's raw address for hashing is safe. 2560 // Dereferencing to use the object's raw address for hashing is safe.
2561 AllowHandleDereference allow_handle_deref; 2561 AllowHandleDereference allow_handle_deref;
2562 intptr_t hash = 0; 2562 intptr_t hash = 0;
2563 for (int i = 0; i < prototypes_.length(); i++) { 2563 for (int i = 0; i < prototypes_.length(); i++) {
2564 hash = 17 * hash + reinterpret_cast<intptr_t>(*prototypes_[i]); 2564 hash = 17 * hash + reinterpret_cast<intptr_t>(*prototypes_[i]);
2565 hash = 17 * hash + reinterpret_cast<intptr_t>(*maps_[i]); 2565 hash = 17 * hash + reinterpret_cast<intptr_t>(*maps_[i]);
2566 } 2566 }
2567 return hash; 2567 return hash;
2568 } 2568 }
2569 2569
2570 bool CanOmitPrototypeChecks() {
2571 for (int i = 0; i < maps()->length(); i++) {
2572 if (!maps()->at(i)->CanOmitPrototypeChecks()) return false;
2573 }
2574 return true;
2575 }
2576
2570 protected: 2577 protected:
2571 virtual bool DataEquals(HValue* other) { 2578 virtual bool DataEquals(HValue* other) {
2572 HCheckPrototypeMaps* b = HCheckPrototypeMaps::cast(other); 2579 HCheckPrototypeMaps* b = HCheckPrototypeMaps::cast(other);
2573 #ifdef DEBUG 2580 #ifdef DEBUG
2574 if (prototypes_.length() != b->prototypes()->length()) return false; 2581 if (prototypes_.length() != b->prototypes()->length()) return false;
2575 for (int i = 0; i < prototypes_.length(); i++) { 2582 for (int i = 0; i < prototypes_.length(); i++) {
2576 if (!prototypes_[i].is_identical_to(b->prototypes()->at(i))) return false; 2583 if (!prototypes_[i].is_identical_to(b->prototypes()->at(i))) return false;
2577 if (!maps_[i].is_identical_to(b->maps()->at(i))) return false; 2584 if (!maps_[i].is_identical_to(b->maps()->at(i))) return false;
2578 } 2585 }
2579 return true; 2586 return true;
(...skipping 3163 matching lines...) Expand 10 before | Expand all | Expand 10 after
5743 virtual bool IsDeletable() const { return true; } 5750 virtual bool IsDeletable() const { return true; }
5744 }; 5751 };
5745 5752
5746 5753
5747 #undef DECLARE_INSTRUCTION 5754 #undef DECLARE_INSTRUCTION
5748 #undef DECLARE_CONCRETE_INSTRUCTION 5755 #undef DECLARE_CONCRETE_INSTRUCTION
5749 5756
5750 } } // namespace v8::internal 5757 } } // namespace v8::internal
5751 5758
5752 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 5759 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698