| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 3344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3355 } | 3355 } |
| 3356 | 3356 |
| 3357 if (!allow_store_transition) { | 3357 if (!allow_store_transition) { |
| 3358 return start_map->CopyAsElementsKind(to_kind, OMIT_TRANSITION); | 3358 return start_map->CopyAsElementsKind(to_kind, OMIT_TRANSITION); |
| 3359 } | 3359 } |
| 3360 | 3360 |
| 3361 return start_map->AsElementsKind(to_kind); | 3361 return start_map->AsElementsKind(to_kind); |
| 3362 } | 3362 } |
| 3363 | 3363 |
| 3364 | 3364 |
| 3365 // TODO(ishell): Temporary wrapper until handlified. |
| 3366 // static |
| 3367 Handle<Map> Map::AsElementsKind(Handle<Map> map, ElementsKind kind) { |
| 3368 CALL_HEAP_FUNCTION(map->GetIsolate(), |
| 3369 map->AsElementsKind(kind), |
| 3370 Map); |
| 3371 } |
| 3372 |
| 3373 |
| 3365 MaybeObject* Map::AsElementsKind(ElementsKind kind) { | 3374 MaybeObject* Map::AsElementsKind(ElementsKind kind) { |
| 3366 Map* closest_map = FindClosestElementsTransition(this, kind); | 3375 Map* closest_map = FindClosestElementsTransition(this, kind); |
| 3367 | 3376 |
| 3368 if (closest_map->elements_kind() == kind) { | 3377 if (closest_map->elements_kind() == kind) { |
| 3369 return closest_map; | 3378 return closest_map; |
| 3370 } | 3379 } |
| 3371 | 3380 |
| 3372 return AddMissingElementsTransitions(closest_map, kind); | 3381 return AddMissingElementsTransitions(closest_map, kind); |
| 3373 } | 3382 } |
| 3374 | 3383 |
| (...skipping 13105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16480 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16489 #define ERROR_MESSAGES_TEXTS(C, T) T, |
| 16481 static const char* error_messages_[] = { | 16490 static const char* error_messages_[] = { |
| 16482 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16491 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
| 16483 }; | 16492 }; |
| 16484 #undef ERROR_MESSAGES_TEXTS | 16493 #undef ERROR_MESSAGES_TEXTS |
| 16485 return error_messages_[reason]; | 16494 return error_messages_[reason]; |
| 16486 } | 16495 } |
| 16487 | 16496 |
| 16488 | 16497 |
| 16489 } } // namespace v8::internal | 16498 } } // namespace v8::internal |
| OLD | NEW |