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 2288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2299 if (!ApiCheck(!self->IsJSArray(), | 2299 if (!ApiCheck(!self->IsJSArray(), |
2300 "v8::Object::SetIndexedPropertiesToPixelData()", | 2300 "v8::Object::SetIndexedPropertiesToPixelData()", |
2301 "JSArray is not supported")) { | 2301 "JSArray is not supported")) { |
2302 return; | 2302 return; |
2303 } | 2303 } |
2304 i::Handle<i::PixelArray> pixels = i::Factory::NewPixelArray(length, data); | 2304 i::Handle<i::PixelArray> pixels = i::Factory::NewPixelArray(length, data); |
2305 self->set_elements(*pixels); | 2305 self->set_elements(*pixels); |
2306 } | 2306 } |
2307 | 2307 |
2308 | 2308 |
| 2309 void v8::Object::SetIndexedPropertiesToExternalArrayData( |
| 2310 void* data, |
| 2311 ExternalArrayType array_type, |
| 2312 int length) { |
| 2313 ON_BAILOUT("v8::SetIndexedPropertiesToExternalArrayData()", return); |
| 2314 ENTER_V8; |
| 2315 HandleScope scope; |
| 2316 if (!ApiCheck(length <= i::ExternalArray::kMaxLength, |
| 2317 "v8::Object::SetIndexedPropertiesToExternalArrayData()", |
| 2318 "length exceeds max acceptable value")) { |
| 2319 return; |
| 2320 } |
| 2321 i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
| 2322 if (!ApiCheck(!self->IsJSArray(), |
| 2323 "v8::Object::SetIndexedPropertiesToExternalArrayData()", |
| 2324 "JSArray is not supported")) { |
| 2325 return; |
| 2326 } |
| 2327 i::Handle<i::ExternalArray> array = |
| 2328 i::Factory::NewExternalArray(length, array_type, data); |
| 2329 self->set_elements(*array); |
| 2330 } |
| 2331 |
| 2332 |
2309 Local<v8::Object> Function::NewInstance() const { | 2333 Local<v8::Object> Function::NewInstance() const { |
2310 return NewInstance(0, NULL); | 2334 return NewInstance(0, NULL); |
2311 } | 2335 } |
2312 | 2336 |
2313 | 2337 |
2314 Local<v8::Object> Function::NewInstance(int argc, | 2338 Local<v8::Object> Function::NewInstance(int argc, |
2315 v8::Handle<v8::Value> argv[]) const { | 2339 v8::Handle<v8::Value> argv[]) const { |
2316 ON_BAILOUT("v8::Function::NewInstance()", return Local<v8::Object>()); | 2340 ON_BAILOUT("v8::Function::NewInstance()", return Local<v8::Object>()); |
2317 LOG_API("Function::NewInstance"); | 2341 LOG_API("Function::NewInstance"); |
2318 ENTER_V8; | 2342 ENTER_V8; |
(...skipping 1493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3812 | 3836 |
3813 | 3837 |
3814 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { | 3838 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { |
3815 HandleScopeImplementer* thread_local = | 3839 HandleScopeImplementer* thread_local = |
3816 reinterpret_cast<HandleScopeImplementer*>(storage); | 3840 reinterpret_cast<HandleScopeImplementer*>(storage); |
3817 thread_local->IterateThis(v); | 3841 thread_local->IterateThis(v); |
3818 return storage + ArchiveSpacePerThread(); | 3842 return storage + ArchiveSpacePerThread(); |
3819 } | 3843 } |
3820 | 3844 |
3821 } } // namespace v8::internal | 3845 } } // namespace v8::internal |
OLD | NEW |