Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: patch V8 to 7.0.276.28 #23424

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deps/v8/include/v8-version.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.)
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/compiler/bytecode-graph-builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/compiler/bytecode-graph-builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion deps/v8/src/compiler/js-inlining.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
7 changes: 4 additions & 3 deletions deps/v8/src/compiler/js-operator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions deps/v8/src/compiler/js-operator.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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_);
}
Expand Down Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion deps/v8/src/compiler/pipeline.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/compiler/ppc/instruction-selector-ppc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
8 changes: 4 additions & 4 deletions deps/v8/src/objects/string-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

Expand All @@ -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();
}
}

Expand Down
7 changes: 2 additions & 5 deletions deps/v8/src/ppc/macro-assembler-ppc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
15 changes: 10 additions & 5 deletions deps/v8/src/profiler/cpu-profiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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();
Expand Down
58 changes: 58 additions & 0 deletions deps/v8/test/cctest/test-strings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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.
Expand Down