Commit 81dd9847 authored by machenbach's avatar machenbach Committed by Commit bot

Revert of [crankshaft] Fix IsClassOfTest helper method (patchset #1 id:1 of...

Revert of [crankshaft] Fix IsClassOfTest helper method (patchset #1 id:1 of https://codereview.chromium.org/2586933002/ )

Reason for revert:
Breaks vtune:
https://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20vtunejit/builds/15379

Original issue's description:
> [crankshaft] Fix IsClassOfTest helper method
>
> Drive-by-fix: Add AstNode::Print() and improve printing of CallRuntime
>               Expression.
>
> BUG=v8:5749
>
> Review-Url: https://codereview.chromium.org/2586933002
> Cr-Commit-Position: refs/heads/master@{#41792}
> Committed: https://chromium.googlesource.com/v8/v8/+/d4493222b958877e51ebd67399d12a80ec848e30

TBR=bmeurer@chromium.org,cbruni@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:5749

Review-Url: https://codereview.chromium.org/2587973002
Cr-Commit-Position: refs/heads/master@{#41795}
parent 07fa0f49
......@@ -28,8 +28,6 @@ namespace internal {
#ifdef DEBUG
void AstNode::Print() { Print(Isolate::Current()); }
void AstNode::Print(Isolate* isolate) {
AstPrinter::PrintOut(isolate, this);
}
......
......@@ -191,7 +191,6 @@ class AstNode: public ZoneObject {
int position() const { return position_; }
#ifdef DEBUG
void Print();
void Print(Isolate* isolate);
#endif // DEBUG
......
......@@ -1142,13 +1142,7 @@ void AstPrinter::VisitCallNew(CallNew* node) {
void AstPrinter::VisitCallRuntime(CallRuntime* node) {
EmbeddedVector<char, 128> buf;
if (node->is_jsruntime()) {
SNPrintF(buf, "CALL RUNTIME %s code = %p", node->debug_name(),
isolate_->context()->get(node->context_index()));
} else {
SNPrintF(buf, "CALL RUNTIME %s", node->debug_name());
}
SNPrintF(buf, "CALL RUNTIME %s", node->debug_name());
IndentedScope indent(this, buf.start(), node->position());
PrintArguments(node->arguments());
}
......
......@@ -10924,12 +10924,15 @@ static bool IsClassOfTest(CompareOperation* expr) {
Literal* literal = expr->right()->AsLiteral();
if (literal == NULL) return false;
if (!literal->value()->IsString()) return false;
if (call->is_jsruntime()) return false;
if (call->function()->function_id != Runtime::kInlineClassOf) return false;
DCHECK_EQ(call->arguments()->length(), 1);
if (!call->is_jsruntime() &&
call->function()->function_id != Runtime::kInlineClassOf) {
return false;
}
DCHECK(call->arguments()->length() == 1);
return true;
}
void HOptimizedGraphBuilder::VisitBinaryOperation(BinaryOperation* expr) {
DCHECK(!HasStackOverflow());
DCHECK(current_block() != NULL);
......
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --allow-natives-syntax
function f(x) {
(x ** 1) === '';
}
f();
f();
f();
%OptimizeFunctionOnNextCall(f);
f();
function g(x) {
'' === (x ** 1);
}
g();
g();
g();
%OptimizeFunctionOnNextCall(g);
g();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment