mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
deps: patch V8 to 7.0.276.28
Refs: https://github.com/v8/v8/compare/7.0.276.25...7.0.276.28 PR-URL: https://github.com/nodejs/node/pull/23424 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yang Guo <yangguo@chromium.org> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
This commit is contained in:
1 parent
2f6b73745c
commit
e2258adff7
13 files changed
+96
-27
No files matched your search
Vendored
+1
-1
@@ -11,7 +11,7 @@
|
||||
#define V8_MAJOR_VERSION 7
|
||||
#define V8_MINOR_VERSION 0
|
||||
#define V8_BUILD_NUMBER 276
|
||||
#define V8_PATCH_LEVEL 25
|
||||
#define V8_PATCH_LEVEL 28
|
||||
|
||||
// Use 1 for candidates and 0 otherwise.
|
||||
// (Boolean macro values are not supported by all preprocessors.)
|
||||
|
||||
+1
-1
@@ -516,7 +516,7 @@ Node* BytecodeGraphBuilder::Environment::Checkpoint(
|
||||
BytecodeGraphBuilder::BytecodeGraphBuilder(
|
||||
Zone* local_zone, Handle<SharedFunctionInfo> shared_info,
|
||||
Handle<FeedbackVector> feedback_vector, BailoutId osr_offset,
|
||||
JSGraph* jsgraph, CallFrequency invocation_frequency,
|
||||
JSGraph* jsgraph, CallFrequency& invocation_frequency,
|
||||
SourcePositionTable* source_positions, Handle<Context> native_context,
|
||||
int inlining_id, JSTypeHintLowering::Flags flags, bool stack_check,
|
||||
bool analyze_environment_liveness)
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ class BytecodeGraphBuilder {
|
||||
BytecodeGraphBuilder(
|
||||
Zone* local_zone, Handle<SharedFunctionInfo> shared,
|
||||
Handle<FeedbackVector> feedback_vector, BailoutId osr_offset,
|
||||
JSGraph* jsgraph, CallFrequency invocation_frequency,
|
||||
JSGraph* jsgraph, CallFrequency& invocation_frequency,
|
||||
SourcePositionTable* source_positions, Handle<Context> native_context,
|
||||
int inlining_id = SourcePosition::kNotInlined,
|
||||
JSTypeHintLowering::Flags flags = JSTypeHintLowering::kNoFlags,
|
||||
|
||||
Vendored
+2
-1
@@ -485,9 +485,10 @@ Reduction JSInliner::ReduceJSCall(Node* node) {
|
||||
if (info_->is_bailout_on_uninitialized()) {
|
||||
flags |= JSTypeHintLowering::kBailoutOnUninitialized;
|
||||
}
|
||||
CallFrequency frequency = call.frequency();
|
||||
BytecodeGraphBuilder graph_builder(
|
||||
zone(), shared_info, feedback_vector, BailoutId::None(), jsgraph(),
|
||||
call.frequency(), source_positions_, native_context(), inlining_id,
|
||||
frequency, source_positions_, native_context(), inlining_id,
|
||||
flags, false, info_->is_analyze_environment_liveness());
|
||||
graph_builder.CreateGraph();
|
||||
|
||||
|
||||
Vendored
+4
-3
@@ -820,7 +820,8 @@ const Operator* JSOperatorBuilder::CallForwardVarargs(size_t arity,
|
||||
parameters); // parameter
|
||||
}
|
||||
|
||||
const Operator* JSOperatorBuilder::Call(size_t arity, CallFrequency frequency,
|
||||
const Operator* JSOperatorBuilder::Call(size_t arity,
|
||||
CallFrequency const& frequency,
|
||||
VectorSlotPair const& feedback,
|
||||
ConvertReceiverMode convert_mode,
|
||||
SpeculationMode speculation_mode) {
|
||||
@@ -844,8 +845,8 @@ const Operator* JSOperatorBuilder::CallWithArrayLike(CallFrequency frequency) {
|
||||
}
|
||||
|
||||
const Operator* JSOperatorBuilder::CallWithSpread(
|
||||
uint32_t arity, CallFrequency frequency, VectorSlotPair const& feedback,
|
||||
SpeculationMode speculation_mode) {
|
||||
uint32_t arity, CallFrequency const& frequency,
|
||||
VectorSlotPair const& feedback, SpeculationMode speculation_mode) {
|
||||
DCHECK_IMPLIES(speculation_mode == SpeculationMode::kAllowSpeculation,
|
||||
feedback.IsValid());
|
||||
CallParameters parameters(arity, frequency, feedback,
|
||||
|
||||
Vendored
+4
-4
@@ -160,7 +160,7 @@ CallForwardVarargsParameters const& CallForwardVarargsParametersOf(
|
||||
// used as a parameter by JSCall and JSCallWithSpread operators.
|
||||
class CallParameters final {
|
||||
public:
|
||||
CallParameters(size_t arity, CallFrequency frequency,
|
||||
CallParameters(size_t arity, CallFrequency const& frequency,
|
||||
VectorSlotPair const& feedback,
|
||||
ConvertReceiverMode convert_mode,
|
||||
SpeculationMode speculation_mode)
|
||||
@@ -171,7 +171,7 @@ class CallParameters final {
|
||||
feedback_(feedback) {}
|
||||
|
||||
size_t arity() const { return ArityField::decode(bit_field_); }
|
||||
CallFrequency frequency() const { return frequency_; }
|
||||
CallFrequency const& frequency() const { return frequency_; }
|
||||
ConvertReceiverMode convert_mode() const {
|
||||
return ConvertReceiverModeField::decode(bit_field_);
|
||||
}
|
||||
@@ -747,13 +747,13 @@ class V8_EXPORT_PRIVATE JSOperatorBuilder final
|
||||
|
||||
const Operator* CallForwardVarargs(size_t arity, uint32_t start_index);
|
||||
const Operator* Call(
|
||||
size_t arity, CallFrequency frequency = CallFrequency(),
|
||||
size_t arity, CallFrequency const& frequency = CallFrequency(),
|
||||
VectorSlotPair const& feedback = VectorSlotPair(),
|
||||
ConvertReceiverMode convert_mode = ConvertReceiverMode::kAny,
|
||||
SpeculationMode speculation_mode = SpeculationMode::kDisallowSpeculation);
|
||||
const Operator* CallWithArrayLike(CallFrequency frequency);
|
||||
const Operator* CallWithSpread(
|
||||
uint32_t arity, CallFrequency frequency = CallFrequency(),
|
||||
uint32_t arity, CallFrequency const& frequency = CallFrequency(),
|
||||
VectorSlotPair const& feedback = VectorSlotPair(),
|
||||
SpeculationMode speculation_mode = SpeculationMode::kDisallowSpeculation);
|
||||
const Operator* CallRuntime(Runtime::FunctionId id);
|
||||
|
||||
Vendored
+2
-1
@@ -1142,10 +1142,11 @@ struct GraphBuilderPhase {
|
||||
if (data->info()->is_bailout_on_uninitialized()) {
|
||||
flags |= JSTypeHintLowering::kBailoutOnUninitialized;
|
||||
}
|
||||
CallFrequency frequency = CallFrequency(1.0f);
|
||||
BytecodeGraphBuilder graph_builder(
|
||||
temp_zone, data->info()->shared_info(),
|
||||
handle(data->info()->closure()->feedback_vector(), data->isolate()),
|
||||
data->info()->osr_offset(), data->jsgraph(), CallFrequency(1.0f),
|
||||
data->info()->osr_offset(), data->jsgraph(), frequency,
|
||||
data->source_positions(), data->native_context(),
|
||||
SourcePosition::kNotInlined, flags, true,
|
||||
data->info()->is_analyze_environment_liveness());
|
||||
|
||||
+1
-1
@@ -941,7 +941,7 @@ void InstructionSelector::VisitWord64ReverseBytes(Node* node) {
|
||||
PPCOperandGenerator g(this);
|
||||
InstructionOperand temp[] = {g.TempRegister()};
|
||||
Emit(kPPC_ByteRev64, g.DefineAsRegister(node),
|
||||
g.UseRegister(node->InputAt(0)), 1, temp);
|
||||
g.UseUniqueRegister(node->InputAt(0)), 1, temp);
|
||||
}
|
||||
|
||||
void InstructionSelector::VisitWord32ReverseBytes(Node* node) {
|
||||
|
||||
Vendored
+4
-4
@@ -149,8 +149,8 @@ bool String::IsOneByteRepresentationUnderneath() {
|
||||
return true;
|
||||
case kTwoByteStringTag:
|
||||
return false;
|
||||
default: // Cons or sliced string. Need to go deeper.
|
||||
return GetUnderlying()->IsOneByteRepresentation();
|
||||
default: // Cons, sliced, thin, strings need to go deeper.
|
||||
return GetUnderlying()->IsOneByteRepresentationUnderneath();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,8 +164,8 @@ bool String::IsTwoByteRepresentationUnderneath() {
|
||||
return false;
|
||||
case kTwoByteStringTag:
|
||||
return true;
|
||||
default: // Cons or sliced string. Need to go deeper.
|
||||
return GetUnderlying()->IsTwoByteRepresentation();
|
||||
default: // Cons, sliced, thin, strings need to go deeper.
|
||||
return GetUnderlying()->IsTwoByteRepresentationUnderneath();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-5
@@ -1768,11 +1768,8 @@ void TurboAssembler::Abort(AbortReason reason) {
|
||||
// We don't care if we constructed a frame. Just pretend we did.
|
||||
FrameScope assume_frame(this, StackFrame::NONE);
|
||||
mov(r3, Operand(static_cast<int>(reason)));
|
||||
PrepareCallCFunction(1, 0, r4);
|
||||
Move(ip, ExternalReference::abort_with_reason());
|
||||
// Use Call directly to avoid any unneeded overhead. The function won't
|
||||
// return anyway.
|
||||
Call(ip);
|
||||
PrepareCallCFunction(1, r4);
|
||||
CallCFunction(ExternalReference::abort_with_reason(), 1);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Vendored
+10
-5
@@ -368,8 +368,11 @@ void CpuProfiler::StartProcessorIfNotStarted() {
|
||||
// Disable logging when using the new implementation.
|
||||
saved_is_logging_ = logger->is_logging_;
|
||||
logger->is_logging_ = false;
|
||||
|
||||
bool codemap_needs_initialization = false;
|
||||
if (!generator_) {
|
||||
generator_.reset(new ProfileGenerator(profiles_.get()));
|
||||
codemap_needs_initialization = true;
|
||||
CreateEntriesForRuntimeCallStats();
|
||||
}
|
||||
processor_.reset(new ProfilerEventsProcessor(isolate_, generator_.get(),
|
||||
@@ -382,12 +385,14 @@ void CpuProfiler::StartProcessorIfNotStarted() {
|
||||
isolate_->set_is_profiling(true);
|
||||
// Enumerate stuff we already have in the heap.
|
||||
DCHECK(isolate_->heap()->HasBeenSetUp());
|
||||
if (!FLAG_prof_browser_mode) {
|
||||
logger->LogCodeObjects();
|
||||
if (codemap_needs_initialization) {
|
||||
if (!FLAG_prof_browser_mode) {
|
||||
logger->LogCodeObjects();
|
||||
}
|
||||
logger->LogCompiledFunctions();
|
||||
logger->LogAccessorCallbacks();
|
||||
LogBuiltins();
|
||||
}
|
||||
logger->LogCompiledFunctions();
|
||||
logger->LogAccessorCallbacks();
|
||||
LogBuiltins();
|
||||
// Enable stack sampling.
|
||||
processor_->AddCurrentStack(isolate_);
|
||||
processor_->StartSynchronously();
|
||||
|
||||
Vendored
+58
@@ -1693,6 +1693,64 @@ TEST(StringEquals) {
|
||||
CHECK(!bar_str->StringEquals(foo_str2));
|
||||
}
|
||||
|
||||
class OneByteStringResource : public v8::String::ExternalOneByteStringResource {
|
||||
public:
|
||||
// Takes ownership of |data|.
|
||||
OneByteStringResource(char* data, size_t length)
|
||||
: data_(data), length_(length) {}
|
||||
~OneByteStringResource() override { delete[] data_; }
|
||||
const char* data() const override { return data_; }
|
||||
size_t length() const override { return length_; }
|
||||
|
||||
private:
|
||||
char* data_;
|
||||
size_t length_;
|
||||
};
|
||||
|
||||
TEST(Regress876759) {
|
||||
v8::V8::Initialize();
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
Factory* factory = isolate->factory();
|
||||
|
||||
HandleScope handle_scope(isolate);
|
||||
|
||||
const int kLength = 30;
|
||||
uc16 two_byte_buf[kLength];
|
||||
char* external_one_byte_buf = new char[kLength];
|
||||
for (int j = 0; j < kLength; j++) {
|
||||
char c = '0' + (j % 10);
|
||||
two_byte_buf[j] = c;
|
||||
external_one_byte_buf[j] = c;
|
||||
}
|
||||
|
||||
Handle<String> parent;
|
||||
{
|
||||
Handle<SeqTwoByteString> raw =
|
||||
factory->NewRawTwoByteString(kLength).ToHandleChecked();
|
||||
CopyChars(raw->GetChars(), two_byte_buf, kLength);
|
||||
parent = raw;
|
||||
}
|
||||
CHECK(parent->IsTwoByteRepresentation());
|
||||
Handle<String> sliced = factory->NewSubString(parent, 1, 20);
|
||||
CHECK(sliced->IsSlicedString());
|
||||
factory->InternalizeString(parent);
|
||||
CHECK(parent->IsThinString());
|
||||
Handle<String> grandparent =
|
||||
handle(ThinString::cast(*parent)->actual(), isolate);
|
||||
CHECK_EQ(*parent, SlicedString::cast(*sliced)->parent());
|
||||
OneByteStringResource* resource =
|
||||
new OneByteStringResource(external_one_byte_buf, kLength);
|
||||
grandparent->MakeExternal(resource);
|
||||
// The grandparent string becomes one-byte, but the child strings are still
|
||||
// two-byte.
|
||||
CHECK(grandparent->IsOneByteRepresentation());
|
||||
CHECK(parent->IsTwoByteRepresentation());
|
||||
CHECK(sliced->IsTwoByteRepresentation());
|
||||
// The *Underneath versions return the correct representation.
|
||||
CHECK(sliced->IsOneByteRepresentationUnderneath());
|
||||
CHECK(!sliced->IsTwoByteRepresentationUnderneath());
|
||||
}
|
||||
|
||||
} // namespace test_strings
|
||||
} // namespace internal
|
||||
} // namespace v8
|
||||
@@ -25,6 +25,9 @@ TEST_F(TurboAssemblerTest, TestHardAbort) {
|
||||
byte* buffer = AllocateAssemblerBuffer(&allocated);
|
||||
TurboAssembler tasm(nullptr, AssemblerOptions{}, buffer,
|
||||
static_cast<int>(allocated), CodeObjectRequired::kNo);
|
||||
// Called from C
|
||||
__ function_descriptor();
|
||||
|
||||
__ set_abort_hard(true);
|
||||
|
||||
__ Abort(AbortReason::kNoReason);
|
||||
@@ -43,6 +46,9 @@ TEST_F(TurboAssemblerTest, TestCheck) {
|
||||
byte* buffer = AllocateAssemblerBuffer(&allocated);
|
||||
TurboAssembler tasm(nullptr, AssemblerOptions{}, buffer,
|
||||
static_cast<int>(allocated), CodeObjectRequired::kNo);
|
||||
// Called from C
|
||||
__ function_descriptor();
|
||||
|
||||
__ set_abort_hard(true);
|
||||
|
||||
// Fail if the first parameter is 17.
|
||||
|
||||
Reference in new issue
Block a user