| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 3746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3757 *map_or_index_field = heap()->fixed_array_map(); | 3757 *map_or_index_field = heap()->fixed_array_map(); |
| 3758 Map* prev = current->map(); | 3758 Map* prev = current->map(); |
| 3759 current->set_map(meta_map); | 3759 current->set_map(meta_map); |
| 3760 callback(current, data); | 3760 callback(current, data); |
| 3761 current = prev; | 3761 current = prev; |
| 3762 } | 3762 } |
| 3763 } | 3763 } |
| 3764 | 3764 |
| 3765 | 3765 |
| 3766 MaybeObject* CodeCache::Update(String* name, Code* code) { | 3766 MaybeObject* CodeCache::Update(String* name, Code* code) { |
| 3767 ASSERT(code->ic_state() == MONOMORPHIC); | |
| 3768 | |
| 3769 // The number of monomorphic stubs for normal load/store/call IC's can grow to | 3767 // The number of monomorphic stubs for normal load/store/call IC's can grow to |
| 3770 // a large number and therefore they need to go into a hash table. They are | 3768 // a large number and therefore they need to go into a hash table. They are |
| 3771 // used to load global properties from cells. | 3769 // used to load global properties from cells. |
| 3772 if (code->type() == NORMAL) { | 3770 if (code->type() == NORMAL) { |
| 3773 // Make sure that a hash table is allocated for the normal load code cache. | 3771 // Make sure that a hash table is allocated for the normal load code cache. |
| 3774 if (normal_type_cache()->IsUndefined()) { | 3772 if (normal_type_cache()->IsUndefined()) { |
| 3775 Object* result; | 3773 Object* result; |
| 3776 { MaybeObject* maybe_result = | 3774 { MaybeObject* maybe_result = |
| 3777 CodeCacheHashTable::Allocate(CodeCacheHashTable::kInitialSize); | 3775 CodeCacheHashTable::Allocate(CodeCacheHashTable::kInitialSize); |
| 3778 if (!maybe_result->ToObject(&result)) return maybe_result; | 3776 if (!maybe_result->ToObject(&result)) return maybe_result; |
| (...skipping 2562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6341 int mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); | 6339 int mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); |
| 6342 for (RelocIterator it(this, mask); !it.done(); it.next()) { | 6340 for (RelocIterator it(this, mask); !it.done(); it.next()) { |
| 6343 RelocInfo* info = it.rinfo(); | 6341 RelocInfo* info = it.rinfo(); |
| 6344 Object* object = info->target_object(); | 6342 Object* object = info->target_object(); |
| 6345 if (object->IsMap()) return Map::cast(object); | 6343 if (object->IsMap()) return Map::cast(object); |
| 6346 } | 6344 } |
| 6347 return NULL; | 6345 return NULL; |
| 6348 } | 6346 } |
| 6349 | 6347 |
| 6350 | 6348 |
| 6349 int Code::GetMapCount() { |
| 6350 ASSERT(is_inline_cache_stub()); |
| 6351 AssertNoAllocation no_allocation; |
| 6352 int mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); |
| 6353 int count = 0; |
| 6354 for (RelocIterator it(this, mask); !it.done(); it.next()) { |
| 6355 RelocInfo* info = it.rinfo(); |
| 6356 Object* object = info->target_object(); |
| 6357 if (object->IsMap()) ++count; |
| 6358 } |
| 6359 return count; |
| 6360 } |
| 6361 |
| 6362 |
| 6351 #ifdef ENABLE_DISASSEMBLER | 6363 #ifdef ENABLE_DISASSEMBLER |
| 6352 | 6364 |
| 6353 #ifdef OBJECT_PRINT | 6365 #ifdef OBJECT_PRINT |
| 6354 | 6366 |
| 6355 void DeoptimizationInputData::DeoptimizationInputDataPrint(FILE* out) { | 6367 void DeoptimizationInputData::DeoptimizationInputDataPrint(FILE* out) { |
| 6356 disasm::NameConverter converter; | 6368 disasm::NameConverter converter; |
| 6357 int deopt_count = DeoptCount(); | 6369 int deopt_count = DeoptCount(); |
| 6358 PrintF(out, "Deoptimization Input Data (deopt points = %d)\n", deopt_count); | 6370 PrintF(out, "Deoptimization Input Data (deopt points = %d)\n", deopt_count); |
| 6359 if (0 == deopt_count) return; | 6371 if (0 == deopt_count) return; |
| 6360 | 6372 |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6503 | 6515 |
| 6504 // Identify kind of code. | 6516 // Identify kind of code. |
| 6505 const char* Code::Kind2String(Kind kind) { | 6517 const char* Code::Kind2String(Kind kind) { |
| 6506 switch (kind) { | 6518 switch (kind) { |
| 6507 case FUNCTION: return "FUNCTION"; | 6519 case FUNCTION: return "FUNCTION"; |
| 6508 case OPTIMIZED_FUNCTION: return "OPTIMIZED_FUNCTION"; | 6520 case OPTIMIZED_FUNCTION: return "OPTIMIZED_FUNCTION"; |
| 6509 case STUB: return "STUB"; | 6521 case STUB: return "STUB"; |
| 6510 case BUILTIN: return "BUILTIN"; | 6522 case BUILTIN: return "BUILTIN"; |
| 6511 case LOAD_IC: return "LOAD_IC"; | 6523 case LOAD_IC: return "LOAD_IC"; |
| 6512 case KEYED_LOAD_IC: return "KEYED_LOAD_IC"; | 6524 case KEYED_LOAD_IC: return "KEYED_LOAD_IC"; |
| 6513 case KEYED_EXTERNAL_ARRAY_LOAD_IC: return "KEYED_EXTERNAL_ARRAY_LOAD_IC"; | |
| 6514 case STORE_IC: return "STORE_IC"; | 6525 case STORE_IC: return "STORE_IC"; |
| 6515 case KEYED_STORE_IC: return "KEYED_STORE_IC"; | 6526 case KEYED_STORE_IC: return "KEYED_STORE_IC"; |
| 6516 case KEYED_EXTERNAL_ARRAY_STORE_IC: return "KEYED_EXTERNAL_ARRAY_STORE_IC"; | |
| 6517 case CALL_IC: return "CALL_IC"; | 6527 case CALL_IC: return "CALL_IC"; |
| 6518 case KEYED_CALL_IC: return "KEYED_CALL_IC"; | 6528 case KEYED_CALL_IC: return "KEYED_CALL_IC"; |
| 6519 case TYPE_RECORDING_BINARY_OP_IC: return "TYPE_RECORDING_BINARY_OP_IC"; | 6529 case TYPE_RECORDING_BINARY_OP_IC: return "TYPE_RECORDING_BINARY_OP_IC"; |
| 6520 case COMPARE_IC: return "COMPARE_IC"; | 6530 case COMPARE_IC: return "COMPARE_IC"; |
| 6521 } | 6531 } |
| 6522 UNREACHABLE(); | 6532 UNREACHABLE(); |
| 6523 return NULL; | 6533 return NULL; |
| 6524 } | 6534 } |
| 6525 | 6535 |
| 6526 | 6536 |
| (...skipping 3896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10423 if (break_point_objects()->IsUndefined()) return 0; | 10433 if (break_point_objects()->IsUndefined()) return 0; |
| 10424 // Single beak point. | 10434 // Single beak point. |
| 10425 if (!break_point_objects()->IsFixedArray()) return 1; | 10435 if (!break_point_objects()->IsFixedArray()) return 1; |
| 10426 // Multiple break points. | 10436 // Multiple break points. |
| 10427 return FixedArray::cast(break_point_objects())->length(); | 10437 return FixedArray::cast(break_point_objects())->length(); |
| 10428 } | 10438 } |
| 10429 #endif | 10439 #endif |
| 10430 | 10440 |
| 10431 | 10441 |
| 10432 } } // namespace v8::internal | 10442 } } // namespace v8::internal |
| OLD | NEW |