summaryrefslogtreecommitdiff
path: root/lib/module.js
diff options
context:
space:
mode:
authorBrian White <mscdex@mscdex.net>2017-01-13 05:16:46 -0500
committerBrian White <mscdex@mscdex.net>2017-03-10 23:48:46 -0500
commit28dc848e702b70f8c07941a1dfd46227f90c8267 (patch)
tree47bc7eb117ae78a8cfab296b1252870eb3aa0d3e /lib/module.js
parent403b89e72b6367934ca3c36d389ce0f3214ffbf5 (diff)
downloadandroid-node-v8-28dc848e702b70f8c07941a1dfd46227f90c8267.tar.gz
android-node-v8-28dc848e702b70f8c07941a1dfd46227f90c8267.tar.bz2
android-node-v8-28dc848e702b70f8c07941a1dfd46227f90c8267.zip
lib: improve method of function calling
Using a more "direct" method of function calling yields better performance. PR-URL: https://github.com/nodejs/node/pull/10789 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Diffstat (limited to 'lib/module.js')
-rw-r--r--lib/module.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/module.js b/lib/module.js
index 8916b3b36c..1b9c2413b7 100644
--- a/lib/module.js
+++ b/lib/module.js
@@ -577,11 +577,11 @@ Module.prototype._compile = function(content, filename) {
}
}
var dirname = path.dirname(filename);
- var require = internalModule.makeRequireFunction.call(this);
- var args = [this.exports, require, this, filename, dirname];
+ var require = internalModule.makeRequireFunction(this);
var depth = internalModule.requireDepth;
if (depth === 0) stat.cache = new Map();
- var result = compiledWrapper.apply(this.exports, args);
+ var result = compiledWrapper.call(this.exports, this.exports, require, this,
+ filename, dirname);
if (depth === 0) stat.cache = null;
return result;
};