| 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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 return value->IsSmi() && | 185 return value->IsSmi() && |
| 186 Smi::cast(*value)->value() == TypeFeedbackCells::kForInFastCaseMarker; | 186 Smi::cast(*value)->value() == TypeFeedbackCells::kForInFastCaseMarker; |
| 187 } | 187 } |
| 188 | 188 |
| 189 | 189 |
| 190 Handle<Map> TypeFeedbackOracle::LoadMonomorphicReceiverType(Property* expr) { | 190 Handle<Map> TypeFeedbackOracle::LoadMonomorphicReceiverType(Property* expr) { |
| 191 ASSERT(LoadIsMonomorphicNormal(expr)); | 191 ASSERT(LoadIsMonomorphicNormal(expr)); |
| 192 Handle<Object> map_or_code = GetInfo(expr->PropertyFeedbackId()); | 192 Handle<Object> map_or_code = GetInfo(expr->PropertyFeedbackId()); |
| 193 if (map_or_code->IsCode()) { | 193 if (map_or_code->IsCode()) { |
| 194 Handle<Code> code = Handle<Code>::cast(map_or_code); | 194 Handle<Code> code = Handle<Code>::cast(map_or_code); |
| 195 Map* first_map = code->FindFirstMap(); | 195 Handle<Map> first_map(code->FindFirstMap()); |
| 196 ASSERT(first_map != NULL); | 196 ASSERT(!first_map.is_null()); |
| 197 return CanRetainOtherContext(first_map, *native_context_) | 197 first_map = Map::CurrentMapForDeprecated(first_map); |
| 198 return CanRetainOtherContext(*first_map, *native_context_) |
| 198 ? Handle<Map>::null() | 199 ? Handle<Map>::null() |
| 199 : Handle<Map>(first_map); | 200 : first_map; |
| 200 } | 201 } |
| 201 return Handle<Map>::cast(map_or_code); | 202 return Map::CurrentMapForDeprecated(Handle<Map>::cast(map_or_code)); |
| 202 } | 203 } |
| 203 | 204 |
| 204 | 205 |
| 205 Handle<Map> TypeFeedbackOracle::StoreMonomorphicReceiverType( | 206 Handle<Map> TypeFeedbackOracle::StoreMonomorphicReceiverType( |
| 206 TypeFeedbackId ast_id) { | 207 TypeFeedbackId ast_id) { |
| 207 ASSERT(StoreIsMonomorphicNormal(ast_id)); | 208 ASSERT(StoreIsMonomorphicNormal(ast_id)); |
| 208 Handle<Object> map_or_code = GetInfo(ast_id); | 209 Handle<Object> map_or_code = GetInfo(ast_id); |
| 209 if (map_or_code->IsCode()) { | 210 if (map_or_code->IsCode()) { |
| 210 Handle<Code> code = Handle<Code>::cast(map_or_code); | 211 Handle<Code> code = Handle<Code>::cast(map_or_code); |
| 211 Map* first_map = code->FindFirstMap(); | 212 Handle<Map> first_map(code->FindFirstMap()); |
| 212 ASSERT(first_map != NULL); | 213 ASSERT(!first_map.is_null()); |
| 213 return CanRetainOtherContext(first_map, *native_context_) | 214 first_map = Map::CurrentMapForDeprecated(first_map); |
| 215 return CanRetainOtherContext(*first_map, *native_context_) |
| 214 ? Handle<Map>::null() | 216 ? Handle<Map>::null() |
| 215 : Handle<Map>(first_map); | 217 : first_map; |
| 216 } | 218 } |
| 217 return Handle<Map>::cast(map_or_code); | 219 return Map::CurrentMapForDeprecated(Handle<Map>::cast(map_or_code)); |
| 218 } | 220 } |
| 219 | 221 |
| 220 | 222 |
| 221 Handle<Map> TypeFeedbackOracle::CompareNilMonomorphicReceiverType( | 223 Handle<Map> TypeFeedbackOracle::CompareNilMonomorphicReceiverType( |
| 222 TypeFeedbackId id) { | 224 TypeFeedbackId id) { |
| 223 Handle<Object> maybe_code = GetInfo(id); | 225 Handle<Object> maybe_code = GetInfo(id); |
| 224 if (maybe_code->IsCode()) { | 226 if (maybe_code->IsCode()) { |
| 225 Map* first_map = Handle<Code>::cast(maybe_code)->FindFirstMap(); | 227 Map* first_map = Handle<Code>::cast(maybe_code)->FindFirstMap(); |
| 226 if (first_map != NULL) return Handle<Map>(first_map); | 228 if (first_map != NULL) { |
| 229 return Map::CurrentMapForDeprecated(Handle<Map>(first_map)); |
| 230 } |
| 227 } | 231 } |
| 228 return Handle<Map>(); | 232 return Handle<Map>(); |
| 229 } | 233 } |
| 230 | 234 |
| 231 | 235 |
| 232 KeyedAccessStoreMode TypeFeedbackOracle::GetStoreMode( | 236 KeyedAccessStoreMode TypeFeedbackOracle::GetStoreMode( |
| 233 TypeFeedbackId ast_id) { | 237 TypeFeedbackId ast_id) { |
| 234 Handle<Object> map_or_code = GetInfo(ast_id); | 238 Handle<Object> map_or_code = GetInfo(ast_id); |
| 235 if (map_or_code->IsCode()) { | 239 if (map_or_code->IsCode()) { |
| 236 Handle<Code> code = Handle<Code>::cast(map_or_code); | 240 Handle<Code> code = Handle<Code>::cast(map_or_code); |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 return FAST_SMI_ELEMENTS; | 344 return FAST_SMI_ELEMENTS; |
| 341 } else { | 345 } else { |
| 342 return FAST_HOLEY_SMI_ELEMENTS; | 346 return FAST_HOLEY_SMI_ELEMENTS; |
| 343 } | 347 } |
| 344 } | 348 } |
| 345 } | 349 } |
| 346 | 350 |
| 347 Handle<Map> TypeFeedbackOracle::GetObjectLiteralStoreMap( | 351 Handle<Map> TypeFeedbackOracle::GetObjectLiteralStoreMap( |
| 348 ObjectLiteral::Property* prop) { | 352 ObjectLiteral::Property* prop) { |
| 349 ASSERT(ObjectLiteralStoreIsMonomorphic(prop)); | 353 ASSERT(ObjectLiteralStoreIsMonomorphic(prop)); |
| 350 return Handle<Map>::cast(GetInfo(prop->key()->LiteralFeedbackId())); | 354 return Map::CurrentMapForDeprecated( |
| 355 Handle<Map>::cast(GetInfo(prop->key()->LiteralFeedbackId()))); |
| 351 } | 356 } |
| 352 | 357 |
| 353 | 358 |
| 354 bool TypeFeedbackOracle::LoadIsBuiltin(Property* expr, Builtins::Name id) { | 359 bool TypeFeedbackOracle::LoadIsBuiltin(Property* expr, Builtins::Name id) { |
| 355 return *GetInfo(expr->PropertyFeedbackId()) == | 360 return *GetInfo(expr->PropertyFeedbackId()) == |
| 356 isolate_->builtins()->builtin(id); | 361 isolate_->builtins()->builtin(id); |
| 357 } | 362 } |
| 358 | 363 |
| 359 | 364 |
| 360 bool TypeFeedbackOracle::LoadIsStub(Property* expr, ICStub* stub) { | 365 bool TypeFeedbackOracle::LoadIsStub(Property* expr, ICStub* stub) { |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 | 424 |
| 420 Handle<Map> TypeFeedbackOracle::GetCompareMap(CompareOperation* expr) { | 425 Handle<Map> TypeFeedbackOracle::GetCompareMap(CompareOperation* expr) { |
| 421 Handle<Object> object = GetInfo(expr->CompareOperationFeedbackId()); | 426 Handle<Object> object = GetInfo(expr->CompareOperationFeedbackId()); |
| 422 if (!object->IsCode()) return Handle<Map>::null(); | 427 if (!object->IsCode()) return Handle<Map>::null(); |
| 423 Handle<Code> code = Handle<Code>::cast(object); | 428 Handle<Code> code = Handle<Code>::cast(object); |
| 424 if (!code->is_compare_ic_stub()) return Handle<Map>::null(); | 429 if (!code->is_compare_ic_stub()) return Handle<Map>::null(); |
| 425 CompareIC::State state = ICCompareStub::CompareState(code->stub_info()); | 430 CompareIC::State state = ICCompareStub::CompareState(code->stub_info()); |
| 426 if (state != CompareIC::KNOWN_OBJECT) { | 431 if (state != CompareIC::KNOWN_OBJECT) { |
| 427 return Handle<Map>::null(); | 432 return Handle<Map>::null(); |
| 428 } | 433 } |
| 429 Map* first_map = code->FindFirstMap(); | 434 Handle<Map> first_map(code->FindFirstMap()); |
| 430 ASSERT(first_map != NULL); | 435 ASSERT(!first_map.is_null()); |
| 431 return CanRetainOtherContext(first_map, *native_context_) | 436 first_map = Map::CurrentMapForDeprecated(first_map); |
| 437 return CanRetainOtherContext(*first_map, *native_context_) |
| 432 ? Handle<Map>::null() | 438 ? Handle<Map>::null() |
| 433 : Handle<Map>(first_map); | 439 : first_map; |
| 434 } | 440 } |
| 435 | 441 |
| 436 | 442 |
| 437 TypeInfo TypeFeedbackOracle::UnaryType(UnaryOperation* expr) { | 443 TypeInfo TypeFeedbackOracle::UnaryType(UnaryOperation* expr) { |
| 438 Handle<Object> object = GetInfo(expr->UnaryOperationFeedbackId()); | 444 Handle<Object> object = GetInfo(expr->UnaryOperationFeedbackId()); |
| 439 TypeInfo unknown = TypeInfo::Unknown(); | 445 TypeInfo unknown = TypeInfo::Unknown(); |
| 440 if (!object->IsCode()) return unknown; | 446 if (!object->IsCode()) return unknown; |
| 441 Handle<Code> code = Handle<Code>::cast(object); | 447 Handle<Code> code = Handle<Code>::cast(object); |
| 442 ASSERT(code->is_unary_op_stub()); | 448 ASSERT(code->is_unary_op_stub()); |
| 443 UnaryOpIC::TypeInfo type = static_cast<UnaryOpIC::TypeInfo>( | 449 UnaryOpIC::TypeInfo type = static_cast<UnaryOpIC::TypeInfo>( |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 773 USE(maybe_result); | 779 USE(maybe_result); |
| 774 #ifdef DEBUG | 780 #ifdef DEBUG |
| 775 Object* result = NULL; | 781 Object* result = NULL; |
| 776 // Dictionary has been allocated with sufficient size for all elements. | 782 // Dictionary has been allocated with sufficient size for all elements. |
| 777 ASSERT(maybe_result->ToObject(&result)); | 783 ASSERT(maybe_result->ToObject(&result)); |
| 778 ASSERT(*dictionary_ == result); | 784 ASSERT(*dictionary_ == result); |
| 779 #endif | 785 #endif |
| 780 } | 786 } |
| 781 | 787 |
| 782 } } // namespace v8::internal | 788 } } // namespace v8::internal |
| OLD | NEW |