diff options
author | Grace Kloba <klobag@google.com> | 2009-06-29 18:09:35 -0700 |
---|---|---|
committer | Grace Kloba <klobag@google.com> | 2009-06-29 18:09:35 -0700 |
commit | 0519c65e2884fdc6cbfd79c108c2941de60c8fc8 (patch) | |
tree | 31d7b7c469ebf42b5ab15ea3cccd93cff78d33dd | |
parent | 2ac011692daa197e15a21460f3c8d0e7dec53b0a (diff) | |
parent | dac9d5be4c497a51b6e083bc9b232977d8e195c1 (diff) | |
download | external_webkit-0519c65e2884fdc6cbfd79c108c2941de60c8fc8.zip external_webkit-0519c65e2884fdc6cbfd79c108c2941de60c8fc8.tar.gz external_webkit-0519c65e2884fdc6cbfd79c108c2941de60c8fc8.tar.bz2 |
resolved conflicts for merge of dac9d5be to master
-rw-r--r-- | JavaScriptCore/parser/Parser.cpp | 10 | ||||
-rw-r--r-- | WebCore/css/CSSParser.cpp | 58 | ||||
-rw-r--r-- | WebCore/css/CSSStyleSheet.cpp | 10 | ||||
-rw-r--r-- | WebKit/android/TimeCounter.cpp | 1 | ||||
-rw-r--r-- | WebKit/android/TimeCounter.h | 3 |
5 files changed, 71 insertions, 11 deletions
diff --git a/JavaScriptCore/parser/Parser.cpp b/JavaScriptCore/parser/Parser.cpp index 96f4ae6..da47ab2 100644 --- a/JavaScriptCore/parser/Parser.cpp +++ b/JavaScriptCore/parser/Parser.cpp @@ -35,10 +35,17 @@ using std::auto_ptr; extern int jscyyparse(void*); #endif +#ifdef ANDROID_INSTRUMENT +#include "TimeCounter.h" +#endif + namespace JSC { void Parser::parse(JSGlobalData* globalData, int* errLine, UString* errMsg) { +#ifdef ANDROID_INSTRUMENT + android::TimeCounter::start(android::TimeCounter::JavaScriptParseTimeCounter); +#endif m_sourceElements = 0; int defaultErrLine; @@ -65,6 +72,9 @@ void Parser::parse(JSGlobalData* globalData, int* errLine, UString* errMsg) *errMsg = "Parse error"; m_sourceElements = 0; } +#ifdef ANDROID_INSTRUMENT + android::TimeCounter::record(android::TimeCounter::JavaScriptParseTimeCounter, __FUNCTION__); +#endif } void Parser::reparseInPlace(JSGlobalData* globalData, FunctionBodyNode* functionBodyNode) diff --git a/WebCore/css/CSSParser.cpp b/WebCore/css/CSSParser.cpp index d9f0a30..75f62c5 100644 --- a/WebCore/css/CSSParser.cpp +++ b/WebCore/css/CSSParser.cpp @@ -88,6 +88,10 @@ using namespace WTF; #include "CSSPropertyNames.cpp" #include "CSSValueKeywords.c" +#ifdef ANDROID_INSTRUMENT +#include "TimeCounter.h" +#endif + namespace WebCore { static bool equal(const CSSParserString& a, const char* b) @@ -217,32 +221,53 @@ void CSSParser::setupParser(const char* prefix, const String& string, const char void CSSParser::parseSheet(CSSStyleSheet* sheet, const String& string) { +#ifdef ANDROID_INSTRUMENT + android::TimeCounter::start(android::TimeCounter::CSSParseTimeCounter); +#endif m_styleSheet = sheet; m_defaultNamespace = starAtom; // Reset the default namespace. setupParser("", string, ""); cssyyparse(this); m_rule = 0; +#ifdef ANDROID_INSTRUMENT + android::TimeCounter::record(android::TimeCounter::CSSParseTimeCounter, __FUNCTION__); +#endif } PassRefPtr<CSSRule> CSSParser::parseRule(CSSStyleSheet* sheet, const String& string) { +#ifdef ANDROID_INSTRUMENT + android::TimeCounter::start(android::TimeCounter::CSSParseTimeCounter); +#endif m_styleSheet = sheet; setupParser("@-webkit-rule{", string, "} "); cssyyparse(this); +#ifdef ANDROID_INSTRUMENT + android::TimeCounter::record(android::TimeCounter::CSSParseTimeCounter, __FUNCTION__); +#endif return m_rule.release(); } PassRefPtr<CSSRule> CSSParser::parseKeyframeRule(CSSStyleSheet *sheet, const String &string) { +#ifdef ANDROID_INSTRUMENT + android::TimeCounter::start(android::TimeCounter::CSSParseTimeCounter); +#endif m_styleSheet = sheet; setupParser("@-webkit-keyframe-rule{ ", string, "} "); cssyyparse(this); +#ifdef ANDROID_INSTRUMENT + android::TimeCounter::record(android::TimeCounter::CSSParseTimeCounter, __FUNCTION__); +#endif return m_keyframe.release(); } bool CSSParser::parseValue(CSSMutableStyleDeclaration* declaration, int id, const String& string, bool important) { +#ifdef ANDROID_INSTRUMENT + android::TimeCounter::start(android::TimeCounter::CSSParseTimeCounter); +#endif ASSERT(!declaration->stylesheet() || declaration->stylesheet()->isCSSStyleSheet()); m_styleSheet = static_cast<CSSStyleSheet*>(declaration->stylesheet()); @@ -264,6 +289,9 @@ bool CSSParser::parseValue(CSSMutableStyleDeclaration* declaration, int id, cons clearProperties(); } +#ifdef ANDROID_INSTRUMENT + android::TimeCounter::record(android::TimeCounter::CSSParseTimeCounter, __FUNCTION__); +#endif return ok; } @@ -294,6 +322,9 @@ bool CSSParser::parseColor(RGBA32& color, const String& string, bool strict) bool CSSParser::parseColor(CSSMutableStyleDeclaration* declaration, const String& string) { +#ifdef ANDROID_INSTRUMENT + android::TimeCounter::start(android::TimeCounter::CSSParseTimeCounter); +#endif ASSERT(!declaration->stylesheet() || declaration->stylesheet()->isCSSStyleSheet()); m_styleSheet = static_cast<CSSStyleSheet*>(declaration->stylesheet()); @@ -301,11 +332,17 @@ bool CSSParser::parseColor(CSSMutableStyleDeclaration* declaration, const String cssyyparse(this); m_rule = 0; +#ifdef ANDROID_INSTRUMENT + android::TimeCounter::record(android::TimeCounter::CSSParseTimeCounter, __FUNCTION__); +#endif return (m_numParsedProperties && m_parsedProperties[0]->m_id == CSSPropertyColor); } void CSSParser::parseSelector(const String& string, Document* doc, CSSSelectorList& selectorList) { +#ifdef ANDROID_INSTRUMENT + android::TimeCounter::start(android::TimeCounter::CSSParseTimeCounter); +#endif RefPtr<CSSStyleSheet> dummyStyleSheet = CSSStyleSheet::create(doc); m_styleSheet = dummyStyleSheet.get(); @@ -316,10 +353,16 @@ void CSSParser::parseSelector(const String& string, Document* doc, CSSSelectorLi cssyyparse(this); m_selectorListForParseSelector = 0; +#ifdef ANDROID_INSTRUMENT + android::TimeCounter::record(android::TimeCounter::CSSParseTimeCounter, __FUNCTION__); +#endif } bool CSSParser::parseDeclaration(CSSMutableStyleDeclaration* declaration, const String& string) { +#ifdef ANDROID_INSTRUMENT + android::TimeCounter::start(android::TimeCounter::CSSParseTimeCounter); +#endif ASSERT(!declaration->stylesheet() || declaration->stylesheet()->isCSSStyleSheet()); m_styleSheet = static_cast<CSSStyleSheet*>(declaration->stylesheet()); @@ -336,6 +379,9 @@ bool CSSParser::parseDeclaration(CSSMutableStyleDeclaration* declaration, const clearProperties(); } +#ifdef ANDROID_INSTRUMENT + android::TimeCounter::record(android::TimeCounter::CSSParseTimeCounter, __FUNCTION__); +#endif return ok; } @@ -344,6 +390,9 @@ bool CSSParser::parseMediaQuery(MediaList* queries, const String& string) if (string.isEmpty()) return true; +#ifdef ANDROID_INSTRUMENT + android::TimeCounter::start(android::TimeCounter::CSSParseTimeCounter); +#endif m_mediaQuery = 0; // can't use { because tokenizer state switches from mediaquery to initial state when it sees { token. // instead insert one " " (which is WHITESPACE in CSSGrammar.y) @@ -357,6 +406,9 @@ bool CSSParser::parseMediaQuery(MediaList* queries, const String& string) m_mediaQuery = 0; } +#ifdef ANDROID_INSTRUMENT + android::TimeCounter::record(android::TimeCounter::CSSParseTimeCounter, __FUNCTION__); +#endif return ok; } @@ -4774,6 +4826,9 @@ void CSSParser::clearVariables() bool CSSParser::parseVariable(CSSVariablesDeclaration* declaration, const String& variableName, const String& variableValue) { +#ifdef ANDROID_INSTRUMENT + android::TimeCounter::start(android::TimeCounter::CSSParseTimeCounter); +#endif m_styleSheet = static_cast<CSSStyleSheet*>(declaration->stylesheet()); String nameValuePair = variableName + ": "; @@ -4791,6 +4846,9 @@ bool CSSParser::parseVariable(CSSVariablesDeclaration* declaration, const String clearVariables(); +#ifdef ANDROID_INSTRUMENT + android::TimeCounter::record(android::TimeCounter::CSSParseTimeCounter, __FUNCTION__); +#endif return ok; } diff --git a/WebCore/css/CSSStyleSheet.cpp b/WebCore/css/CSSStyleSheet.cpp index 56305f3..ce50af6 100644 --- a/WebCore/css/CSSStyleSheet.cpp +++ b/WebCore/css/CSSStyleSheet.cpp @@ -31,10 +31,6 @@ #include "TextEncoding.h" #include <wtf/Deque.h> -#ifdef ANDROID_INSTRUMENT -#include "TimeCounter.h" -#endif - namespace WebCore { CSSStyleSheet::CSSStyleSheet(CSSStyleSheet* parentSheet, const String& href, const String& charset) @@ -163,15 +159,9 @@ const AtomicString& CSSStyleSheet::determineNamespace(const AtomicString& prefix bool CSSStyleSheet::parseString(const String &string, bool strict) { -#ifdef ANDROID_INSTRUMENT - android::TimeCounter::start(android::TimeCounter::CSSTimeCounter); -#endif setStrictParsing(strict); CSSParser p(strict); p.parseSheet(this, string); -#ifdef ANDROID_INSTRUMENT - android::TimeCounter::record(android::TimeCounter::CSSTimeCounter, __FUNCTION__); -#endif return true; } diff --git a/WebKit/android/TimeCounter.cpp b/WebKit/android/TimeCounter.cpp index f78d46f..9e8f432 100644 --- a/WebKit/android/TimeCounter.cpp +++ b/WebKit/android/TimeCounter.cpp @@ -67,6 +67,7 @@ uint32_t TimeCounter::sStartTime[TimeCounter::TotalTimeCounterCount]; static const char* timeCounterNames[] = { "css parsing", "javascript", + "javascript parsing", "calculate style", "Java callback (frame bridge)", "parsing (may include calcStyle or Java callback)", diff --git a/WebKit/android/TimeCounter.h b/WebKit/android/TimeCounter.h index f15deef..054141b 100644 --- a/WebKit/android/TimeCounter.h +++ b/WebKit/android/TimeCounter.h @@ -42,8 +42,9 @@ class TimeCounter { public: enum Type { // function base counters - CSSTimeCounter, + CSSParseTimeCounter, JavaScriptTimeCounter, + JavaScriptParseTimeCounter, CalculateStyleTimeCounter, JavaCallbackTimeCounter, ParsingTimeCounter, |