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 2640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2651 "length exceeds max acceptable value")) { | 2651 "length exceeds max acceptable value")) { |
2652 return; | 2652 return; |
2653 } | 2653 } |
2654 i::Handle<i::JSObject> self = Utils::OpenHandle(this); | 2654 i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
2655 if (!ApiCheck(!self->IsJSArray(), | 2655 if (!ApiCheck(!self->IsJSArray(), |
2656 "v8::Object::SetIndexedPropertiesToPixelData()", | 2656 "v8::Object::SetIndexedPropertiesToPixelData()", |
2657 "JSArray is not supported")) { | 2657 "JSArray is not supported")) { |
2658 return; | 2658 return; |
2659 } | 2659 } |
2660 i::Handle<i::PixelArray> pixels = i::Factory::NewPixelArray(length, data); | 2660 i::Handle<i::PixelArray> pixels = i::Factory::NewPixelArray(length, data); |
2661 self->set_map( | 2661 i::Handle<i::Map> slow_map = |
2662 *i::Factory::GetSlowElementsMap(i::Handle<i::Map>(self->map()))); | 2662 i::Factory::GetSlowElementsMap(i::Handle<i::Map>(self->map())); |
| 2663 self->set_map(*slow_map); |
2663 self->set_elements(*pixels); | 2664 self->set_elements(*pixels); |
2664 } | 2665 } |
2665 | 2666 |
2666 | 2667 |
2667 bool v8::Object::HasIndexedPropertiesInPixelData() { | 2668 bool v8::Object::HasIndexedPropertiesInPixelData() { |
2668 ON_BAILOUT("v8::HasIndexedPropertiesInPixelData()", return false); | 2669 ON_BAILOUT("v8::HasIndexedPropertiesInPixelData()", return false); |
2669 i::Handle<i::JSObject> self = Utils::OpenHandle(this); | 2670 i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
2670 return self->HasPixelElements(); | 2671 return self->HasPixelElements(); |
2671 } | 2672 } |
2672 | 2673 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2706 return; | 2707 return; |
2707 } | 2708 } |
2708 i::Handle<i::JSObject> self = Utils::OpenHandle(this); | 2709 i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
2709 if (!ApiCheck(!self->IsJSArray(), | 2710 if (!ApiCheck(!self->IsJSArray(), |
2710 "v8::Object::SetIndexedPropertiesToExternalArrayData()", | 2711 "v8::Object::SetIndexedPropertiesToExternalArrayData()", |
2711 "JSArray is not supported")) { | 2712 "JSArray is not supported")) { |
2712 return; | 2713 return; |
2713 } | 2714 } |
2714 i::Handle<i::ExternalArray> array = | 2715 i::Handle<i::ExternalArray> array = |
2715 i::Factory::NewExternalArray(length, array_type, data); | 2716 i::Factory::NewExternalArray(length, array_type, data); |
2716 self->set_map( | 2717 i::Handle<i::Map> slow_map = |
2717 *i::Factory::GetSlowElementsMap(i::Handle<i::Map>(self->map()))); | 2718 i::Factory::GetSlowElementsMap(i::Handle<i::Map>(self->map())); |
| 2719 self->set_map(*slow_map); |
2718 self->set_elements(*array); | 2720 self->set_elements(*array); |
2719 } | 2721 } |
2720 | 2722 |
2721 | 2723 |
2722 bool v8::Object::HasIndexedPropertiesInExternalArrayData() { | 2724 bool v8::Object::HasIndexedPropertiesInExternalArrayData() { |
2723 ON_BAILOUT("v8::HasIndexedPropertiesInExternalArrayData()", return false); | 2725 ON_BAILOUT("v8::HasIndexedPropertiesInExternalArrayData()", return false); |
2724 i::Handle<i::JSObject> self = Utils::OpenHandle(this); | 2726 i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
2725 return self->HasExternalArrayElements(); | 2727 return self->HasExternalArrayElements(); |
2726 } | 2728 } |
2727 | 2729 |
(...skipping 2157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4885 | 4887 |
4886 | 4888 |
4887 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { | 4889 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { |
4888 HandleScopeImplementer* thread_local = | 4890 HandleScopeImplementer* thread_local = |
4889 reinterpret_cast<HandleScopeImplementer*>(storage); | 4891 reinterpret_cast<HandleScopeImplementer*>(storage); |
4890 thread_local->IterateThis(v); | 4892 thread_local->IterateThis(v); |
4891 return storage + ArchiveSpacePerThread(); | 4893 return storage + ArchiveSpacePerThread(); |
4892 } | 4894 } |
4893 | 4895 |
4894 } } // namespace v8::internal | 4896 } } // namespace v8::internal |
OLD | NEW |