Changeset 148505 in webkit
- Timestamp:
- Apr 16, 2013 2:29:37 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r148497 r148505 1 2013-04-15 Maciej Stachowiak <mjs@apple.com> 2 3 Remove more traces of the now-obsolete support for V8 4 https://bugs.webkit.org/show_bug.cgi?id=114657 5 6 Reviewed by Ryosuke Niwa. 7 8 In addition to passing existing tests, I verified that the ElementFactory 9 and ElementWrapperFactory files were all textually identical before and after. 10 11 * dom/CustomEvent.cpp: 12 (WebCore): Remove Use(V8) bock. 13 * dom/CustomEvent.h: 14 (CustomEvent): ditto 15 * dom/MessageEvent.cpp: 16 (WebCore::MessageEvent::MessageEvent): ditto 17 (WebCore::MessageEvent::initMessageEvent): ditto 18 * dom/Node.h: 19 (Node): ditto 20 * dom/make_event_factory.pl: 21 (generateImplementation): Remove V8 support. 22 * dom/make_names.pl: Remove gobs of V8 support and simplify. 23 (printJSElementIncludes): 24 (printConditionalElementIncludes): 25 (printFactoryCppFile): 26 (printWrapperFunctions): 27 (printWrapperFactoryCppFile): 28 (printWrapperFactoryHeaderFile): 29 * inspector/InjectedScriptCanvasModuleSource.js: Remove V8 stack 30 trace code. 31 * platform/qt/PlatformSupport.h: Remove a macro only used for V8 32 bindings. 33 * svg/SVGZoomAndPan.h: 34 (SVGZoomAndPan): Remove mention of V8 from comment. 35 1 36 2013-04-15 Ryosuke Niwa <rniwa@webkit.org> 2 37 -
trunk/Source/WebCore/dom/CustomEvent.cpp
r134120 r148505 60 60 } 61 61 62 #if USE(V8)63 void CustomEvent::initCustomEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<SerializedScriptValue> serializedScriptValue)64 {65 ASSERT(m_detail.hasNoValue());66 if (dispatched())67 return;68 69 initEvent(type, canBubble, cancelable);70 71 m_serializedScriptValue = serializedScriptValue;72 }73 #endif // USE(V8)74 75 62 const AtomicString& CustomEvent::interfaceName() const 76 63 { -
trunk/Source/WebCore/dom/CustomEvent.h
r134120 r148505 54 54 55 55 void initCustomEvent(const AtomicString& type, bool canBubble, bool cancelable, const ScriptValue& detail); 56 #if USE(V8)57 void initCustomEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<SerializedScriptValue>);58 #endif59 56 60 57 virtual const AtomicString& interfaceName() const; -
trunk/Source/WebCore/dom/MessageEvent.cpp
r145930 r148505 74 74 , m_ports(ports) 75 75 { 76 #if USE(V8)77 if (m_dataAsSerializedScriptValue)78 m_dataAsSerializedScriptValue->registerMemoryAllocatedWithCurrentScriptContext();79 #endif80 76 } 81 77 … … 139 135 m_source = source; 140 136 m_ports = ports; 141 142 #if USE(V8)143 if (m_dataAsSerializedScriptValue)144 m_dataAsSerializedScriptValue->registerMemoryAllocatedWithCurrentScriptContext();145 #endif146 137 } 147 138 -
trunk/Source/WebCore/dom/Node.h
r148289 r148505 389 389 void setHasEventTargetData(bool flag) { setFlag(flag, HasEventTargetDataFlag); } 390 390 391 #if USE(V8)392 bool isV8CollectableDuringMinorGC() const { return getFlag(V8CollectableDuringMinorGCFlag); }393 void setV8CollectableDuringMinorGC(bool flag) { setFlag(flag, V8CollectableDuringMinorGCFlag); }394 #endif395 396 391 enum ShouldSetAttached { 397 392 SetAttached, … … 729 724 HasScopedHTMLStyleChildFlag = 1 << 22, 730 725 HasEventTargetDataFlag = 1 << 23, 731 #if USE(V8)732 V8CollectableDuringMinorGCFlag = 1 << 24,733 #endif734 726 NeedsShadowTreeWalkerFlag = 1 << 25, 735 727 IsInShadowTreeFlag = 1 << 26, -
trunk/Source/WebCore/dom/make_event_factory.pl
r106603 r148505 87 87 print F "\n"; 88 88 print F "#include \"${namespace}Headers.h\"\n"; 89 print F "#if USE(V8)\n";90 print F "#include \"RuntimeEnabledFeatures.h\"\n";91 print F "#endif\n";92 89 print F "\n"; 93 90 print F "namespace WebCore {\n"; … … 102 99 103 100 print F "#if ENABLE($conditional)\n" if $conditional; 104 if ($runtimeConditional) { 105 print F " #if USE(V8)\n"; 106 print F " // FIXME: JSC should support RuntimeEnabledFeatures as well.\n"; 107 print F " if (type == \"$eventName\" && RuntimeEnabledFeatures::$runtimeConditional())\n"; 108 print F " return ${interfaceName}::create();\n"; 109 print F " #else\n"; 110 } 101 # FIXEME JSC should support RuntimeEnabledFeatures 111 102 print F " if (type == \"$eventName\")\n"; 112 103 print F " return ${interfaceName}::create();\n"; 113 print F "#endif // USE(V8)\n" if $runtimeConditional;114 104 print F "#endif\n" if $conditional; 115 105 } -
trunk/Source/WebCore/dom/make_names.pl
r146851 r148505 45 45 my $printFactory = 0; 46 46 my $printWrapperFactory = 0; 47 my $printWrapperFactoryV8 = 0;48 47 my $fontNamesIn = ""; 49 48 my $tagsFile = ""; … … 82 81 'preprocessor=s' => \$preprocessor, 83 82 'wrapperFactory' => \$printWrapperFactory, 84 'wrapperFactoryV8' => \$printWrapperFactoryV8,85 83 'fonts=s' => \$fontNamesIn 86 84 ); … … 169 167 } 170 168 171 die "You cannot specify both --wrapperFactory and --wrapperFactoryV8" if $printWrapperFactory && $printWrapperFactoryV8;172 my $wrapperFactoryType = "";173 169 if ($printWrapperFactory) { 174 $wrapperFactoryType = "JS"; 175 } elsif ($printWrapperFactoryV8) { 176 $wrapperFactoryType = "V8"; 177 } 178 179 if ($wrapperFactoryType) { 180 printWrapperFactoryCppFile($outputDir, $wrapperFactoryType, $wrapperFactoryFileName); 181 printWrapperFactoryHeaderFile($outputDir, $wrapperFactoryType, $wrapperFactoryFileName); 170 printWrapperFactoryCppFile($outputDir, $wrapperFactoryFileName); 171 printWrapperFactoryHeaderFile($outputDir, $wrapperFactoryFileName); 182 172 } 183 173 … … 729 719 { 730 720 my $F = shift; 731 my $wrapperFactoryType = shift;732 721 733 722 my %tagsSeen; … … 741 730 $tagsSeen{$JSInterfaceName} = 1; 742 731 743 print F "#include \" ${wrapperFactoryType}${JSInterfaceName}.h\"\n";744 } 745 print F "#include \" ${wrapperFactoryType}$parameters{fallbackInterfaceName}.h\"\n";732 print F "#include \"JS${JSInterfaceName}.h\"\n"; 733 } 734 print F "#include \"JS$parameters{fallbackInterfaceName}.h\"\n"; 746 735 } 747 736 … … 767 756 sub printConditionalElementIncludes 768 757 { 769 my ($F, $wrapper FactoryType) = @_;758 my ($F, $wrapperIncludes) = @_; 770 759 771 760 my %conditionals; … … 793 782 print F "#include \"$interfaceName.h\"\n"; 794 783 } 795 if ($wrapper FactoryType) {784 if ($wrapperIncludes) { 796 785 for my $JSInterfaceName (sort keys %{$conditionals{$conditional}{JSInterfaceNames}}) { 797 786 next if $unconditionalJSElementIncludes{$JSInterfaceName}; 798 print F "#include \" $wrapperFactoryType$JSInterfaceName.h\"\n";787 print F "#include \"JS$JSInterfaceName.h\"\n"; 799 788 } 800 789 } … … 850 839 print F "\n#include <wtf/HashMap.h>\n"; 851 840 852 printConditionalElementIncludes($F );841 printConditionalElementIncludes($F, 0); 853 842 854 843 print F <<END … … 1040 1029 { 1041 1030 my $F = shift; 1042 my $wrapperFactoryType = shift;1043 1031 1044 1032 my %tagsSeen; … … 1055 1043 } 1056 1044 1057 if ($wrapperFactoryType eq "JS") { 1058 # Hack for the media tags 1059 # FIXME: This should have been done via a CustomWrapper attribute and a separate *Custom file. 1060 if ($enabledTags{$tagName}{wrapperOnlyIfMediaIsAvailable}) { 1061 print F <<END 1045 # Hack for the media tags 1046 # FIXME: This should have been done via a CustomWrapper attribute and a separate *Custom file. 1047 if ($enabledTags{$tagName}{wrapperOnlyIfMediaIsAvailable}) { 1048 print F <<END 1062 1049 static JSDOMWrapper* create${JSInterfaceName}Wrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<$parameters{namespace}Element> element) 1063 1050 { … … 1069 1056 1070 1057 END 1071 ;1072 1073 1074 1058 ; 1059 } elsif ($enabledTags{$tagName}{contextConditional}) { 1060 my $contextConditional = $enabledTags{$tagName}{contextConditional}; 1061 print F <<END 1075 1062 static JSDOMWrapper* create${JSInterfaceName}Wrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<$parameters{namespace}Element> element) 1076 1063 { … … 1083 1070 } 1084 1071 END 1085 ;1086 1087 1088 1072 ; 1073 } elsif ($enabledTags{$tagName}{runtimeConditional}) { 1074 my $runtimeConditional = $enabledTags{$tagName}{runtimeConditional}; 1075 print F <<END 1089 1076 static JSDOMWrapper* create${JSInterfaceName}Wrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<$parameters{namespace}Element> element) 1090 1077 { … … 1097 1084 } 1098 1085 END 1099 ;1100 1101 1086 ; 1087 } else { 1088 print F <<END 1102 1089 static JSDOMWrapper* create${JSInterfaceName}Wrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<$parameters{namespace}Element> element) 1103 1090 { … … 1106 1093 1107 1094 END 1108 ; 1109 } 1110 } elsif ($wrapperFactoryType eq "V8") { 1111 if ($enabledTags{$tagName}{wrapperOnlyIfMediaIsAvailable}) { 1112 print F <<END 1113 static v8::Handle<v8::Object> create${JSInterfaceName}Wrapper($parameters{namespace}Element* element, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) 1114 { 1115 Settings* settings = element->document()->settings(); 1116 if (!MediaPlayer::isAvailable() || (settings && !settings->mediaEnabled())) 1117 return createV8$parameters{namespace}DirectWrapper(element, creationContext, isolate); 1118 return wrap(static_cast<${JSInterfaceName}*>(element), creationContext, isolate); 1119 } 1120 1121 END 1122 ; 1123 } elsif ($enabledTags{$tagName}{contextConditional}) { 1124 my $contextConditional = $enabledTags{$tagName}{contextConditional}; 1125 print F <<END 1126 static v8::Handle<v8::Object> create${JSInterfaceName}Wrapper($parameters{namespace}Element* element, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) 1127 { 1128 if (!ContextFeatures::${contextConditional}Enabled(element->document())) 1129 return createV8$parameters{namespace}FallbackWrapper(to$parameters{fallbackInterfaceName}(element), creationContext, isolate); 1130 return wrap(static_cast<${JSInterfaceName}*>(element), creationContext, isolate); 1131 } 1132 END 1133 ; 1134 } elsif ($enabledTags{$tagName}{runtimeConditional}) { 1135 my $runtimeConditional = $enabledTags{$tagName}{runtimeConditional}; 1136 print F <<END 1137 static v8::Handle<v8::Object> create${JSInterfaceName}Wrapper($parameters{namespace}Element* element, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) 1138 { 1139 if (!RuntimeEnabledFeatures::${runtimeConditional}Enabled()) 1140 return createV8$parameters{namespace}FallbackWrapper(to$parameters{fallbackInterfaceName}(element), creationContext, isolate); 1141 return wrap(static_cast<${JSInterfaceName}*>(element), creationContext, isolate); 1142 } 1143 END 1144 ; 1145 } elsif (${JSInterfaceName} eq "HTMLElement") { 1146 print F <<END 1147 static v8::Handle<v8::Object> create${JSInterfaceName}Wrapper($parameters{namespace}Element* element, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) 1148 { 1149 ASSERT_NOT_REACHED(); 1150 return v8::Handle<v8::Object>(); 1151 } 1152 1153 END 1154 ; 1155 } else { 1156 print F <<END 1157 static v8::Handle<v8::Object> create${JSInterfaceName}Wrapper($parameters{namespace}Element* element, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) 1158 { 1159 return wrap(static_cast<${JSInterfaceName}*>(element), creationContext, isolate); 1160 } 1161 1162 1163 END 1164 ; 1165 } 1095 ; 1166 1096 } 1167 1097 … … 1175 1105 { 1176 1106 my $outputDir = shift; 1177 my $wrapperFactoryType = shift;1178 1107 my $wrapperFactoryFileName = shift; 1179 1108 my $F; 1180 open F, ">" . $outputDir . "/ " . $wrapperFactoryType. $wrapperFactoryFileName . ".cpp";1109 open F, ">" . $outputDir . "/JS" . $wrapperFactoryFileName . ".cpp"; 1181 1110 1182 1111 printLicenseHeader($F); 1183 1112 1184 1113 print F "#include \"config.h\"\n"; 1185 print F "#include \" $wrapperFactoryType$parameters{namespace}ElementWrapperFactory.h\"\n";1114 print F "#include \"JS$parameters{namespace}ElementWrapperFactory.h\"\n"; 1186 1115 1187 1116 print F "\n#if $parameters{guardFactoryWith}\n\n" if $parameters{guardFactoryWith}; 1188 1117 1189 printJSElementIncludes($F , $wrapperFactoryType);1118 printJSElementIncludes($F); 1190 1119 1191 1120 print F "\n#include \"$parameters{namespace}Names.h\"\n\n"; … … 1195 1124 print F "\n#include <wtf/StdLibExtras.h>\n"; 1196 1125 1197 printConditionalElementIncludes($F, $wrapperFactoryType);1126 printConditionalElementIncludes($F, 1); 1198 1127 1199 1128 print F <<END … … 1210 1139 ; 1211 1140 1212 if ($wrapperFactoryType eq "JS") { 1213 print F <<END 1141 print F <<END 1214 1142 using namespace JSC; 1215 1143 END 1216 1144 ; 1217 } elsif ($wrapperFactoryType eq "V8") {1218 print F <<END1219 #include "V8$parameters{namespace}Element.h"1220 1221 #if ENABLE(CUSTOM_ELEMENTS)1222 #include "CustomElementHelpers.h"1223 #endif1224 1225 #include <v8.h>1226 END1227 ;1228 }1229 1145 1230 1146 print F <<END … … 1236 1152 END 1237 1153 ; 1238 if ($wrapperFactoryType eq "JS") { 1239 print F <<END 1154 print F <<END 1240 1155 typedef JSDOMWrapper* (*Create$parameters{namespace}ElementWrapperFunction)(ExecState*, JSDOMGlobalObject*, PassRefPtr<$parameters{namespace}Element>); 1241 1156 1242 1157 END 1243 1158 ; 1244 } elsif ($wrapperFactoryType eq "V8") { 1245 print F <<END 1246 typedef v8::Handle<v8::Object> (*Create$parameters{namespace}ElementWrapperFunction)($parameters{namespace}Element*, v8::Handle<v8::Object> creationContext, v8::Isolate*); 1247 1248 END 1249 ; 1250 } 1251 1252 printWrapperFunctions($F, $wrapperFactoryType); 1253 1254 if ($wrapperFactoryType eq "JS") { 1255 print F <<END 1159 1160 printWrapperFunctions($F); 1161 1162 print F <<END 1256 1163 JSDOMWrapper* createJS$parameters{namespace}Wrapper(ExecState* exec, JSDOMGlobalObject* globalObject, PassRefPtr<$parameters{namespace}Element> element) 1257 1164 { … … 1261 1168 END 1262 1169 ; 1263 } elsif ($wrapperFactoryType eq "V8") {1264 print F <<END1265 v8::Handle<v8::Object> createV8$parameters{namespace}Wrapper($parameters{namespace}Element* element, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)1266 {1267 typedef HashMap<WTF::AtomicStringImpl*, Create$parameters{namespace}ElementWrapperFunction> FunctionMap;1268 DEFINE_STATIC_LOCAL(FunctionMap, map, ());1269 if (map.isEmpty()) {1270 END1271 ;1272 }1273 1170 1274 1171 for my $tag (sort keys %enabledTags) { … … 1294 1191 END 1295 1192 ; 1296 if ($wrapperFactoryType eq "V8") {1297 print F <<END1298 #if ENABLE(CUSTOM_ELEMENTS)1299 if (PassRefPtr<CustomElementConstructor> constructor = CustomElementHelpers::constructorOf(element))1300 return CustomElementHelpers::wrap(element, creationContext, constructor, isolate);1301 #endif1302 END1303 ;1304 }1305 1193 1306 1194 print F <<END … … 1309 1197 END 1310 1198 ; 1311 if ($wrapperFactoryType eq "JS") { 1312 print F <<END 1199 print F <<END 1313 1200 return createWrapperFunction(exec, globalObject, element); 1314 1201 return CREATE_DOM_WRAPPER(exec, globalObject, $parameters{fallbackInterfaceName}, element.get()); 1315 1202 END 1316 1203 ; 1317 } elsif ($wrapperFactoryType eq "V8") {1318 print F <<END1319 {1320 END1321 ;1322 if ($parameters{namespace} eq "HTML") {1323 print F <<END1324 if (createWrapperFunction == createHTMLElementWrapper)1325 return V8HTMLElement::createWrapper(element, creationContext, isolate);1326 END1327 }1328 print F <<END1329 return createWrapperFunction(element, creationContext, isolate);1330 }1331 END1332 ;1333 if ($parameters{namespace} eq "SVG") {1334 print F <<END1335 return V8SVGElement::createWrapper(element, creationContext, isolate);1336 END1337 ;1338 } else {1339 print F <<END1340 return wrap(to$parameters{fallbackInterfaceName}(element), creationContext, isolate);1341 END1342 ;1343 }1344 }1345 1204 print F <<END 1346 1205 } 1347 1206 END 1348 1207 ; 1349 1350 if ($wrapperFactoryType eq "V8") {1351 print F <<END1352 1353 const QualifiedName* find$parameters{namespace}TagNameOfV8Type(const WrapperTypeInfo* type)1354 {1355 typedef HashMap<const WrapperTypeInfo*, const QualifiedName*> TypeNameMap;1356 DEFINE_STATIC_LOCAL(TypeNameMap, map, ());1357 if (map.isEmpty()) {1358 END1359 ;1360 1361 for my $tagName (sort keys %enabledTags) {1362 if (!usesDefaultJSWrapper($tagName)) {1363 my $conditional = $enabledTags{$tagName}{conditional};1364 if ($conditional) {1365 my $conditionalString = "ENABLE(" . join(") && ENABLE(", split(/&/, $conditional)) . ")";1366 print F "#if ${conditionalString}\n";1367 }1368 1369 my $JSInterfaceName = $enabledTags{$tagName}{JSInterfaceName};1370 print F " map.set(WrapperTypeTraits<${JSInterfaceName}>::info(), &${tagName}Tag);\n";1371 1372 if ($conditional) {1373 print F "#endif\n";1374 }1375 }1376 }1377 1378 print F <<END1379 }1380 1381 return map.get(type);1382 }1383 1384 END1385 ;1386 }1387 1208 1388 1209 print F "}\n\n"; … … 1395 1216 { 1396 1217 my $outputDir = shift; 1397 my $wrapperFactoryType = shift;1398 1218 my $wrapperFactoryFileName = shift; 1399 1219 my $F; 1400 open F, ">" . $outputDir . "/ " . $wrapperFactoryType. $wrapperFactoryFileName . ".h";1220 open F, ">" . $outputDir . "/JS" . $wrapperFactoryFileName . ".h"; 1401 1221 1402 1222 printLicenseHeader($F); 1403 1223 1404 print F "#ifndef $wrapperFactoryType$parameters{namespace}ElementWrapperFactory_h\n";1405 print F "#define $wrapperFactoryType$parameters{namespace}ElementWrapperFactory_h\n\n";1224 print F "#ifndef JS$parameters{namespace}ElementWrapperFactory_h\n"; 1225 print F "#define JS$parameters{namespace}ElementWrapperFactory_h\n\n"; 1406 1226 1407 1227 print F "#if $parameters{guardFactoryWith}\n" if $parameters{guardFactoryWith}; 1408 1228 1409 if ($wrapperFactoryType eq "JS") { 1410 print F <<END 1229 print F <<END 1411 1230 #include <wtf/Forward.h> 1412 1231 … … 1426 1245 1427 1246 END 1428 ; 1429 } elsif ($wrapperFactoryType eq "V8") { 1430 print F <<END 1431 #include <V8$parameters{namespace}Element.h> 1432 #include <V8$parameters{fallbackInterfaceName}.h> 1433 #include <v8.h> 1434 1435 namespace WebCore { 1436 1437 class $parameters{namespace}Element; 1438 1439 const QualifiedName* find$parameters{namespace}TagNameOfV8Type(const WrapperTypeInfo*); 1440 v8::Handle<v8::Object> createV8$parameters{namespace}Wrapper($parameters{namespace}Element*, v8::Handle<v8::Object> creationContext, v8::Isolate*); 1441 inline v8::Handle<v8::Object> createV8$parameters{namespace}DirectWrapper($parameters{namespace}Element* element, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) 1442 { 1443 return V8$parameters{namespace}Element::createWrapper(element, creationContext, isolate); 1444 } 1445 inline v8::Handle<v8::Object> createV8$parameters{namespace}FallbackWrapper($parameters{fallbackInterfaceName}* element, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) 1446 { 1447 return V8$parameters{fallbackInterfaceName}::createWrapper(element, creationContext, isolate); 1448 } 1449 } 1450 END 1451 ; 1452 } 1247 ; 1453 1248 1454 1249 print F "#endif // $parameters{guardFactoryWith}\n\n" if $parameters{guardFactoryWith}; 1455 1250 1456 print F "#endif // $wrapperFactoryType$parameters{namespace}ElementWrapperFactory_h\n";1251 print F "#endif // JS$parameters{namespace}ElementWrapperFactory_h\n"; 1457 1252 1458 1253 close F; -
trunk/Source/WebCore/inspector/InjectedScriptCanvasModuleSource.js
r144427 r148505 207 207 StackTrace.create = function(stackTraceLimit, topMostFunctionToIgnore) 208 208 { 209 if (typeof Error.captureStackTrace === "function")210 return new StackTraceV8(stackTraceLimit, topMostFunctionToIgnore || arguments.callee);211 209 // FIXME: Support JSC, and maybe other browsers. 212 210 return null; 213 }214 215 /**216 * @constructor217 * @implements {StackTrace}218 * @param {number=} stackTraceLimit219 * @param {Function=} topMostFunctionToIgnore220 * @see http://code.google.com/p/v8/wiki/JavaScriptStackTraceApi221 */222 function StackTraceV8(stackTraceLimit, topMostFunctionToIgnore)223 {224 StackTrace.call(this);225 226 var oldPrepareStackTrace = Error.prepareStackTrace;227 var oldStackTraceLimit = Error.stackTraceLimit;228 if (typeof stackTraceLimit === "number")229 Error.stackTraceLimit = stackTraceLimit;230 231 /**232 * @param {Object} error233 * @param {Array.<CallSite>} structuredStackTrace234 * @return {Array.<{sourceURL: string, lineNumber: number, columnNumber: number}>}235 */236 Error.prepareStackTrace = function(error, structuredStackTrace)237 {238 return structuredStackTrace.map(function(callSite) {239 return {240 sourceURL: callSite.getFileName(),241 lineNumber: callSite.getLineNumber(),242 columnNumber: callSite.getColumnNumber()243 };244 });245 }246 247 var holder = /** @type {{stack: Array.<{sourceURL: string, lineNumber: number, columnNumber: number}>}} */ ({});248 Error.captureStackTrace(holder, topMostFunctionToIgnore || arguments.callee);249 this._stackTrace = holder.stack;250 251 Error.stackTraceLimit = oldStackTraceLimit;252 Error.prepareStackTrace = oldPrepareStackTrace;253 }254 255 StackTraceV8.prototype = {256 /**257 * @override258 * @param {number} index259 * @return {{sourceURL: string, lineNumber: number, columnNumber: number}|undefined}260 */261 callFrame: function(index)262 {263 return this._stackTrace[index];264 },265 266 __proto__: StackTrace.prototype267 211 } 268 212 … … 2275 2219 "textBaseline", 2276 2220 "lineDashOffset", 2277 // FIXME: Temporary properties implemented in JSC, but not in V8.2278 2221 "webkitLineDash", 2279 2222 "webkitLineDashOffset" -
trunk/Source/WebCore/platform/qt/PlatformSupport.h
r127757 r148505 32 32 #include <wtf/text/WTFString.h> 33 33 34 // V8 bindings use the ARRAYSIZE_UNSAFE macro. This macro was copied35 // from http://src.chromium.org/viewvc/chrome/trunk/src/base/basictypes.h36 //37 // ARRAYSIZE_UNSAFE performs essentially the same calculation as arraysize,38 // but can be used on anonymous types or types defined inside39 // functions. It's less safe than arraysize as it accepts some40 // (although not all) pointers. Therefore, you should use arraysize41 // whenever possible.42 //43 // The expression ARRAYSIZE_UNSAFE(a) is a compile-time constant of type44 // size_t.45 //46 // ARRAYSIZE_UNSAFE catches a few type errors. If you see a compiler error47 //48 // "warning: division by zero in ..."49 //50 // when using ARRAYSIZE_UNSAFE, you are (wrongfully) giving it a pointer.51 // You should only use ARRAYSIZE_UNSAFE on statically allocated arrays.52 //53 // The following comments are on the implementation details, and can54 // be ignored by the users.55 //56 // ARRAYSIZE_UNSAFE(arr) works by inspecting sizeof(arr) (the # of bytes in57 // the array) and sizeof(*(arr)) (the # of bytes in one array58 // element). If the former is divisible by the latter, perhaps arr is59 // indeed an array, in which case the division result is the # of60 // elements in the array. Otherwise, arr cannot possibly be an array,61 // and we generate a compiler error to prevent the code from62 // compiling.63 //64 // Since the size of bool is implementation-defined, we need to cast65 // !(sizeof(a) & sizeof(*(a))) to size_t in order to ensure the final66 // result has type size_t.67 //68 // This macro is not perfect as it wrongfully accepts certain69 // pointers, namely where the pointer size is divisible by the pointee70 // size. Since all our code has to go through a 32-bit compiler,71 // where a pointer is 4 bytes, this means all pointers to a type whose72 // size is 3 or greater than 4 will be (righteously) rejected.73 74 #define ARRAYSIZE_UNSAFE(a) \75 ((sizeof(a) / sizeof(*(a))) / \76 static_cast<size_t>(!(sizeof(a) % sizeof(*(a)))))77 78 79 34 typedef struct NPObject NPObject; 80 35 typedef struct _NPP NPP_t; -
trunk/Source/WebCore/svg/SVGZoomAndPan.h
r135069 r148505 78 78 SVGZoomAndPanType zoomAndPan() const { return SVGZoomAndPanUnknown; } 79 79 80 // These methods only exist to allow us to compile V8/JSSVGZoomAndPan.*.80 // These methods only exist to allow us to compile JSSVGZoomAndPan.*. 81 81 // These are never called, and thus ASSERT_NOT_REACHED. 82 82 void ref();
Note: See TracChangeset
for help on using the changeset viewer.