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

Unified Diff: src/field-index-inl.h

Issue 534243002: Add %LoadMutableDouble index check. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/field-index.h ('k') | src/runtime.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/field-index-inl.h
diff --git a/src/field-index-inl.h b/src/field-index-inl.h
index 198422feef4b65f21c7f5c14cc867cc306fb1ff9..80e486945b48eecb7944b3be34b04256a167112b 100644
--- a/src/field-index-inl.h
+++ b/src/field-index-inl.h
@@ -69,6 +69,18 @@ inline FieldIndex FieldIndex::ForLoadByFieldIndex(Map* map, int orig_index) {
}
+inline bool FieldIndex::LoadByFieldIndexValid(int index) {
+ index >>= 1;
+ if (index < 0) {
+ index = -(index + 1);
+ index += FixedArray::kHeaderSize / kPointerSize;
+ } else {
+ index += JSObject::kHeaderSize / kPointerSize;
+ }
+ return IndexBits::is_valid(index);
+}
+
+
// Returns the index format accepted by the HLoadFieldByIndex instruction.
// (In-object: zero-based from (object start + JSObject::kHeaderSize),
// out-of-object: zero-based from FixedArray::kHeaderSize.)
« no previous file with comments | « src/field-index.h ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698