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

Unified Diff: src/objects.cc

Issue 2959: Revert revision 331. The propagation of monomorphic prototype failure... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 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/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
===================================================================
--- src/objects.cc (revision 331)
+++ src/objects.cc (working copy)
@@ -2410,27 +2410,41 @@
}
-Object* Map::FindIndexInCodeCache(String* name, Code::Flags flags, int* index) {
+Object* Map::FindInCodeCache(String* name, Code::Flags flags) {
FixedArray* cache = code_cache();
int length = cache->length();
for (int i = 0; i < length; i += 2) {
Object* key = cache->get(i);
if (key->IsUndefined()) {
- continue;
+ return key;
}
if (name->Equals(String::cast(key))) {
Code* code = Code::cast(cache->get(i + 1));
- if (code->flags() == flags) {
- *index = i + 1;
- return code;
- }
+ if (code->flags() == flags) return code;
}
}
- *index = -1;
return Heap::undefined_value();
}
+int Map::IndexInCodeCache(Code* code) {
+ FixedArray* array = code_cache();
+ int len = array->length();
+ for (int i = 0; i < len; i += 2) {
+ if (array->get(i + 1) == code) return i + 1;
+ }
+ return -1;
+}
+
+
+void Map::RemoveFromCodeCache(int index) {
+ FixedArray* array = code_cache();
+ ASSERT(array->length() >= index && array->get(index)->IsCode());
+ array->set_undefined(index - 1); // key
+ array->set_undefined(index); // code
+}
+
+
void FixedArray::FixedArrayIterateBody(ObjectVisitor* v) {
IteratePointers(v, kHeaderSize, kHeaderSize + length() * kPointerSize);
}
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698