Skip to content
This repository was archived by the owner on Oct 15, 2020. It is now read-only.

Commit 86c1bc3

Browse files
committed
meta: merge node/master into node-chakracore/master
Merge b5d4153 as of 2017-12-22 This commit was automatically generated. For any problems, please contact jackhorton Reviewed-By: Taylor Woll <tawoll@ntdev.microsoft.com>
2 parents 7c2d058 + b5d4153 commit 86c1bc3

20 files changed

+135
-71
lines changed

deps/chakrashim/include/v8-version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define V8_MAJOR_VERSION 6
1212
#define V8_MINOR_VERSION 3
1313
#define V8_BUILD_NUMBER 292
14-
#define V8_PATCH_LEVEL 46
14+
#define V8_PATCH_LEVEL 48
1515

1616
// Use 1 for candidates and 0 otherwise.
1717
// (Boolean macro values are not supported by all preprocessors.)

deps/v8/include/v8-version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define V8_MAJOR_VERSION 6
1212
#define V8_MINOR_VERSION 3
1313
#define V8_BUILD_NUMBER 292
14-
#define V8_PATCH_LEVEL 46
14+
#define V8_PATCH_LEVEL 48
1515

1616
// Use 1 for candidates and 0 otherwise.
1717
// (Boolean macro values are not supported by all preprocessors.)

deps/v8/src/builtins/builtins-typedarray-gen.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ void TypedArrayBuiltinsAssembler::SetTypedArraySource(
799799
// means we're safe from overflows in the following multiplication.
800800
TNode<IntPtrT> source_byte_length = IntPtrMul(source_length, source_el_size);
801801
CSA_ASSERT(this,
802-
IntPtrGreaterThanOrEqual(source_byte_length, IntPtrConstant(0)));
802+
UintPtrGreaterThanOrEqual(source_byte_length, IntPtrConstant(0)));
803803

