OLD | NEW |
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 2409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2420 } | 2420 } |
2421 if (name->Equals(String::cast(key))) { | 2421 if (name->Equals(String::cast(key))) { |
2422 Code* code = Code::cast(cache->get(i + 1)); | 2422 Code* code = Code::cast(cache->get(i + 1)); |
2423 if (code->flags() == flags) return code; | 2423 if (code->flags() == flags) return code; |
2424 } | 2424 } |
2425 } | 2425 } |
2426 return Heap::undefined_value(); | 2426 return Heap::undefined_value(); |
2427 } | 2427 } |
2428 | 2428 |
2429 | 2429 |
2430 bool Map::IncludedInCodeCache(Code* code) { | 2430 int Map::IndexInCodeCache(Code* code) { |
2431 FixedArray* array = code_cache(); | 2431 FixedArray* array = code_cache(); |
2432 int len = array->length(); | 2432 int len = array->length(); |
2433 for (int i = 0; i < len; i += 2) { | 2433 for (int i = 0; i < len; i += 2) { |
2434 if (array->get(i+1) == code) return true; | 2434 if (array->get(i + 1) == code) return i + 1; |
2435 } | 2435 } |
2436 return false; | 2436 return -1; |
| 2437 } |
| 2438 |
| 2439 |
| 2440 void Map::RemoveFromCodeCache(int index) { |
| 2441 FixedArray* array = code_cache(); |
| 2442 ASSERT(array->length() >= index && array->get(index)->IsCode()); |
| 2443 array->set_undefined(index - 1); // key |
| 2444 array->set_undefined(index); // code |
2437 } | 2445 } |
2438 | 2446 |
2439 | 2447 |
2440 void FixedArray::FixedArrayIterateBody(ObjectVisitor* v) { | 2448 void FixedArray::FixedArrayIterateBody(ObjectVisitor* v) { |
2441 IteratePointers(v, kHeaderSize, kHeaderSize + length() * kPointerSize); | 2449 IteratePointers(v, kHeaderSize, kHeaderSize + length() * kPointerSize); |
2442 } | 2450 } |
2443 | 2451 |
2444 | 2452 |
2445 static bool HasKey(FixedArray* array, Object* key) { | 2453 static bool HasKey(FixedArray* array, Object* key) { |
2446 int len0 = array->length(); | 2454 int len0 = array->length(); |
(...skipping 3808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6255 // No break point. | 6263 // No break point. |
6256 if (break_point_objects()->IsUndefined()) return 0; | 6264 if (break_point_objects()->IsUndefined()) return 0; |
6257 // Single beak point. | 6265 // Single beak point. |
6258 if (!break_point_objects()->IsFixedArray()) return 1; | 6266 if (!break_point_objects()->IsFixedArray()) return 1; |
6259 // Multiple break points. | 6267 // Multiple break points. |
6260 return FixedArray::cast(break_point_objects())->length(); | 6268 return FixedArray::cast(break_point_objects())->length(); |
6261 } | 6269 } |
6262 | 6270 |
6263 | 6271 |
6264 } } // namespace v8::internal | 6272 } } // namespace v8::internal |
OLD | NEW |