| OLD | NEW |
| 1 // Copyright 2011 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 |
| 11 // with the distribution. | 11 // with the distribution. |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 } | 103 } |
| 104 return false; | 104 return false; |
| 105 } | 105 } |
| 106 | 106 |
| 107 | 107 |
| 108 bool TypeFeedbackOracle::StoreIsMonomorphicNormal(Expression* expr) { | 108 bool TypeFeedbackOracle::StoreIsMonomorphicNormal(Expression* expr) { |
| 109 Handle<Object> map_or_code = GetInfo(expr->id()); | 109 Handle<Object> map_or_code = GetInfo(expr->id()); |
| 110 if (map_or_code->IsMap()) return true; | 110 if (map_or_code->IsMap()) return true; |
| 111 if (map_or_code->IsCode()) { | 111 if (map_or_code->IsCode()) { |
| 112 Handle<Code> code = Handle<Code>::cast(map_or_code); | 112 Handle<Code> code = Handle<Code>::cast(map_or_code); |
| 113 bool allow_growth = |
| 114 Code::GetKeyedAccessGrowMode(code->extra_ic_state()) == |
| 115 ALLOW_JSARRAY_GROWTH; |
| 113 return code->is_keyed_store_stub() && | 116 return code->is_keyed_store_stub() && |
| 117 !allow_growth && |
| 114 code->ic_state() == MONOMORPHIC && | 118 code->ic_state() == MONOMORPHIC && |
| 115 Code::ExtractTypeFromFlags(code->flags()) == NORMAL && | 119 Code::ExtractTypeFromFlags(code->flags()) == NORMAL && |
| 116 code->FindFirstMap() != NULL && | 120 code->FindFirstMap() != NULL && |
| 117 !CanRetainOtherContext(code->FindFirstMap(), *global_context_); | 121 !CanRetainOtherContext(code->FindFirstMap(), *global_context_); |
| 118 } | 122 } |
| 119 return false; | 123 return false; |
| 120 } | 124 } |
| 121 | 125 |
| 122 | 126 |
| 123 bool TypeFeedbackOracle::StoreIsMegamorphicWithTypeInfo(Expression* expr) { | 127 bool TypeFeedbackOracle::StoreIsMegamorphicWithTypeInfo(Expression* expr) { |
| 124 Handle<Object> map_or_code = GetInfo(expr->id()); | 128 Handle<Object> map_or_code = GetInfo(expr->id()); |
| 125 if (map_or_code->IsCode()) { | 129 if (map_or_code->IsCode()) { |
| 126 Handle<Code> code = Handle<Code>::cast(map_or_code); | 130 Handle<Code> code = Handle<Code>::cast(map_or_code); |
| 127 Builtins* builtins = isolate_->builtins(); | 131 Builtins* builtins = isolate_->builtins(); |
| 132 bool allow_growth = |
| 133 Code::GetKeyedAccessGrowMode(code->extra_ic_state()) == |
| 134 ALLOW_JSARRAY_GROWTH; |
| 128 return code->is_keyed_store_stub() && | 135 return code->is_keyed_store_stub() && |
| 136 !allow_growth && |
| 129 *code != builtins->builtin(Builtins::kKeyedStoreIC_Generic) && | 137 *code != builtins->builtin(Builtins::kKeyedStoreIC_Generic) && |
| 130 *code != builtins->builtin(Builtins::kKeyedStoreIC_Generic_Strict) && | 138 *code != builtins->builtin(Builtins::kKeyedStoreIC_Generic_Strict) && |
| 131 code->ic_state() == MEGAMORPHIC; | 139 code->ic_state() == MEGAMORPHIC; |
| 132 } | 140 } |
| 133 return false; | 141 return false; |
| 134 } | 142 } |
| 135 | 143 |
| 136 | 144 |
| 137 bool TypeFeedbackOracle::CallIsMonomorphic(Call* expr) { | 145 bool TypeFeedbackOracle::CallIsMonomorphic(Call* expr) { |
| 138 Handle<Object> value = GetInfo(expr->id()); | 146 Handle<Object> value = GetInfo(expr->id()); |
| (...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 USE(maybe_result); | 662 USE(maybe_result); |
| 655 #ifdef DEBUG | 663 #ifdef DEBUG |
| 656 Object* result = NULL; | 664 Object* result = NULL; |
| 657 // Dictionary has been allocated with sufficient size for all elements. | 665 // Dictionary has been allocated with sufficient size for all elements. |
| 658 ASSERT(maybe_result->ToObject(&result)); | 666 ASSERT(maybe_result->ToObject(&result)); |
| 659 ASSERT(*dictionary_ == result); | 667 ASSERT(*dictionary_ == result); |
| 660 #endif | 668 #endif |
| 661 } | 669 } |
| 662 | 670 |
| 663 } } // namespace v8::internal | 671 } } // namespace v8::internal |
| OLD | NEW |