summaryrefslogtreecommitdiff
path: root/deps
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2018-10-11 18:51:36 +0200
committerMichaël Zasso <targos@protonmail.com>2018-10-16 21:18:31 +0200
commit0272c9d7058a254960aaff06d21b7a3eff7a4f2a (patch)
treef47baf4991d683beea74faca690229c726463bce /deps
parent25dc25b1111a9bdb8b60064eb0afe73873e96b83 (diff)
downloadandroid-node-v8-0272c9d7058a254960aaff06d21b7a3eff7a4f2a.tar.gz
android-node-v8-0272c9d7058a254960aaff06d21b7a3eff7a4f2a.tar.bz2
android-node-v8-0272c9d7058a254960aaff06d21b7a3eff7a4f2a.zip
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>
Diffstat (limited to 'deps')
-rw-r--r--deps/v8/include/v8-version.h2
-rw-r--r--deps/v8/src/compiler/bytecode-graph-builder.cc2
-rw-r--r--deps/v8/src/compiler/bytecode-graph-builder.h2
-rw-r--r--deps/v8/src/compiler/js-inlining.cc3
-rw-r--r--deps/v8/src/compiler/js-operator.cc7
-rw-r--r--deps/v8/src/compiler/js-operator.h8
-rw-r--r--deps/v8/src/compiler/pipeline.cc3
-rw-r--r--deps/v8/src/compiler/ppc/instruction-selector-ppc.cc2
-rw-r--r--deps/v8/src/objects/string-inl.h8
-rw-r--r--deps/v8/src/ppc/macro-assembler-ppc.cc7
-rw-r--r--deps/v8/src/profiler/cpu-profiler.cc15
-rw-r--r--deps/v8/test/cctest/test-strings.cc58
-rw-r--r--deps/v8/test/unittests/assembler/turbo-assembler-ppc-unittest.cc6
13 files changed, 96 insertions, 27 deletions
diff --git a/deps/v8/include/v8-version.h b/deps/v8/include/v8-version.h
index 415d17dbbb..5005762818 100644
--- a/deps/v8/include/v8-version.h
+++ b/deps/v8/include/v8-version.h
@@ -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.)
diff --git a/deps/v8/src/compiler/bytecode-graph-builder.cc b/deps/v8/src/compiler/bytecode-graph-builder.cc
index bd8b551f4f..5fad7bc920 100644
--- a/deps/v8/src/compiler/bytecode-graph-builder.cc
+++ b/deps/v8/src/compiler/bytecode-graph-builder.cc
@@ -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)
diff --git a/deps/v8/src/compiler/bytecode-graph-builder.h b/deps/v8/src/compiler/bytecode-graph-builder.h
index 57127142de..016134ddbb 100644
--- a/deps/v8/src/compiler/bytecode-graph-builder.h
+++ b/deps/v8/src/compiler/bytecode-graph-builder.h
@@ -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,
diff --git a/deps/v8/src/compiler/js-inlining.cc b/deps/v8/src/compiler/js-inlining.cc
index 247e36d5b3..2f31772883 100644
--- a/deps/v8/src/compiler/js-inlining.cc
+++ b/deps/v8/src/compiler/js-inlining.cc
@@ -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();
diff --git a/deps/v8/src/compiler/js-operator.cc b/deps/v8/src/compiler/js-operator.cc
index 797814314f..acfc0d3a19 100644
--- a/deps/v8/src/compiler/js-operator.cc
+++ b/deps/v8/src/compiler/js-operator.cc
@@ -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,
diff --git a/deps/v8/src/compiler/js-operator.h b/deps/v8/src/compiler/js-operator.h
index b10d89cdb9..a81b187c7b 100644
--- a/deps/v8/src/compiler/js-operator.h
+++ b/deps/v8/src/compiler/js-operator.h
@@ -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);
diff --git a/deps/v8/src/compiler/pipeline.cc b/deps/v8/src/compiler/pipeline.cc
index 5717c70348..0cc3723594 100644
--- a/deps/v8/src/compiler/pipeline.cc
+++ b/deps/v8/src/compiler/pipeline.cc
@@ -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());
diff --git a/deps/v8/src/compiler/ppc/instruction-selector-ppc.cc b/deps/v8/src/compiler/ppc/instruction-selector-ppc.cc
index 6cb98c4f95..e29ae8c7a5 100644
--- a/deps/v8/src/compiler/ppc/instruction-selector-ppc.cc
+++ b/deps/v8/src/compiler/ppc/instruction-selector-ppc.cc
@@ -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) {
diff --git a/deps/v8/src/objects/string-inl.h b/deps/v8/src/objects/string-inl.h
index 1e8eef754f..39f642063e 100644
--- a/deps/v8/src/objects/string-inl.h
+++ b/deps/v8/src/objects/string-inl.h
@@ -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();
}
}
diff --git a/deps/v8/src/ppc/macro-assembler-ppc.cc b/deps/v8/src/ppc/macro-assembler-ppc.cc
index 5605907d6f..9ae1e7139a 100644
--- a/deps/v8/src/ppc/macro-assembler-ppc.cc
+++ b/deps/v8/src/ppc/macro-assembler-ppc.cc
@@ -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;
}
diff --git a/deps/v8/src/profiler/cpu-profiler.cc b/deps/v8/src/profiler/cpu-profiler.cc
index 555c47f2f4..21d7c9072e 100644
--- a/deps/v8/src/profiler/cpu-profiler.cc
+++ b/deps/v8/src/profiler/cpu-profiler.cc
@@ -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();
diff --git a/deps/v8/test/cctest/test-strings.cc b/deps/v8/test/cctest/test-strings.cc
index 8aa621b1c1..2c66421831 100644
--- a/deps/v8/test/cctest/test-strings.cc
+++ b/deps/v8/test/cctest/test-strings.cc
@@ -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
diff --git a/deps/v8/test/unittests/assembler/turbo-assembler-ppc-unittest.cc b/deps/v8/test/unittests/assembler/turbo-assembler-ppc-unittest.cc
index 8054eb1da5..dcc138fce1 100644
--- a/deps/v8/test/unittests/assembler/turbo-assembler-ppc-unittest.cc
+++ b/deps/v8/test/unittests/assembler/turbo-assembler-ppc-unittest.cc
@@ -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.