Skip to content

Commit 5ce2827

Browse files
committed
Version 5.4.500.1 (cherry-pick)
Merged 6646d73 [turbofan] Use ObjectIsReceiver directly for inlining. BUG=chromium:640369 LOG=N [email protected] [email protected] Review URL: https://codereview.chromium.org/2272393002 . Cr-Commit-Position: refs/heads/5.4.500@{#2} Cr-Branched-From: ad07b49-refs/heads/master@{#38841}
1 parent 4fb8ad0 commit 5ce2827

4 files changed

Lines changed: 25 additions & 9 deletions

File tree

include/v8-version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define V8_MAJOR_VERSION 5
1212
#define V8_MINOR_VERSION 4
1313
#define V8_BUILD_NUMBER 500
14-
#define V8_PATCH_LEVEL 0
14+
#define V8_PATCH_LEVEL 1
1515

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

src/compiler/js-inlining.cc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "src/compiler/node-matchers.h"
1717
#include "src/compiler/node-properties.h"
1818
#include "src/compiler/operator-properties.h"
19+
#include "src/compiler/simplified-operator.h"
1920
#include "src/compiler/type-hint-analyzer.h"
2021
#include "src/isolate-inl.h"
2122
#include "src/parsing/parse-info.h"
@@ -435,20 +436,15 @@ Reduction JSInliner::ReduceJSCall(Node* node, Handle<JSFunction> function) {
435436
NodeProperties::ReplaceEffectInput(node, create);
436437
// Insert a check of the return value to determine whether the return
437438
// value or the implicit receiver should be selected as a result of the
438-
// call. The check is wired into the successful control completion.
439-
Node* success = graph()->NewNode(common()->IfSuccess(), node);
440-
Node* check = graph()->NewNode(
441-
javascript()->CallRuntime(Runtime::kInlineIsJSReceiver, 1), node,
442-
context, node, success);
439+
// call.
440+
Node* check = graph()->NewNode(simplified()->ObjectIsReceiver(), node);
443441
Node* select =
444442
graph()->NewNode(common()->Select(MachineRepresentation::kTagged),
445443
check, node, create);
446-
NodeProperties::ReplaceUses(node, select, check, check, node);
444+
NodeProperties::ReplaceUses(node, select, node, node, node);
447445
// Fix-up inputs that have been mangled by the {ReplaceUses} call above.
448446
NodeProperties::ReplaceValueInput(select, node, 1); // Fix-up input.
449447
NodeProperties::ReplaceValueInput(check, node, 0); // Fix-up input.
450-
NodeProperties::ReplaceEffectInput(check, node); // Fix-up input.
451-
NodeProperties::ReplaceControlInput(success, node); // Fix-up input.
452448
receiver = create; // The implicit receiver.
453449
}
454450

@@ -527,6 +523,10 @@ JSOperatorBuilder* JSInliner::javascript() const {
527523

528524
CommonOperatorBuilder* JSInliner::common() const { return jsgraph()->common(); }
529525

526+
SimplifiedOperatorBuilder* JSInliner::simplified() const {
527+
return jsgraph()->simplified();
528+
}
529+
530530
} // namespace compiler
531531
} // namespace internal
532532
} // namespace v8

src/compiler/js-inlining.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class JSInliner final : public AdvancedReducer {
3838
private:
3939
CommonOperatorBuilder* common() const;
4040
JSOperatorBuilder* javascript() const;
41+
SimplifiedOperatorBuilder* simplified() const;
4142
Graph* graph() const;
4243
JSGraph* jsgraph() const { return jsgraph_; }
4344

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright 2014 the V8 project authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
// Flags: --allow-natives-syntax
6+
7+
function A() {
8+
this.x = 0;
9+
for (var i = 0; i < max; ) {}
10+
}
11+
function foo() {
12+
for (var i = 0; i < 1; i = 2) %OptimizeOsr();
13+
return new A();
14+
}
15+
try { foo(); } catch (e) { }

0 commit comments

Comments
 (0)