Changeset 87837 in webkit
- Timestamp:
- Jun 1, 2011, 12:52:13 PM (14 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r87828 r87837 1 2011-06-01 Kenneth Russell <kbr@google.com> 2 3 Reviewed by Nate Chapin. 4 5 [V8] Optimize fetches of indexed properties in custom bindings 6 https://bugs.webkit.org/show_bug.cgi?id=61821 7 8 Avoid allocating garbage in affected custom bindings. This speeds 9 up one test case by at least a factor of two. No new tests; 10 covered by existing layout tests (typed array and otherwise). 11 12 * bindings/v8/custom/V8ArrayBufferViewCustom.h: 13 (WebCore::constructWebGLArray): 14 (WebCore::setWebGLArrayHelper): 15 * bindings/v8/custom/V8InspectorFrontendHostCustom.cpp: 16 (WebCore::V8InspectorFrontendHost::showContextMenuCallback): 17 * bindings/v8/custom/V8MessagePortCustom.cpp: 18 (WebCore::getMessagePortArray): 19 * bindings/v8/custom/V8WebGLRenderingContextCustom.cpp: 20 (WebCore::jsArrayToFloatArray): 21 (WebCore::jsArrayToIntArray): 22 1 23 2011-06-01 Andras Becsi <abecsi@webkit.org> 2 24 -
trunk/Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h
r78407 r87837 150 150 // Need to copy the incoming array into the newly created ArrayBufferView. 151 151 for (unsigned i = 0; i < len; i++) { 152 v8::Local<v8::Value> val = srcArray->Get( v8::Integer::NewFromUnsigned(i));152 v8::Local<v8::Value> val = srcArray->Get(i); 153 153 array->set(i, val->NumberValue()); 154 154 } … … 197 197 else 198 198 for (uint32_t i = 0; i < length; i++) 199 impl->set(offset + i, array->Get( v8::Integer::NewFromUnsigned(i))->NumberValue());199 impl->set(offset + i, array->Get(i)->NumberValue()); 200 200 201 201 return v8::Undefined(); -
trunk/Source/WebCore/bindings/v8/custom/V8InspectorFrontendHostCustom.cpp
r84921 r87837 84 84 85 85 for (size_t i = 0; i < array->Length(); ++i) { 86 v8::Local<v8::Object> item = v8::Local<v8::Object>::Cast(array->Get( v8::Integer::New(i)));86 v8::Local<v8::Object> item = v8::Local<v8::Object>::Cast(array->Get(i)); 87 87 v8::Local<v8::Value> type = item->Get(v8::String::New("type")); 88 88 v8::Local<v8::Value> id = item->Get(v8::String::New("id")); -
trunk/Source/WebCore/bindings/v8/custom/V8MessagePortCustom.cpp
r86899 r87837 90 90 // Validate the passed array of ports. 91 91 for (unsigned int i = 0; i < length; ++i) { 92 v8::Local<v8::Value> port = ports->Get( v8::Integer::New(i));92 v8::Local<v8::Value> port = ports->Get(i); 93 93 // Validation of non-null objects, per HTML5 spec 8.3.3. 94 94 if (isUndefinedOrNull(port)) { -
trunk/Source/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp
r79011 r87837 78 78 return 0; 79 79 for (uint32_t i = 0; i < len; i++) { 80 v8::Local<v8::Value> val = array->Get( v8::Integer::New(i));80 v8::Local<v8::Value> val = array->Get(i); 81 81 if (!val->IsNumber()) { 82 82 fastFree(data); … … 97 97 return 0; 98 98 for (uint32_t i = 0; i < len; i++) { 99 v8::Local<v8::Value> val = array->Get( v8::Integer::New(i));99 v8::Local<v8::Value> val = array->Get(i); 100 100 bool ok; 101 101 int ival = toInt32(val, ok);
Note:
See TracChangeset
for help on using the changeset viewer.