Changeset 202737 in webkit for trunk/Source/JavaScriptCore/tools/FunctionOverrides.cpp
- Timestamp:
- Jul 1, 2016, 9:38:11 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/tools/FunctionOverrides.cpp
r202242 r202737 1 1 /* 2 * Copyright (C) 2015 Apple Inc. All rights reserved.2 * Copyright (C) 2015-2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 105 105 } 106 106 107 void FunctionOverrides::reinstallOverrides() 108 { 109 FunctionOverrides& overrides = FunctionOverrides::overrides(); 110 const char* overridesFileName = Options::functionOverrides(); 111 overrides.clear(); 112 overrides.parseOverridesInFile(overridesFileName); 113 } 114 107 115 static void initializeOverrideInfo(const SourceCode& origCode, const String& newBody, FunctionOverrides::OverrideInfo& info) 108 116 { 109 117 String origProviderStr = origCode.provider()->source().toString(); 110 unsigned origBraceStart = origCode.startOffset(); 111 unsigned origFunctionStart = origProviderStr.reverseFind("function", origBraceStart); 118 unsigned origStart = origCode.startOffset(); 119 unsigned origFunctionStart = origProviderStr.reverseFind("function", origStart); 120 unsigned origBraceStart = origProviderStr.find("{", origStart); 112 121 unsigned headerLength = origBraceStart - origFunctionStart; 113 122 String origHeader = origProviderStr.substring(origFunctionStart, headerLength); … … 128 137 129 138 info.sourceCode = 130 SourceCode(WTFMove(newProvider), info. typeProfilingStartOffset, info.typeProfilingEndOffset + 1, 1, 1);139 SourceCode(WTFMove(newProvider), info.parametersStartOffset, info.typeProfilingEndOffset + 1, 1, 1); 131 140 } 132 141 … … 136 145 FunctionOverrides& overrides = FunctionOverrides::overrides(); 137 146 138 auto it = overrides.m_entries.find(origCode.view().toString()); 147 String sourceString = origCode.view().toString(); 148 size_t sourceBodyStart = sourceString.find('{'); 149 if (sourceBodyStart == notFound) 150 return false; 151 String sourceBodyString = sourceString.substring(sourceBodyStart); 152 153 auto it = overrides.m_entries.find(sourceBodyString); 139 154 if (it == overrides.m_entries.end()) 140 155 return false;
Note:
See TracChangeset
for help on using the changeset viewer.