| 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 6083 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 6094   i::Handle<i::Object> length_object = | 6094   i::Handle<i::Object> length_object = | 
| 6095       isolate->factory()->NewNumberFromSize(length); | 6095       isolate->factory()->NewNumberFromSize(length); | 
| 6096   obj->set_length(*length_object); | 6096   obj->set_length(*length_object); | 
| 6097 | 6097 | 
| 6098   i::Handle<i::ExternalArray> elements = | 6098   i::Handle<i::ExternalArray> elements = | 
| 6099       isolate->factory()->NewExternalArray( | 6099       isolate->factory()->NewExternalArray( | 
| 6100           static_cast<int>(length), array_type, | 6100           static_cast<int>(length), array_type, | 
| 6101           static_cast<uint8_t*>(buffer->backing_store()) + byte_offset); | 6101           static_cast<uint8_t*>(buffer->backing_store()) + byte_offset); | 
| 6102   i::Handle<i::Map> map = | 6102   i::Handle<i::Map> map = | 
| 6103       i::JSObject::GetElementsTransitionMap(obj, elements_kind); | 6103       i::JSObject::GetElementsTransitionMap(obj, elements_kind); | 
| 6104   obj->set_map_and_elements(*map, *elements); | 6104   i::JSObject::SetMapAndElements(obj, map, elements); | 
| 6105   return obj; | 6105   return obj; | 
| 6106 } | 6106 } | 
| 6107 | 6107 | 
| 6108 | 6108 | 
| 6109 #define TYPED_ARRAY_NEW(Type, type, TYPE, ctype, size)                       \ | 6109 #define TYPED_ARRAY_NEW(Type, type, TYPE, ctype, size)                       \ | 
| 6110   Local<Type##Array> Type##Array::New(Handle<ArrayBuffer> array_buffer,      \ | 6110   Local<Type##Array> Type##Array::New(Handle<ArrayBuffer> array_buffer,      \ | 
| 6111                                     size_t byte_offset, size_t length) {     \ | 6111                                     size_t byte_offset, size_t length) {     \ | 
| 6112     i::Isolate* isolate = i::Isolate::Current();                             \ | 6112     i::Isolate* isolate = i::Isolate::Current();                             \ | 
| 6113     EnsureInitializedForIsolate(isolate,                                     \ | 6113     EnsureInitializedForIsolate(isolate,                                     \ | 
| 6114         "v8::" #Type "Array::New(Handle<ArrayBuffer>, size_t, size_t)");     \ | 6114         "v8::" #Type "Array::New(Handle<ArrayBuffer>, size_t, size_t)");     \ | 
| (...skipping 1538 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 7653   Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7653   Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 
| 7654   Address callback_address = | 7654   Address callback_address = | 
| 7655       reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7655       reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 
| 7656   VMState<EXTERNAL> state(isolate); | 7656   VMState<EXTERNAL> state(isolate); | 
| 7657   ExternalCallbackScope call_scope(isolate, callback_address); | 7657   ExternalCallbackScope call_scope(isolate, callback_address); | 
| 7658   callback(info); | 7658   callback(info); | 
| 7659 } | 7659 } | 
| 7660 | 7660 | 
| 7661 | 7661 | 
| 7662 } }  // namespace v8::internal | 7662 } }  // namespace v8::internal | 
| OLD | NEW | 
|---|