Skip to content

Commit e2258ad

Browse files
targosjasnell
authored andcommitted
deps: patch V8 to 7.0.276.28
Refs: v8/v8@7.0.276.25...7.0.276.28 PR-URL: #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>
1 parent 2f6b737 commit e2258ad

13 files changed

+96
-27
lines changed

deps/v8/include/v8-version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define V8_MAJOR_VERSION 7
1212
#define V8_MINOR_VERSION 0
1313
#define V8_BUILD_NUMBER 276
14-
#define V8_PATCH_LEVEL 25
14+
#define V8_PATCH_LEVEL 28
1515

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

deps/v8/src/compiler/bytecode-graph-builder.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ Node* BytecodeGraphBuilder::Environment::Checkpoint(
516516
BytecodeGraphBuilder::BytecodeGraphBuilder(
517517
Zone* local_zone, Handle<SharedFunctionInfo> shared_info,
518518
Handle<FeedbackVector> feedback_vector, BailoutId osr_offset,
519-
JSGraph* jsgraph, CallFrequency invocation_frequency,
519+
JSGraph* jsgraph, CallFrequency& invocation_frequency,
520520
SourcePositionTable* source_positions, Handle<Context> native_context,
521521
int inlining_id, JSTypeHintLowering::Flags flags, bool stack_check,
522522
bool analyze_environment_liveness)

deps/v8/src/compiler/bytecode-graph-builder.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class BytecodeGraphBuilder {
3131
BytecodeGraphBuilder(
3232
Zone* local_zone, Handle<SharedFunctionInfo> shared,
3333
Handle<FeedbackVector> feedback_vector, BailoutId osr_offset,
34-
JSGraph* jsgraph, CallFrequency invocation_frequency,
34+
JSGraph* jsgraph, CallFrequency& invocation_frequency,
3535
SourcePositionTable* source_positions, Handle<Context> native_context,
3636
int inlining_id = SourcePosition::kNotInlined,
3737
JSTypeHintLowering::Flags flags = JSTypeHintLowering::kNoFlags,

deps/v8/src/compiler/js-inlining.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -485,9 +485,10 @@ Reduction JSInliner::ReduceJSCall(Node* node) {
485485
if (info_->is_bailout_on_uninitialized()) {
486486
flags |= JSTypeHintLowering::kBailoutOnUninitialized;
487487
}
488+
CallFrequency frequency = call.frequency();
488489
BytecodeGraphBuilder graph_builder(
489490
zone(), shared_info, feedback_vector, BailoutId::None(), jsgraph(),
490-
call.frequency(), source_positions_, native_context(), inlining_id,
491+
frequency, source_positions_, native_context(), inlining_id,
491492
flags, false, info_->is_analyze_environment_liveness());
492493
graph_builder.CreateGraph();
493494

deps/v8/src/compiler/js-operator.cc

+4-3
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,8 @@ const Operator* JSOperatorBuilder::CallForwardVarargs(size_t arity,
820820
parameters); // parameter
821821
}
822822

823-
const Operator* JSOperatorBuilder::Call(size_t arity, CallFrequency frequency,
823+
const Operator* JSOperatorBuilder::Call(size_t arity,
824+
CallFrequency const& frequency,
824825
VectorSlotPair const& feedback,
825826
ConvertReceiverMode convert_mode,
826827
SpeculationMode speculation_mode) {
@@ -844,8 +845,8 @@ const Operator* JSOperatorBuilder::CallWithArrayLike(CallFrequency frequency) {
844845
}
845846

846847
const Operator* JSOperatorBuilder::CallWithSpread(
847-
uint32_t arity, CallFrequency frequency, VectorSlotPair const& feedback,
848-
SpeculationMode speculation_mode) {
848+
uint32_t arity, CallFrequency const& frequency,
849+
VectorSlotPair const& feedback, SpeculationMode speculation_mode) {
849850
DCHECK_IMPLIES(speculation_mode == SpeculationMode::kAllowSpeculation,
850851
feedback.IsValid());
851852
CallParameters parameters(arity, frequency, feedback,

deps/v8/src/compiler/js-operator.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ CallForwardVarargsParameters const& CallForwardVarargsParametersOf(
160160
// used as a parameter by JSCall and JSCallWithSpread operators.
161161
class CallParameters final {
162162
public:
163-
CallParameters(size_t arity, CallFrequency frequency,
163+
CallParameters(size_t arity, CallFrequency const& frequency,
164164
VectorSlotPair const& feedback,
165165
ConvertReceiverMode convert_mode,
166166
SpeculationMode speculation_mode)
@@ -171,7 +171,7 @@ class CallParameters final {
171171
feedback_(feedback) {}
172172

173173
size_t arity() const { return ArityField::decode(bit_field_); }
174-
CallFrequency frequency() const { return frequency_; }
174+
CallFrequency const& frequency() const { return frequency_; }
175175
ConvertReceiverMode convert_mode() const {
176176
return ConvertReceiverModeField::decode(bit_field_);
177177
}
@@ -747,13 +747,13 @@ class V8_EXPORT_PRIVATE JSOperatorBuilder final
747747

748748
const Operator* CallForwardVarargs(size_t arity, uint32_t start_index);
749749
const Operator* Call(
750-
size_t arity, CallFrequency frequency = CallFrequency(),
750+
size_t arity, CallFrequency const& frequency = CallFrequency(),
751751
VectorSlotPair const& feedback = VectorSlotPair(),
752752
ConvertReceiverMode convert_mode = ConvertReceiverMode::kAny,
753753
SpeculationMode speculation_mode = SpeculationMode::kDisallowSpeculation);
754754
const Operator* CallWithArrayLike(CallFrequency frequency);
755755
const Operator* CallWithSpread(
756-
uint32_t arity, CallFrequency frequency = CallFrequency(),
756+
uint32_t arity, CallFrequency const& frequency = CallFrequency(),
757757
VectorSlotPair const& feedback = VectorSlotPair(),
758758
SpeculationMode speculation_mode = SpeculationMode::kDisallowSpeculation);
759759
const Operator* CallRuntime(Runtime::FunctionId id);

deps/v8/src/compiler/pipeline.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -1142,10 +1142,11 @@ struct GraphBuilderPhase {
11421142
if (data->info()->is_bailout_on_uninitialized()) {
11431143
flags |= JSTypeHintLowering::kBailoutOnUninitialized;
11441144
}
1145+
CallFrequency frequency = CallFrequency(1.0f);
11451146
BytecodeGraphBuilder graph_builder(
11461147
temp_zone, data->info()->shared_info(),
11471148
handle(data->info()->closure()->feedback_vector(), data->isolate()),
1148-
data->info()->osr_offset(), data->jsgraph(), CallFrequency(1.0f),
1149+
data->info()->osr_offset(), data->jsgraph(), frequency,
11491150
data->source_positions(), data->native_context(),
11501151
SourcePosition::kNotInlined, flags, true,
11511152
data->info()->is_analyze_environment_liveness());

deps/v8/src/compiler/ppc/instruction-selector-ppc.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,7 @@ void InstructionSelector::VisitWord64ReverseBytes(Node* node) {
941941
PPCOperandGenerator g(this);
942942
InstructionOperand temp[] = {g.TempRegister()};
943943
Emit(kPPC_ByteRev64, g.DefineAsRegister(node),
944-
g.UseRegister(node->InputAt(0)), 1, temp);
944+
g.UseUniqueRegister(node->InputAt(0)), 1, temp);
945945
}
946946

947947
void InstructionSelector::VisitWord32ReverseBytes(Node* node) {

deps/v8/src/objects/string-inl.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ bool String::IsOneByteRepresentationUnderneath() {
149149
return true;
150150
case kTwoByteStringTag:
151151
return false;
152-
default: // Cons or sliced string. Need to go deeper.
153-
return GetUnderlying()->IsOneByteRepresentation();
152+
default: // Cons, sliced, thin, strings need to go deeper.
153+
return GetUnderlying()->IsOneByteRepresentationUnderneath();
154154
}
155155
}
156156

@@ -164,8 +164,8 @@ bool String::IsTwoByteRepresentationUnderneath() {
164164
return false;
165165
case kTwoByteStringTag:
166166
return true;
167-
default: // Cons or sliced string. Need to go deeper.
168-
return GetUnderlying()->IsTwoByteRepresentation();
167+
default: // Cons, sliced, thin, strings need to go deeper.
168+
return GetUnderlying()->IsTwoByteRepresentationUnderneath();
169169
}
170170
}
171171

deps/v8/src/ppc/macro-assembler-ppc.cc

+2-5
Original file line numberDiff line numberDiff line change
@@ -1768,11 +1768,8 @@ void TurboAssembler::Abort(AbortReason reason) {
17681768
// We don't care if we constructed a frame. Just pretend we did.
17691769
FrameScope assume_frame(this, StackFrame::NONE);
17701770
mov(r3, Operand(static_cast<int>(reason)));
1771-
PrepareCallCFunction(1, 0, r4);
1772-
Move(ip, ExternalReference::abort_with_reason());
1773-
// Use Call directly to avoid any unneeded overhead. The function won't
1774-
// return anyway.
1775-
Call(ip);
1771+
PrepareCallCFunction(1, r4);
1772+
CallCFunction(ExternalReference::abort_with_reason(), 1);
17761773
return;
17771774
}
17781775

deps/v8/src/profiler/cpu-profiler.cc

+10-5
Original file line numberDiff line numberDiff line change
@@ -368,8 +368,11 @@ void CpuProfiler::StartProcessorIfNotStarted() {
368368
// Disable logging when using the new implementation.
369369
saved_is_logging_ = logger->is_logging_;
370370
logger->is_logging_ = false;
371+
372+
bool codemap_needs_initialization = false;
371373
if (!generator_) {
372374
generator_.reset(new ProfileGenerator(profiles_.get()));
375+
codemap_needs_initialization = true;
373376
CreateEntriesForRuntimeCallStats();
374377
}
375378
processor_.reset(new ProfilerEventsProcessor(isolate_, generator_.get(),
@@ -382,12 +385,14 @@ void CpuProfiler::StartProcessorIfNotStarted() {
382385
isolate_->set_is_profiling(true);
383386
// Enumerate stuff we already have in the heap.
384387
DCHECK(isolate_->heap()->HasBeenSetUp());
385-
if (!FLAG_prof_browser_mode) {
386-
logger->LogCodeObjects();
388+
if (codemap_needs_initialization) {
389+
if (!FLAG_prof_browser_mode) {
390+
logger->LogCodeObjects();
391+
}
392+
logger->LogCompiledFunctions();
393+
logger->LogAccessorCallbacks();
394+
LogBuiltins();
387395
}
388-
logger->LogCompiledFunctions();
389-
logger->LogAccessorCallbacks();
390-
LogBuiltins();
391396
// Enable stack sampling.
392397
processor_->AddCurrentStack(isolate_);
393398
processor_->StartSynchronously();

deps/v8/test/cctest/test-strings.cc

+58
Original file line numberDiff line numberDiff line change
@@ -1693,6 +1693,64 @@ TEST(StringEquals) {
16931693
CHECK(!bar_str->StringEquals(foo_str2));
16941694
}
16951695

1696+
class OneByteStringResource : public v8::String::ExternalOneByteStringResource {
1697+
public:
1698+
// Takes ownership of |data|.
1699+
OneByteStringResource(char* data, size_t length)
1700+
: data_(data), length_(length) {}
1701+
~OneByteStringResource() override { delete[] data_; }
1702+
const char* data() const override { return data_; }
1703+
size_t length() const override { return length_; }
1704+
1705+
private:
1706+
char* data_;
1707+
size_t length_;
1708+
};
1709+
1710+
TEST(Regress876759) {
1711+
v8::V8::Initialize();
1712+
Isolate* isolate = CcTest::i_isolate();
1713+
Factory* factory = isolate->factory();
1714+
1715+
HandleScope handle_scope(isolate);
1716+
1717+
const int kLength = 30;
1718+
uc16 two_byte_buf[kLength];
1719+
char* external_one_byte_buf = new char[kLength];
1720+
for (int j = 0; j < kLength; j++) {
1721+
char c = '0' + (j % 10);
1722+
two_byte_buf[j] = c;
1723+
external_one_byte_buf[j] = c;
1724+
}
1725+
1726+
Handle<String> parent;
1727+
{
1728+
Handle<SeqTwoByteString> raw =
1729+
factory->NewRawTwoByteString(kLength).ToHandleChecked();
1730+
CopyChars(raw->GetChars(), two_byte_buf, kLength);
1731+
parent = raw;
1732+
}
1733+
CHECK(parent->IsTwoByteRepresentation());
1734+
Handle<String> sliced = factory->NewSubString(parent, 1, 20);
1735+
CHECK(sliced->IsSlicedString());
1736+
factory->InternalizeString(parent);
1737+
CHECK(parent->IsThinString());
1738+
Handle<String> grandparent =
1739+
handle(ThinString::cast(*parent)->actual(), isolate);
1740+
CHECK_EQ(*parent, SlicedString::cast(*sliced)->parent());
1741+
OneByteStringResource* resource =
1742+
new OneByteStringResource(external_one_byte_buf, kLength);
1743+
grandparent->MakeExternal(resource);
1744+
// The grandparent string becomes one-byte, but the child strings are still
1745+
// two-byte.
1746+
CHECK(grandparent->IsOneByteRepresentation());
1747+
CHECK(parent->IsTwoByteRepresentation());
1748+
CHECK(sliced->IsTwoByteRepresentation());
1749+
// The *Underneath versions return the correct representation.
1750+
CHECK(sliced->IsOneByteRepresentationUnderneath());
1751+
CHECK(!sliced->IsTwoByteRepresentationUnderneath());
1752+
}
1753+
16961754
} // namespace test_strings
16971755
} // namespace internal
16981756
} // namespace v8

deps/v8/test/unittests/assembler/turbo-assembler-ppc-unittest.cc

+6
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ TEST_F(TurboAssemblerTest, TestHardAbort) {
2525
byte* buffer = AllocateAssemblerBuffer(&allocated);
2626
TurboAssembler tasm(nullptr, AssemblerOptions{}, buffer,
2727
static_cast<int>(allocated), CodeObjectRequired::kNo);
28+
// Called from C
29+
__ function_descriptor();
30+
2831
__ set_abort_hard(true);
2932

3033
__ Abort(AbortReason::kNoReason);
@@ -43,6 +46,9 @@ TEST_F(TurboAssemblerTest, TestCheck) {
4346
byte* buffer = AllocateAssemblerBuffer(&allocated);
4447
TurboAssembler tasm(nullptr, AssemblerOptions{}, buffer,
4548
static_cast<int>(allocated), CodeObjectRequired::kNo);
49+
// Called from C
50+
__ function_descriptor();
51+
4652
__ set_abort_hard(true);
4753

4854
// Fail if the first parameter is 17.

0 commit comments

Comments
 (0)