[ReactNative] Remove RCT_IMPORT_METHOD macro and generate lookup table dynamically

Summary:
@public

This removes the last piece of data that was still stored on the DATA section,
`RCT_IMPORT_METHOD`. JS calls now dynamically populate a lookup table simultaneously
on JS and Native, instead of creating  a mapping at load time.

Test Plan: Everything still runs, tests are green.
This commit is contained in:
Tadeu Zagallo
2015-06-15 13:01:39 -07:00
parent 86dc92d5ab
commit d3065fc2e7
8 changed files with 12 additions and 177 deletions

View File

@@ -305,10 +305,12 @@ var MessageQueueMixin = {
return guardReturn(this._callFunction, [moduleID, methodID, params], null, this);
},
_callFunction: function(moduleID, methodID, params) {
var moduleName = this._localModuleIDToModuleName[moduleID];
_callFunction: function(moduleName, methodName, params) {
if (isFinite(moduleName)) {
moduleName = this._localModuleIDToModuleName[moduleName];
methodName = this._localModuleNameToMethodIDToName[moduleName][methodName];
}
var methodName = this._localModuleNameToMethodIDToName[moduleName][methodID];
if (DEBUG_SPY_MODE) {
console.log(
'N->JS: ' + moduleName + '.' + methodName +