| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 10619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10630 } | 10630 } |
| 10631 } | 10631 } |
| 10632 | 10632 |
| 10633 | 10633 |
| 10634 void Code::ClearTypeFeedbackInfo(Heap* heap) { | 10634 void Code::ClearTypeFeedbackInfo(Heap* heap) { |
| 10635 if (kind() != FUNCTION) return; | 10635 if (kind() != FUNCTION) return; |
| 10636 Object* raw_info = type_feedback_info(); | 10636 Object* raw_info = type_feedback_info(); |
| 10637 if (raw_info->IsTypeFeedbackInfo()) { | 10637 if (raw_info->IsTypeFeedbackInfo()) { |
| 10638 FixedArray* feedback_vector = | 10638 FixedArray* feedback_vector = |
| 10639 TypeFeedbackInfo::cast(raw_info)->feedback_vector(); | 10639 TypeFeedbackInfo::cast(raw_info)->feedback_vector(); |
| 10640 Object* premonomorphic_sentinel = |
| 10641 TypeFeedbackInfo::RawPremonomorphicSentinel(heap); |
| 10640 for (int i = 0; i < feedback_vector->length(); i++) { | 10642 for (int i = 0; i < feedback_vector->length(); i++) { |
| 10641 Object* obj = feedback_vector->get(i); | 10643 Object* obj = feedback_vector->get(i); |
| 10642 if (!obj->IsAllocationSite()) { | 10644 // If the cache is monomorphic (non-arrays) or megamorphic we go |
| 10643 // TODO(mvstanton): Can't I avoid a write barrier for this sentinel? | 10645 // back to premonomorphic. |
| 10644 feedback_vector->set(i, | 10646 ASSERT_EQ(*TypeFeedbackInfo::MegamorphicSentinel(heap->isolate()), |
| 10645 TypeFeedbackInfo::RawUninitializedSentinel(heap)); | 10647 heap->undefined_value()); |
| 10648 if (obj->IsUndefined() || obj->IsJSFunction()) { |
| 10649 feedback_vector->set(i, premonomorphic_sentinel, SKIP_WRITE_BARRIER); |
| 10646 } | 10650 } |
| 10647 } | 10651 } |
| 10648 } | 10652 } |
| 10649 } | 10653 } |
| 10650 | 10654 |
| 10651 | 10655 |
| 10652 BailoutId Code::TranslatePcOffsetToAstId(uint32_t pc_offset) { | 10656 BailoutId Code::TranslatePcOffsetToAstId(uint32_t pc_offset) { |
| 10653 DisallowHeapAllocation no_gc; | 10657 DisallowHeapAllocation no_gc; |
| 10654 ASSERT(kind() == FUNCTION); | 10658 ASSERT(kind() == FUNCTION); |
| 10655 BackEdgeTable back_edges(this, &no_gc); | 10659 BackEdgeTable back_edges(this, &no_gc); |
| (...skipping 5840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16496 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16500 #define ERROR_MESSAGES_TEXTS(C, T) T, |
| 16497 static const char* error_messages_[] = { | 16501 static const char* error_messages_[] = { |
| 16498 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16502 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
| 16499 }; | 16503 }; |
| 16500 #undef ERROR_MESSAGES_TEXTS | 16504 #undef ERROR_MESSAGES_TEXTS |
| 16501 return error_messages_[reason]; | 16505 return error_messages_[reason]; |
| 16502 } | 16506 } |
| 16503 | 16507 |
| 16504 | 16508 |
| 16505 } } // namespace v8::internal | 16509 } } // namespace v8::internal |
| OLD | NEW |