Skip to content

Commit

Permalink
deps: cherry-pick d2e0166 from V8 upstream
Browse files Browse the repository at this point in the history
Original commit message:

  ppc64, aix: Pass CallFrequency object by const reference to avoid value copy error.

  Bug: v8:8193
  GCC bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61976

  Change-Id: I0d4efca4da03ef82651325e15ddf2160022bc8de
  Reviewed-on: https://chromium-review.googlesource.com/1228633
  Reviewed-by: Michael Starzinger <[email protected]>
  Reviewed-by: Daniel Clifford <[email protected]>
  Reviewed-by: Junliang Yan <[email protected]>
  Commit-Queue: Junliang Yan <[email protected]>
  Cr-Commit-Position: refs/heads/master@{#56275}

PR-URL: #23695
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Yang Guo <[email protected]>
Reviewed-By: Ujjwal Sharma <[email protected]>
  • Loading branch information
Vasili Skurydzin authored and MylesBorins committed Nov 29, 2018
1 parent bb55cc1 commit 4233bd9
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.41',
'v8_embedder_string': '-node.42',

# Enable disassembler for `--print-code` v8 options
'v8_enable_disassembler': 1,
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 @@ -514,7 +514,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 @@ -484,9 +484,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 @@ -794,7 +794,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 @@ -818,8 +819,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 @@ -721,13 +721,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 @@ -1059,10 +1059,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->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

0 comments on commit 4233bd9

Please sign in to comment.