| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 | 338 |
| 339 | 339 |
| 340 Handle<String> SubString(Handle<String> str, int start, int end) { | 340 Handle<String> SubString(Handle<String> str, int start, int end) { |
| 341 CALL_HEAP_FUNCTION(str->Slice(start, end), String); | 341 CALL_HEAP_FUNCTION(str->Slice(start, end), String); |
| 342 } | 342 } |
| 343 | 343 |
| 344 | 344 |
| 345 Handle<Object> SetElement(Handle<JSObject> object, | 345 Handle<Object> SetElement(Handle<JSObject> object, |
| 346 uint32_t index, | 346 uint32_t index, |
| 347 Handle<Object> value) { | 347 Handle<Object> value) { |
| 348 if (object->HasPixelElements()) { | 348 if (object->HasPixelElements() || object->HasExternalArrayElements()) { |
| 349 if (!value->IsSmi() && !value->IsHeapNumber() && !value->IsUndefined()) { | 349 if (!value->IsSmi() && !value->IsHeapNumber() && !value->IsUndefined()) { |
| 350 bool has_exception; | 350 bool has_exception; |
| 351 Handle<Object> number = Execution::ToNumber(value, &has_exception); | 351 Handle<Object> number = Execution::ToNumber(value, &has_exception); |
| 352 if (has_exception) return Handle<Object>(); | 352 if (has_exception) return Handle<Object>(); |
| 353 value = number; | 353 value = number; |
| 354 } | 354 } |
| 355 } | 355 } |
| 356 CALL_HEAP_FUNCTION(object->SetElement(index, *value), Object); | 356 CALL_HEAP_FUNCTION(object->SetElement(index, *value), Object); |
| 357 } | 357 } |
| 358 | 358 |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 757 Handle<Map> new_map = Factory::CopyMapDropTransitions(old_map); | 757 Handle<Map> new_map = Factory::CopyMapDropTransitions(old_map); |
| 758 obj->set_map(*new_map); | 758 obj->set_map(*new_map); |
| 759 new_map->set_needs_loading(true); | 759 new_map->set_needs_loading(true); |
| 760 // Store the lazy loading info in the constructor field. We'll | 760 // Store the lazy loading info in the constructor field. We'll |
| 761 // reestablish the constructor from the fixed array after loading. | 761 // reestablish the constructor from the fixed array after loading. |
| 762 new_map->set_constructor(*arr); | 762 new_map->set_constructor(*arr); |
| 763 ASSERT(!obj->IsLoaded()); | 763 ASSERT(!obj->IsLoaded()); |
| 764 } | 764 } |
| 765 | 765 |
| 766 } } // namespace v8::internal | 766 } } // namespace v8::internal |
| OLD | NEW |