Skip to content

Commit

Permalink
deps: patch V8 to 6.3.292.48
Browse files Browse the repository at this point in the history
Refs: v8/v8@6.3.292.46...6.3.292.48
PR-URL: #17773
Reviewed-By: Michaël Zasso <targos@protonmail.com>
  • Loading branch information
MylesBorins committed Dec 22, 2017
1 parent 1a396bb commit b5d4153
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 9 deletions.
2 changes: 1 addition & 1 deletion deps/v8/include/v8-version.h
Expand Up @@ -11,7 +11,7 @@
#define V8_MAJOR_VERSION 6
#define V8_MINOR_VERSION 3
#define V8_BUILD_NUMBER 292
#define V8_PATCH_LEVEL 46
#define V8_PATCH_LEVEL 48

// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
Expand Down
10 changes: 5 additions & 5 deletions deps/v8/src/builtins/builtins-typedarray-gen.cc
Expand Up @@ -799,7 +799,7 @@ void TypedArrayBuiltinsAssembler::SetTypedArraySource(
// means we're safe from overflows in the following multiplication.
TNode<IntPtrT> source_byte_length = IntPtrMul(source_length, source_el_size);
CSA_ASSERT(this,
IntPtrGreaterThanOrEqual(source_byte_length, IntPtrConstant(0)));
UintPtrGreaterThanOrEqual(source_byte_length, IntPtrConstant(0)));

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

TNode<IntPtrT> target_byte_length =
IntPtrMul(target_length, target_el_size);
CSA_ASSERT(this,
IntPtrGreaterThanOrEqual(target_byte_length, IntPtrConstant(0)));
CSA_ASSERT(
this, UintPtrGreaterThanOrEqual(target_byte_length, IntPtrConstant(0)));

TNode<IntPtrT> target_data_end_ptr =
IntPtrAdd(target_data_ptr, target_byte_length);
TNode<IntPtrT> source_data_end_ptr =
IntPtrAdd(source_data_ptr, source_byte_length);

GotoIfNot(
Word32Or(IntPtrLessThanOrEqual(target_data_end_ptr, source_data_ptr),
IntPtrLessThanOrEqual(source_data_end_ptr, target_data_ptr)),
Word32Or(UintPtrLessThanOrEqual(target_data_end_ptr, source_data_ptr),
UintPtrLessThanOrEqual(source_data_end_ptr, target_data_ptr)),
call_runtime);

TNode<IntPtrT> source_length =
Expand Down
3 changes: 0 additions & 3 deletions deps/v8/src/debug/debug-coverage.cc
Expand Up @@ -544,9 +544,6 @@ void Coverage::SelectMode(Isolate* isolate, debug::Coverage::Mode mode) {
if (!shared->IsSubjectToDebugging()) continue;
vector->clear_invocation_count();
vectors.emplace_back(vector, isolate);
} else if (current_obj->IsJSFunction()) {
JSFunction* function = JSFunction::cast(current_obj);
function->set_code(function->shared()->code());
}
}
}
Expand Down
34 changes: 34 additions & 0 deletions deps/v8/test/mjsunit/regress/regress-786784.js
@@ -0,0 +1,34 @@
// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Flags: --allow-natives-syntax

function f() {
function g(arg) { return arg; }
// The closure contains a call IC slot.
return function() { return g(42); };
}

const a = Realm.create();
const b = Realm.create();

// Create two closures in different contexts sharing the same
// SharedFunctionInfo (shared due to code caching).
const x = Realm.eval(a, f.toString() + " f()");
const y = Realm.eval(b, f.toString() + " f()");

// Run the first closure to create SFI::code.
x();

// At this point, SFI::code is set and `x` has a feedback vector (`y` does not).

// Enabling block code coverage deoptimizes all functions and triggers the
// buggy code path in which we'd unconditionally replace JSFunction::code with
// its SFI::code (but skip feedback vector setup).
%DebugToggleBlockCoverage(true);

// Still no feedback vector set on `y` but it now contains code. Run it to
// trigger the crash when attempting to write into the non-existent feedback
// vector.
y();

0 comments on commit b5d4153

Please sign in to comment.