Chromium Code Reviews| Index: Source/bindings/scripts/code_generator_v8.pm |
| diff --git a/Source/bindings/scripts/code_generator_v8.pm b/Source/bindings/scripts/code_generator_v8.pm |
| index 8d63d0b946603ac7004090d8a26b81b0805ffd17..8bb05dbaa25f8ee9f298de04e17259577bf2d483 100644 |
| --- a/Source/bindings/scripts/code_generator_v8.pm |
| +++ b/Source/bindings/scripts/code_generator_v8.pm |
| @@ -1186,7 +1186,7 @@ sub GenerateDomainSafeFunctionGetter |
| static void ${funcName}AttributeGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info) |
| { |
| // This is only for getting a unique pointer which we can pass to privateTemplate. |
| - static const char* privateTemplateUniqueKey = "${funcName}PrivateTemplate"; |
| + static const int privateTemplateUniqueKey = 0; |
|
digit1
2013/10/19 08:04:17
This looks really good.
For the record, you can a
Inactive
2013/10/22 14:25:42
So it looks like msvc optimizes out the static var
|
| WrapperWorldType currentWorldType = worldType(info.GetIsolate()); |
| V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate()); |
| v8::Handle<v8::FunctionTemplate> privateTemplate = data->privateTemplate(currentWorldType, &privateTemplateUniqueKey, $newTemplateParams, $functionLength); |
| @@ -1200,7 +1200,7 @@ static void ${funcName}AttributeGetter(v8::Local<v8::String> name, const v8::Pro |
| } |
| ${implClassName}* imp = ${v8ClassName}::toNative(holder); |
| if (!BindingSecurity::shouldAllowAccessToFrame(imp->frame(), DoNotReportSecurityError)) { |
| - static const char* sharedTemplateUniqueKey = "${funcName}SharedTemplate"; |
| + static const int sharedTemplateUniqueKey = 0; |
| v8::Handle<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(currentWorldType, &sharedTemplateUniqueKey, $newTemplateParams, $functionLength); |
| v8SetReturnValue(info, sharedTemplate->GetFunction()); |
| return; |
| @@ -2994,7 +2994,7 @@ END |
| v8::Handle<v8::FunctionTemplate> ${v8ClassName}Constructor::GetTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType) |
| { |
| // This is only for getting a unique pointer which we can pass to privateTemplate. |
| - static const char* privateTemplateUniqueKey = "${v8ClassName}Constructor::GetTemplatePrivateTemplate"; |
| + static const int privateTemplateUniqueKey = 0; |
| V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
| v8::Handle<v8::FunctionTemplate> result = data->privateTemplateIfExists(currentWorldType, &privateTemplateUniqueKey); |
| if (!result.IsEmpty()) |