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 { ...@@ -28,8 +28,6 @@ namespace internal {
#ifdef DEBUG #ifdef DEBUG
void AstNode::Print() { Print(Isolate::Current()); }
void AstNode::Print(Isolate* isolate) { void AstNode::Print(Isolate* isolate) {
AstPrinter::PrintOut(isolate, this); AstPrinter::PrintOut(isolate, this);
} }
......
...@@ -191,7 +191,6 @@ class AstNode: public ZoneObject { ...@@ -191,7 +191,6 @@ class AstNode: public ZoneObject {
int position() const { return position_; } int position() const { return position_; }
#ifdef DEBUG #ifdef DEBUG
void Print();
void Print(Isolate* isolate); void Print(Isolate* isolate);
#endif // DEBUG #endif // DEBUG
......
...@@ -1142,13 +1142,7 @@ void AstPrinter::VisitCallNew(CallNew* node) { ...@@ -1142,13 +1142,7 @@ void AstPrinter::VisitCallNew(CallNew* node) {
void AstPrinter::VisitCallRuntime(CallRuntime* node) { void AstPrinter::VisitCallRuntime(CallRuntime* node) {
EmbeddedVector<char, 128> buf; EmbeddedVector<char, 128> buf;
if (node->is_jsruntime()) { SNPrintF(buf, "CALL RUNTIME %s", node->debug_name());
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());
}
IndentedScope indent(this, buf.start(), node->position()); IndentedScope indent(this, buf.start(), node->position());
PrintArguments(node->arguments()); PrintArguments(node->arguments());
} }
......
...@@ -10924,12 +10924,15 @@ static bool IsClassOfTest(CompareOperation* expr) { ...@@ -10924,12 +10924,15 @@ static bool IsClassOfTest(CompareOperation* expr) {
Literal* literal = expr->right()->AsLiteral(); Literal* literal = expr->right()->AsLiteral();
if (literal == NULL) return false; if (literal == NULL) return false;
if (!literal->value()->IsString()) return false; if (!literal->value()->IsString()) return false;
if (call->is_jsruntime()) return false; if (!call->is_jsruntime() &&
if (call->function()->function_id != Runtime::kInlineClassOf) return false; call->function()->function_id != Runtime::kInlineClassOf) {
DCHECK_EQ(call->arguments()->length(), 1); return false;
}
DCHECK(call->arguments()->length() == 1);
return true; return true;
} }
void HOptimizedGraphBuilder::VisitBinaryOperation(BinaryOperation* expr) { void HOptimizedGraphBuilder::VisitBinaryOperation(BinaryOperation* expr) {
DCHECK(!HasStackOverflow()); DCHECK(!HasStackOverflow());
DCHECK(current_block() != NULL); 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