Changeset 96135 in webkit
- Timestamp:
- Sep 27, 2011 11:19:01 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r96126 r96135 1 2011-09-27 Ulan Degenbaev <ulan@chromium.org> 2 3 [v8] Code calling the typed array optimization script is fragile, depends on typed array hierarchy. 4 5 Install the flag, which indicates whether or not the optimization 6 script was executed, on the global object. 7 8 https://bugs.webkit.org/show_bug.cgi?id=68890 9 10 Reviewed by Kenneth Russell. 11 12 * Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.cpp: 13 1 14 2011-09-27 Sheriff Bot <webkit.review.bot@gmail.com> 2 15 -
trunk/Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.cpp
r95901 r96135 33 33 namespace WebCore { 34 34 35 const char fastSetFlagName[] = "webgl::FastSetFlag"; 35 // The random suffix helps to avoid name collision. 36 const char fastSetFlagName[] = "TypedArray::FastSet::8NkZVq"; 36 37 37 38 bool fastSetInstalled(v8::Handle<v8::Object> array) 38 39 { 39 // Use a hidden flag in the common prototype (ArrayBufferView) of all typed 40 // arrays as an indicator of whether the fast 'set' is installed or not. 41 v8::Handle<v8::Object> prototype = array->GetPrototype().As<v8::Object>(); 42 v8::Handle<v8::Object> arrayBufferView = prototype->GetPrototype().As<v8::Object>(); 40 // Use a hidden flag in the global object an indicator of whether the fast 41 // 'set' is installed or not. 42 v8::Handle<v8::Object> global = array->CreationContext()->Global(); 43 43 v8::Handle<v8::String> key = v8::String::New(fastSetFlagName); 44 v8::Handle<v8::Value> fastSetFlag = arrayBufferView->GetHiddenValue(key);44 v8::Handle<v8::Value> fastSetFlag = global->GetHiddenValue(key); 45 45 return !fastSetFlag.IsEmpty(); 46 46 } … … 48 48 void installFastSet(v8::Handle<v8::Object> array) 49 49 { 50 v8::Handle<v8::Object> prototype = array->GetPrototype().As<v8::Object>(); 51 v8::Handle<v8::Object> arrayBufferView = prototype->GetPrototype().As<v8::Object>(); 50 v8::Handle<v8::Object> global = array->CreationContext()->Global(); 52 51 v8::Handle<v8::String> key = v8::String::New(fastSetFlagName); 53 arrayBufferView->SetHiddenValue(key, v8::Boolean::New(true));52 global->SetHiddenValue(key, v8::Boolean::New(true)); 54 53 55 54 String source(reinterpret_cast<const char*>(V8ArrayBufferViewCustomScript_js),
Note: See TracChangeset
for help on using the changeset viewer.