| 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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 return Handle<JSFunction>::cast(info); | 303 return Handle<JSFunction>::cast(info); |
| 304 } | 304 } |
| 305 } | 305 } |
| 306 | 306 |
| 307 | 307 |
| 308 ElementsKind TypeFeedbackOracle::GetCallNewElementsKind(CallNew* expr) { | 308 ElementsKind TypeFeedbackOracle::GetCallNewElementsKind(CallNew* expr) { |
| 309 Handle<Object> info = GetInfo(expr->CallNewFeedbackId()); | 309 Handle<Object> info = GetInfo(expr->CallNewFeedbackId()); |
| 310 if (info->IsSmi()) { | 310 if (info->IsSmi()) { |
| 311 return static_cast<ElementsKind>(Smi::cast(*info)->value()); | 311 return static_cast<ElementsKind>(Smi::cast(*info)->value()); |
| 312 } else { | 312 } else { |
| 313 return GetInitialFastElementsKind(); | 313 // TODO(mvstanton): avoided calling GetInitialFastElementsKind() for perf |
| 314 // reasons. Is there a better fix? |
| 315 if (FLAG_packed_arrays) { |
| 316 return FAST_SMI_ELEMENTS; |
| 317 } else { |
| 318 return FAST_HOLEY_SMI_ELEMENTS; |
| 319 } |
| 314 } | 320 } |
| 315 } | 321 } |
| 316 | 322 |
| 317 Handle<Map> TypeFeedbackOracle::GetObjectLiteralStoreMap( | 323 Handle<Map> TypeFeedbackOracle::GetObjectLiteralStoreMap( |
| 318 ObjectLiteral::Property* prop) { | 324 ObjectLiteral::Property* prop) { |
| 319 ASSERT(ObjectLiteralStoreIsMonomorphic(prop)); | 325 ASSERT(ObjectLiteralStoreIsMonomorphic(prop)); |
| 320 return Handle<Map>::cast(GetInfo(prop->key()->LiteralFeedbackId())); | 326 return Handle<Map>::cast(GetInfo(prop->key()->LiteralFeedbackId())); |
| 321 } | 327 } |
| 322 | 328 |
| 323 | 329 |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 734 USE(maybe_result); | 740 USE(maybe_result); |
| 735 #ifdef DEBUG | 741 #ifdef DEBUG |
| 736 Object* result = NULL; | 742 Object* result = NULL; |
| 737 // Dictionary has been allocated with sufficient size for all elements. | 743 // Dictionary has been allocated with sufficient size for all elements. |
| 738 ASSERT(maybe_result->ToObject(&result)); | 744 ASSERT(maybe_result->ToObject(&result)); |
| 739 ASSERT(*dictionary_ == result); | 745 ASSERT(*dictionary_ == result); |
| 740 #endif | 746 #endif |
| 741 } | 747 } |
| 742 | 748 |
| 743 } } // namespace v8::internal | 749 } } // namespace v8::internal |
| OLD | NEW |