Merge "Remove erroneous log message." into honeycomb
This commit is contained in:
committed by
Android (Google) Code Review
commit
88c2d70564
@@ -471,45 +471,42 @@ void ScriptCState::runCompiler(Context *rsc,
|
|||||||
ScriptC *s,
|
ScriptC *s,
|
||||||
const char *resName,
|
const char *resName,
|
||||||
const char *cacheDir) {
|
const char *cacheDir) {
|
||||||
{
|
s->mBccScript = bccCreateScript();
|
||||||
s->mBccScript = bccCreateScript();
|
|
||||||
|
|
||||||
s->mEnviroment.mIsThreadable = true;
|
s->mEnviroment.mIsThreadable = true;
|
||||||
|
|
||||||
bccRegisterSymbolCallback(s->mBccScript, symbolLookup, s);
|
bccRegisterSymbolCallback(s->mBccScript, symbolLookup, s);
|
||||||
|
|
||||||
if (bccReadBC(s->mBccScript,
|
if (bccReadBC(s->mBccScript,
|
||||||
resName,
|
resName,
|
||||||
s->mEnviroment.mScriptText,
|
s->mEnviroment.mScriptText,
|
||||||
s->mEnviroment.mScriptTextLength, 0) != 0) {
|
s->mEnviroment.mScriptTextLength, 0) != 0) {
|
||||||
LOGE("bcc: FAILS to read bitcode");
|
LOGE("bcc: FAILS to read bitcode");
|
||||||
// Handle Fatal Error
|
// Handle Fatal Error
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
if (bccLinkBC(s->mBccScript,
|
if (bccLinkBC(s->mBccScript,
|
||||||
resName,
|
resName,
|
||||||
NULL /*rs_runtime_lib_bc*/,
|
NULL /*rs_runtime_lib_bc*/,
|
||||||
1 /*rs_runtime_lib_bc_size*/
|
1 /*rs_runtime_lib_bc_size*/
|
||||||
/*"1" means skip buffer here, and let libbcc decide*/,
|
/*"1" means skip buffer here, and let libbcc decide*/,
|
||||||
0) != 0) {
|
0) != 0) {
|
||||||
LOGE("bcc: FAILS to link bitcode");
|
LOGE("bcc: FAILS to link bitcode");
|
||||||
// Handle Fatal Error
|
// Handle Fatal Error
|
||||||
}
|
|
||||||
#endif
|
|
||||||
char *cachePath = genCacheFileName(cacheDir, resName, ".oBCC");
|
|
||||||
|
|
||||||
if (bccPrepareExecutable(s->mBccScript, cachePath, 0) != 0) {
|
|
||||||
LOGE("bcc: FAILS to prepare executable");
|
|
||||||
// Handle Fatal Error
|
|
||||||
}
|
|
||||||
|
|
||||||
free(cachePath);
|
|
||||||
|
|
||||||
s->mProgram.mRoot = reinterpret_cast<int (*)()>(bccGetFuncAddr(s->mBccScript, "root"));
|
|
||||||
s->mProgram.mInit = reinterpret_cast<void (*)()>(bccGetFuncAddr(s->mBccScript, "init"));
|
|
||||||
}
|
}
|
||||||
LOGV("%p ScriptCState::runCompiler root %p, init %p", rsc, s->mProgram.mRoot, s->mProgram.mInit);
|
#endif
|
||||||
|
char *cachePath = genCacheFileName(cacheDir, resName, ".oBCC");
|
||||||
|
|
||||||
|
if (bccPrepareExecutable(s->mBccScript, cachePath, 0) != 0) {
|
||||||
|
LOGE("bcc: FAILS to prepare executable");
|
||||||
|
// Handle Fatal Error
|
||||||
|
}
|
||||||
|
|
||||||
|
free(cachePath);
|
||||||
|
|
||||||
|
s->mProgram.mRoot = reinterpret_cast<int (*)()>(bccGetFuncAddr(s->mBccScript, "root"));
|
||||||
|
s->mProgram.mInit = reinterpret_cast<void (*)()>(bccGetFuncAddr(s->mBccScript, "init"));
|
||||||
|
|
||||||
if (s->mProgram.mInit) {
|
if (s->mProgram.mInit) {
|
||||||
s->mProgram.mInit();
|
s->mProgram.mInit();
|
||||||
@@ -537,66 +534,62 @@ void ScriptCState::runCompiler(Context *rsc,
|
|||||||
s->mEnviroment.mFragmentStore.set(rsc->getDefaultProgramStore());
|
s->mEnviroment.mFragmentStore.set(rsc->getDefaultProgramStore());
|
||||||
s->mEnviroment.mRaster.set(rsc->getDefaultProgramRaster());
|
s->mEnviroment.mRaster.set(rsc->getDefaultProgramRaster());
|
||||||
|
|
||||||
if (s->mProgram.mRoot) {
|
const static int pragmaMax = 16;
|
||||||
const static int pragmaMax = 16;
|
size_t pragmaCount = bccGetPragmaCount(s->mBccScript);
|
||||||
size_t pragmaCount = bccGetPragmaCount(s->mBccScript);
|
char const *keys[pragmaMax];
|
||||||
char const *keys[pragmaMax];
|
char const *values[pragmaMax];
|
||||||
char const *values[pragmaMax];
|
bccGetPragmaList(s->mBccScript, pragmaMax, keys, values);
|
||||||
bccGetPragmaList(s->mBccScript, pragmaMax, keys, values);
|
|
||||||
|
|
||||||
for (size_t i=0; i < pragmaCount; ++i) {
|
for (size_t i=0; i < pragmaCount; ++i) {
|
||||||
//LOGE("pragma %s %s", keys[i], values[i]);
|
//LOGE("pragma %s %s", keys[i], values[i]);
|
||||||
if (!strcmp(keys[i], "version")) {
|
if (!strcmp(keys[i], "version")) {
|
||||||
|
// TODO: Verify that version is correct
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!strcmp(keys[i], "stateVertex")) {
|
||||||
|
if (!strcmp(values[i], "default")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (!strcmp(values[i], "parent")) {
|
||||||
if (!strcmp(keys[i], "stateVertex")) {
|
s->mEnviroment.mVertex.clear();
|
||||||
if (!strcmp(values[i], "default")) {
|
continue;
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (!strcmp(values[i], "parent")) {
|
|
||||||
s->mEnviroment.mVertex.clear();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
LOGE("Unreconized value %s passed to stateVertex", values[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!strcmp(keys[i], "stateRaster")) {
|
|
||||||
if (!strcmp(values[i], "default")) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (!strcmp(values[i], "parent")) {
|
|
||||||
s->mEnviroment.mRaster.clear();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
LOGE("Unreconized value %s passed to stateRaster", values[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!strcmp(keys[i], "stateFragment")) {
|
|
||||||
if (!strcmp(values[i], "default")) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (!strcmp(values[i], "parent")) {
|
|
||||||
s->mEnviroment.mFragment.clear();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
LOGE("Unreconized value %s passed to stateFragment", values[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!strcmp(keys[i], "stateStore")) {
|
|
||||||
if (!strcmp(values[i], "default")) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (!strcmp(values[i], "parent")) {
|
|
||||||
s->mEnviroment.mFragmentStore.clear();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
LOGE("Unreconized value %s passed to stateStore", values[i]);
|
|
||||||
}
|
}
|
||||||
|
LOGE("Unreconized value %s passed to stateVertex", values[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!strcmp(keys[i], "stateRaster")) {
|
||||||
|
if (!strcmp(values[i], "default")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!strcmp(values[i], "parent")) {
|
||||||
|
s->mEnviroment.mRaster.clear();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
LOGE("Unreconized value %s passed to stateRaster", values[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!strcmp(keys[i], "stateFragment")) {
|
||||||
|
if (!strcmp(values[i], "default")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!strcmp(values[i], "parent")) {
|
||||||
|
s->mEnviroment.mFragment.clear();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
LOGE("Unreconized value %s passed to stateFragment", values[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!strcmp(keys[i], "stateStore")) {
|
||||||
|
if (!strcmp(values[i], "default")) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!strcmp(values[i], "parent")) {
|
||||||
|
s->mEnviroment.mFragmentStore.clear();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
LOGE("Unreconized value %s passed to stateStore", values[i]);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
LOGE("bcc: FAILS to prepare executable");
|
|
||||||
// Handle Fatal Error
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user