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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 return value->IsMap() || value->IsSmi() || value->IsJSFunction(); | 147 return value->IsMap() || value->IsSmi() || value->IsJSFunction(); |
148 } | 148 } |
149 | 149 |
150 | 150 |
151 bool TypeFeedbackOracle::CallNewIsMonomorphic(CallNew* expr) { | 151 bool TypeFeedbackOracle::CallNewIsMonomorphic(CallNew* expr) { |
152 Handle<Object> value = GetInfo(expr->id()); | 152 Handle<Object> value = GetInfo(expr->id()); |
153 return value->IsJSFunction(); | 153 return value->IsJSFunction(); |
154 } | 154 } |
155 | 155 |
156 | 156 |
| 157 bool TypeFeedbackOracle::ObjectLiteralStoreIsMonomorphic( |
| 158 ObjectLiteral::Property* prop) { |
| 159 Handle<Object> map_or_code = GetInfo(prop->key()->id()); |
| 160 return map_or_code->IsMap(); |
| 161 } |
| 162 |
| 163 |
157 bool TypeFeedbackOracle::IsForInFastCase(ForInStatement* stmt) { | 164 bool TypeFeedbackOracle::IsForInFastCase(ForInStatement* stmt) { |
158 Handle<Object> value = GetInfo(stmt->PrepareId()); | 165 Handle<Object> value = GetInfo(stmt->PrepareId()); |
159 return value->IsSmi() && | 166 return value->IsSmi() && |
160 Smi::cast(*value)->value() == TypeFeedbackCells::kForInFastCaseMarker; | 167 Smi::cast(*value)->value() == TypeFeedbackCells::kForInFastCaseMarker; |
161 } | 168 } |
162 | 169 |
163 | 170 |
164 Handle<Map> TypeFeedbackOracle::LoadMonomorphicReceiverType(Property* expr) { | 171 Handle<Map> TypeFeedbackOracle::LoadMonomorphicReceiverType(Property* expr) { |
165 ASSERT(LoadIsMonomorphicNormal(expr)); | 172 ASSERT(LoadIsMonomorphicNormal(expr)); |
166 Handle<Object> map_or_code = GetInfo(expr->id()); | 173 Handle<Object> map_or_code = GetInfo(expr->id()); |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 Handle<JSFunction> TypeFeedbackOracle::GetCallTarget(Call* expr) { | 268 Handle<JSFunction> TypeFeedbackOracle::GetCallTarget(Call* expr) { |
262 return Handle<JSFunction>::cast(GetInfo(expr->id())); | 269 return Handle<JSFunction>::cast(GetInfo(expr->id())); |
263 } | 270 } |
264 | 271 |
265 | 272 |
266 Handle<JSFunction> TypeFeedbackOracle::GetCallNewTarget(CallNew* expr) { | 273 Handle<JSFunction> TypeFeedbackOracle::GetCallNewTarget(CallNew* expr) { |
267 return Handle<JSFunction>::cast(GetInfo(expr->id())); | 274 return Handle<JSFunction>::cast(GetInfo(expr->id())); |
268 } | 275 } |
269 | 276 |
270 | 277 |
| 278 Handle<Map> TypeFeedbackOracle::GetObjectLiteralStoreMap( |
| 279 ObjectLiteral::Property* prop) { |
| 280 ASSERT(ObjectLiteralStoreIsMonomorphic(prop)); |
| 281 return Handle<Map>::cast(GetInfo(prop->key()->id())); |
| 282 } |
| 283 |
| 284 |
271 bool TypeFeedbackOracle::LoadIsBuiltin(Property* expr, Builtins::Name id) { | 285 bool TypeFeedbackOracle::LoadIsBuiltin(Property* expr, Builtins::Name id) { |
272 return *GetInfo(expr->id()) == | 286 return *GetInfo(expr->id()) == |
273 isolate_->builtins()->builtin(id); | 287 isolate_->builtins()->builtin(id); |
274 } | 288 } |
275 | 289 |
276 | 290 |
277 TypeInfo TypeFeedbackOracle::CompareType(CompareOperation* expr) { | 291 TypeInfo TypeFeedbackOracle::CompareType(CompareOperation* expr) { |
278 Handle<Object> object = GetInfo(expr->id()); | 292 Handle<Object> object = GetInfo(expr->id()); |
279 TypeInfo unknown = TypeInfo::Unknown(); | 293 TypeInfo unknown = TypeInfo::Unknown(); |
280 if (!object->IsCode()) return unknown; | 294 if (!object->IsCode()) return unknown; |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
682 USE(maybe_result); | 696 USE(maybe_result); |
683 #ifdef DEBUG | 697 #ifdef DEBUG |
684 Object* result = NULL; | 698 Object* result = NULL; |
685 // Dictionary has been allocated with sufficient size for all elements. | 699 // Dictionary has been allocated with sufficient size for all elements. |
686 ASSERT(maybe_result->ToObject(&result)); | 700 ASSERT(maybe_result->ToObject(&result)); |
687 ASSERT(*dictionary_ == result); | 701 ASSERT(*dictionary_ == result); |
688 #endif | 702 #endif |
689 } | 703 } |
690 | 704 |
691 } } // namespace v8::internal | 705 } } // namespace v8::internal |
OLD | NEW |