Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(503)

Side by Side Diff: Source/bindings/scripts/CodeGeneratorV8.pm

Issue 13828008: Second part of moving V8 Binding Integrity off of vtables. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Invert meaning of flag to avoid branches in hot path. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/bindings/v8/DOMDataStore.h » ('j') | Source/bindings/v8/ScriptWrappable.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (C) 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> 1 # Copyright (C) 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org>
2 # Copyright (C) 2006 Anders Carlsson <andersca@mac.com> 2 # Copyright (C) 2006 Anders Carlsson <andersca@mac.com>
3 # Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> 3 # Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
4 # Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org> 4 # Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org>
5 # Copyright (C) 2006 Apple Computer, Inc. 5 # Copyright (C) 2006 Apple Computer, Inc.
6 # Copyright (C) 2007, 2008, 2009, 2012 Google Inc. 6 # Copyright (C) 2007, 2008, 2009, 2012 Google Inc.
7 # Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> 7 # Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au>
8 # Copyright (C) Research In Motion Limited 2010. All rights reserved. 8 # Copyright (C) Research In Motion Limited 2010. All rights reserved.
9 # Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 # Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 # Copyright (C) 2012 Ericsson AB. All rights reserved. 10 # Copyright (C) 2012 Ericsson AB. All rights reserved.
(...skipping 2832 matching lines...) Expand 10 before | Expand all | Expand 10 after
2843 #else 2843 #else
2844 void* expectedVTablePointer = ${vtableRefGnu}; 2844 void* expectedVTablePointer = ${vtableRefGnu};
2845 #endif 2845 #endif
2846 if (actualVTablePointer != expectedVTablePointer) 2846 if (actualVTablePointer != expectedVTablePointer)
2847 CRASH(); 2847 CRASH();
2848 } 2848 }
2849 #endif // ENABLE(BINDING_INTEGRITY) 2849 #endif // ENABLE(BINDING_INTEGRITY)
2850 2850
2851 END 2851 END
2852 2852
2853 my $parentClassInfo = $parentClass ? "&${parentClass}::info" : "0";
2854 my $WrapperTypePrototype = $interface->isException ? "WrapperTypeErrorProtot ype" : "WrapperTypeObjectPrototype";
2855 push(@implContentInternals, "WrapperTypeInfo ${v8InterfaceName}::info = { ${ v8InterfaceName}::GetTemplate, ${v8InterfaceName}::derefObject, $toActiveDOMObje ct, $toEventTarget, $rootForGC, ${v8InterfaceName}::installPerContextPrototypePr operties, $parentClassInfo, $WrapperTypePrototype };\n\n");
2853 2856
2854 my $parentClassInfo = $parentClass ? "&${parentClass}::info" : "0"; 2857 push(@implContentInternals, <<END) if !$codeGenerator->IsSVGTypeNeedingTearO ff($interfaceName);
2858 void initializeScriptWrappableForInterface(${interfaceName}* object)
2859 {
2860 if (ScriptWrappable::wrapperCanBeStoredInObject(object))
2861 ScriptWrappable::setTypeInfoInObject(object, &${v8InterfaceName}::info);
2862 }
2863 END
2855 2864
2856 my $WrapperTypePrototype = $interface->isException ? "WrapperTypeErrorProtot ype" : "WrapperTypeObjectPrototype";
2857
2858 push(@implContentInternals, "WrapperTypeInfo ${v8InterfaceName}::info = { ${ v8InterfaceName}::GetTemplate, ${v8InterfaceName}::derefObject, $toActiveDOMObje ct, $toEventTarget, $rootForGC, ${v8InterfaceName}::installPerContextPrototypePr operties, $parentClassInfo, $WrapperTypePrototype };\n\n");
2859 push(@implContentInternals, "namespace ${interfaceName}V8Internal {\n\n"); 2865 push(@implContentInternals, "namespace ${interfaceName}V8Internal {\n\n");
2860
2861 push(@implContentInternals, "template <typename T> void V8_USE(T) { }\n\n"); 2866 push(@implContentInternals, "template <typename T> void V8_USE(T) { }\n\n");
2862 2867
2863 my $hasConstructors = 0; 2868 my $hasConstructors = 0;
2864 my $hasReplaceable = 0; 2869 my $hasReplaceable = 0;
2865 2870
2866 # Generate property accessors for attributes. 2871 # Generate property accessors for attributes.
2867 for (my $index = 0; $index < @{$interface->attributes}; $index++) { 2872 for (my $index = 0; $index < @{$interface->attributes}; $index++) {
2868 my $attribute = @{$interface->attributes}[$index]; 2873 my $attribute = @{$interface->attributes}[$index];
2869 my $attrType = $attribute->signature->type; 2874 my $attrType = $attribute->signature->type;
2870 my $attrExt = $attribute->signature->extendedAttributes; 2875 my $attrExt = $attribute->signature->extendedAttributes;
(...skipping 1717 matching lines...) Expand 10 before | Expand all | Expand 10 after
4588 4593
4589 sub GetPassRefPtrType 4594 sub GetPassRefPtrType
4590 { 4595 {
4591 my $v8InterfaceName = shift; 4596 my $v8InterfaceName = shift;
4592 4597
4593 my $angleBracketSpace = $v8InterfaceName =~ />$/ ? " " : ""; 4598 my $angleBracketSpace = $v8InterfaceName =~ />$/ ? " " : "";
4594 return "PassRefPtr<${v8InterfaceName}${angleBracketSpace}>"; 4599 return "PassRefPtr<${v8InterfaceName}${angleBracketSpace}>";
4595 } 4600 }
4596 4601
4597 1; 4602 1;
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/v8/DOMDataStore.h » ('j') | Source/bindings/v8/ScriptWrappable.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698