diff options
author | Fedor Indutny <fedor@indutny.com> | 2015-03-09 10:50:29 -0400 |
---|---|---|
committer | Fedor Indutny <fedor@indutny.com> | 2015-03-09 14:48:21 -0400 |
commit | 8431fc53f10b3347223fb13523831e38e0ce8015 (patch) | |
tree | 3dc51a2ff296f0cfd10276fd4b1d222bad864dcf /src/tls_wrap.cc | |
parent | 8070b1ff9943a53d520bf47ca1dd541f56a3c830 (diff) | |
download | android-node-v8-8431fc53f10b3347223fb13523831e38e0ce8015.tar.gz android-node-v8-8431fc53f10b3347223fb13523831e38e0ce8015.tar.bz2 android-node-v8-8431fc53f10b3347223fb13523831e38e0ce8015.zip |
tls_wrap: proxy handle methods in prototype
Set proxied methods wrappers in `TLSWrap` prototype instead of doing it
on every socket allocation. Should speed up things a bit and will
certainly make heapsnapshot less verbose.
PR-URL: https://github.com/iojs/io.js/pull/1108
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Diffstat (limited to 'src/tls_wrap.cc')
-rw-r--r-- | src/tls_wrap.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/tls_wrap.cc b/src/tls_wrap.cc index 8ecf33a75a..49523bc3b8 100644 --- a/src/tls_wrap.cc +++ b/src/tls_wrap.cc @@ -809,8 +809,8 @@ int TLSWrap::SelectSNIContextCallback(SSL* s, int* ad, void* arg) { void TLSWrap::Initialize(Handle<Object> target, - Handle<Value> unused, - Handle<Context> context) { + Handle<Value> unused, + Handle<Context> context) { Environment* env = Environment::GetCurrent(context); env->SetMethod(target, "wrap", TLSWrap::Wrap); @@ -835,6 +835,9 @@ void TLSWrap::Initialize(Handle<Object> target, env->set_tls_wrap_constructor_template(t); env->set_tls_wrap_constructor_function(t->GetFunction()); + + target->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "TLSWrap"), + t->GetFunction()); } } // namespace node |