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

Side by Side Diff: src/objects-inl.h

Issue 4200009: Clear JS function result caches in all global contexts. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 10 years, 1 month 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') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 1934 matching lines...) Expand 10 before | Expand all | Expand 10 after
1945 1945
1946 void JSFunctionResultCache::MakeZeroSize() { 1946 void JSFunctionResultCache::MakeZeroSize() {
1947 set(kFingerIndex, Smi::FromInt(kEntriesIndex)); 1947 set(kFingerIndex, Smi::FromInt(kEntriesIndex));
1948 set(kCacheSizeIndex, Smi::FromInt(kEntriesIndex)); 1948 set(kCacheSizeIndex, Smi::FromInt(kEntriesIndex));
1949 } 1949 }
1950 1950
1951 1951
1952 void JSFunctionResultCache::Clear() { 1952 void JSFunctionResultCache::Clear() {
1953 int cache_size = Smi::cast(get(kCacheSizeIndex))->value(); 1953 int cache_size = Smi::cast(get(kCacheSizeIndex))->value();
1954 Object** entries_start = RawField(this, OffsetOfElementAt(kEntriesIndex)); 1954 Object** entries_start = RawField(this, OffsetOfElementAt(kEntriesIndex));
1955 MemsetPointer(entries_start, Heap::the_hole_value(), cache_size); 1955 MemsetPointer(entries_start,
1956 Heap::the_hole_value(),
1957 cache_size - kEntriesIndex);
1956 MakeZeroSize(); 1958 MakeZeroSize();
1957 } 1959 }
1958 1960
1959 1961
1960 byte ByteArray::get(int index) { 1962 byte ByteArray::get(int index) {
1961 ASSERT(index >= 0 && index < this->length()); 1963 ASSERT(index >= 0 && index < this->length());
1962 return READ_BYTE_FIELD(this, kHeaderSize + index * kCharSize); 1964 return READ_BYTE_FIELD(this, kHeaderSize + index * kCharSize);
1963 } 1965 }
1964 1966
1965 1967
(...skipping 1611 matching lines...) Expand 10 before | Expand all | Expand 10 after
3577 #undef WRITE_INT_FIELD 3579 #undef WRITE_INT_FIELD
3578 #undef READ_SHORT_FIELD 3580 #undef READ_SHORT_FIELD
3579 #undef WRITE_SHORT_FIELD 3581 #undef WRITE_SHORT_FIELD
3580 #undef READ_BYTE_FIELD 3582 #undef READ_BYTE_FIELD
3581 #undef WRITE_BYTE_FIELD 3583 #undef WRITE_BYTE_FIELD
3582 3584
3583 3585
3584 } } // namespace v8::internal 3586 } } // namespace v8::internal
3585 3587
3586 #endif // V8_OBJECTS_INL_H_ 3588 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698