| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 | 72 |
| 73 | 73 |
| 74 static uint32_t IdToKey(TypeFeedbackId ast_id) { | 74 static uint32_t IdToKey(TypeFeedbackId ast_id) { |
| 75 return static_cast<uint32_t>(ast_id.ToInt()); | 75 return static_cast<uint32_t>(ast_id.ToInt()); |
| 76 } | 76 } |
| 77 | 77 |
| 78 | 78 |
| 79 Handle<Object> TypeFeedbackOracle::GetInfo(TypeFeedbackId ast_id) { | 79 Handle<Object> TypeFeedbackOracle::GetInfo(TypeFeedbackId ast_id) { |
| 80 int entry = dictionary_->FindEntry(IdToKey(ast_id)); | 80 int entry = dictionary_->FindEntry(IdToKey(ast_id)); |
| 81 return entry != UnseededNumberDictionary::kNotFound | 81 return entry != UnseededNumberDictionary::kNotFound |
| 82 ? Handle<Object>(dictionary_->ValueAt(entry)) | 82 ? Handle<Object>(dictionary_->ValueAt(entry), isolate_) |
| 83 : Handle<Object>::cast(isolate_->factory()->undefined_value()); | 83 : Handle<Object>::cast(isolate_->factory()->undefined_value()); |
| 84 } | 84 } |
| 85 | 85 |
| 86 | 86 |
| 87 bool TypeFeedbackOracle::LoadIsUninitialized(Property* expr) { | 87 bool TypeFeedbackOracle::LoadIsUninitialized(Property* expr) { |
| 88 Handle<Object> map_or_code = GetInfo(expr->PropertyFeedbackId()); | 88 Handle<Object> map_or_code = GetInfo(expr->PropertyFeedbackId()); |
| 89 if (map_or_code->IsMap()) return false; | 89 if (map_or_code->IsMap()) return false; |
| 90 if (map_or_code->IsCode()) { | 90 if (map_or_code->IsCode()) { |
| 91 Handle<Code> code = Handle<Code>::cast(map_or_code); | 91 Handle<Code> code = Handle<Code>::cast(map_or_code); |
| 92 return code->is_inline_cache_stub() && code->ic_state() == UNINITIALIZED; | 92 return code->is_inline_cache_stub() && code->ic_state() == UNINITIALIZED; |
| (...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 711 USE(maybe_result); | 711 USE(maybe_result); |
| 712 #ifdef DEBUG | 712 #ifdef DEBUG |
| 713 Object* result = NULL; | 713 Object* result = NULL; |
| 714 // Dictionary has been allocated with sufficient size for all elements. | 714 // Dictionary has been allocated with sufficient size for all elements. |
| 715 ASSERT(maybe_result->ToObject(&result)); | 715 ASSERT(maybe_result->ToObject(&result)); |
| 716 ASSERT(*dictionary_ == result); | 716 ASSERT(*dictionary_ == result); |
| 717 #endif | 717 #endif |
| 718 } | 718 } |
| 719 | 719 |
| 720 } } // namespace v8::internal | 720 } } // namespace v8::internal |
| OLD | NEW |