804804
Label call_memmove(this), fast_c_call(this), out(this);
805805
Branch(Word32Equal(source_el_kind, target_el_kind), &call_memmove,
@@ -821,17 +821,17 @@ void TypedArrayBuiltinsAssembler::SetTypedArraySource(
821821

822822
TNode<IntPtrT> target_byte_length =
823823
IntPtrMul(target_length, target_el_size);
824-
CSA_ASSERT(this,
825-
IntPtrGreaterThanOrEqual(target_byte_length, IntPtrConstant(0)));
824+
CSA_ASSERT(
825+
this, UintPtrGreaterThanOrEqual(target_byte_length, IntPtrConstant(0)));
826826

827827
TNode<IntPtrT> target_data_end_ptr =
828828
IntPtrAdd(target_data_ptr, target_byte_length);
829829
TNode<IntPtrT> source_data_end_ptr =
830830
IntPtrAdd(source_data_ptr, source_byte_length);
831831

832832
GotoIfNot(
833-
Word32Or(IntPtrLessThanOrEqual(target_data_end_ptr, source_data_ptr),
834-
IntPtrLessThanOrEqual(source_data_end_ptr, target_data_ptr)),
833+
Word32Or(UintPtrLessThanOrEqual(target_data_end_ptr, source_data_ptr),
834+
UintPtrLessThanOrEqual(source_data_end_ptr, target_data_ptr)),
835835
call_runtime);
836836

837837
TNode<IntPtrT> source_length =

deps/v8/src/debug/debug-coverage.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -544,9 +544,6 @@ void Coverage::SelectMode(Isolate* isolate, debug::Coverage::Mode mode) {
544544
if (!shared->IsSubjectToDebugging()) continue;
545545
vector->clear_invocation_count();
546546
vectors.emplace_back(vector, isolate);
547-
} else if (current_obj->IsJSFunction()) {
548-
JSFunction* function = JSFunction::cast(current_obj);
549-
function->set_code(function->shared()->code());
550547
}
551548
}
552549
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Copyright 2017 the V8 project authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
// Flags: --allow-natives-syntax
6+
7+
function f() {
8+
function g(arg) { return arg; }
9+
// The closure contains a call IC slot.
10+
return function() { return g(42); };
11+
}
12+
13+
const a = Realm.create();
14+
const b = Realm.create();
15+
16+
// Create two closures in different contexts sharing the same
17+
// SharedFunctionInfo (shared due to code caching).
18+
const x = Realm.eval(a, f.toString() + " f()");
19+
const y = Realm.eval(b, f.toString() + " f()");
20+
21+
// Run the first closure to create SFI::code.
22+
x();
23+
24+
// At this point, SFI::code is set and `x` has a feedback vector (`y` does not).
25+
26+
// Enabling block code coverage deoptimizes all functions and triggers the
27+
// buggy code path in which we'd unconditionally replace JSFunction::code with
28+
// its SFI::code (but skip feedback vector setup).
29+
%DebugToggleBlockCoverage(true);
30+
31+
// Still no feedback vector set on `y` but it now contains code. Run it to
32+
// trigger the crash when attempting to write into the non-existent feedback
33+
// vector.
34+
y();

doc/api/modules.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -841,11 +841,19 @@ added: v9.3.0
841841
A list of the names of all modules provided by Node.js. Can be used to verify
842842
if a module is maintained by a third-party module or not.
843843

844+
Note that `module` in this context isn't the same object that's provided
845+
by the [module wrapper][]. To access it, require the `Module` module:
846+
847+
```js
848+
const builtin = require('module').builtinModules;
849+
```
850+
844851
[`__dirname`]: #modules_dirname
845852
[`__filename`]: #modules_filename
846853
[`Error`]: errors.html#errors_class_error
847854
[`module` object]: #modules_the_module_object
848855
[`path.dirname()`]: path.html#path_path_dirname_path
849856
[exports shortcut]: #modules_exports_shortcut
850857
[module resolution]: #modules_all_together
858+
[module wrapper]: #modules_the_module_wrapper
851859
[native addons]: addons.html

lib/_tls_legacy.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,8 @@ function onhandshakestart() {
632632
// state machine and OpenSSL is not re-entrant. We cannot allow the user's
633633
// callback to destroy the connection right now, it would crash and burn.
634634
setImmediate(function() {
635+
// Old-style error is not being migrated to the newer style
636+
// internal/errors.js because _tls_legacy.js has been deprecated.
635637
var err = new Error('TLS session renegotiation attack detected');
636638
if (self.cleartext) self.cleartext.emit('error', err);
637639
});

lib/internal/wrap_js_stream.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ class JSStreamWrap extends Socket {
136136
if (!self._dequeue(item))
137137
return;
138138

139-
handle.doAfterWrite(req);
140139
handle.finishWrite(req, errCode);
141140
});
142141
}
@@ -196,7 +195,6 @@ class JSStreamWrap extends Socket {
196195

197196
const errCode = uv.UV_ECANCELED;
198197
if (item.type === 'write') {
199-
handle.doAfterWrite(req);
200198
handle.finishWrite(req, errCode);
201199
} else if (item.type === 'shutdown') {
202200
handle.finishShutdown(req, errCode);

src/js_stream.cc

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -169,17 +169,6 @@ void JSStream::New(const FunctionCallbackInfo<Value>& args) {
169169
}
170170

171171

172-
void JSStream::DoAfterWrite(const FunctionCallbackInfo<Value>& args) {
173-
JSStream* wrap;
174-
CHECK(args[0]->IsObject());
175-
WriteWrap* w;
176-
ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());
177-
ASSIGN_OR_RETURN_UNWRAP(&w, args[0].As<Object>());
178-
179-
w->Done(0);
180-
}
181-
182-
183172
template <class Wrap>
184173
void JSStream::Finish(const FunctionCallbackInfo<Value>& args) {
185174
Wrap* w;
@@ -235,7 +224,6 @@ void JSStream::Initialize(Local<Object> target,
235224

236225
AsyncWrap::AddWrapMethods(env, t);
237226

238-
env->SetProtoMethod(t, "doAfterWrite", DoAfterWrite);
239227
env->SetProtoMethod(t, "finishWrite", Finish<WriteWrap>);
240228
env->SetProtoMethod(t, "finishShutdown", Finish<ShutdownWrap>);
241229
env->SetProtoMethod(t, "readBuffer", ReadBuffer);

src/js_stream.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ class JSStream : public AsyncWrap, public StreamBase {
3737
AsyncWrap* GetAsyncWrap() override;
3838

3939
static void New(const v8::FunctionCallbackInfo<v8::Value>& args);
40-
static void DoAfterWrite(const v8::FunctionCallbackInfo<v8::Value>& args);
4140
static void ReadBuffer(const v8::FunctionCallbackInfo<v8::Value>& args);
4241
static void EmitEOF(const v8::FunctionCallbackInfo<v8::Value>& args);
4342

0 commit comments

Comments
 (0)