Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(829)

Unified Diff: src/crankshaft/hydrogen.cc

Issue 1425293007: [crankshaft] Do not optimize ClassConstructor calls and apply. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: hope my magic works Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/parser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/hydrogen.cc
diff --git a/src/crankshaft/hydrogen.cc b/src/crankshaft/hydrogen.cc
index 239cd60a7229fc925840abeb14792a9f61e91b1f..1578af20c2848b53d6a618ced641d4b7c3d4f653 100644
--- a/src/crankshaft/hydrogen.cc
+++ b/src/crankshaft/hydrogen.cc
@@ -8361,6 +8361,11 @@ bool HOptimizedGraphBuilder::TryInline(Handle<JSFunction> target,
CompilationInfo target_info(&parse_info);
Handle<SharedFunctionInfo> target_shared(target->shared());
+
+ if (IsClassConstructor(target_shared->kind())) {
+ TraceInline(target, caller, "target is classConstructor");
+ return false;
+ }
if (target_shared->HasDebugInfo()) {
TraceInline(target, caller, "target is being debugged");
return false;
@@ -9357,6 +9362,7 @@ bool HOptimizedGraphBuilder::TryIndirectCall(Call* expr) {
}
+// f.apply(...)
void HOptimizedGraphBuilder::BuildFunctionApply(Call* expr) {
ZoneList<Expression*>* args = expr->arguments();
CHECK_ALIVE(VisitForValue(args->at(0)));
@@ -9758,7 +9764,8 @@ void HOptimizedGraphBuilder::VisitCall(Call* expr) {
Push(graph()->GetConstantUndefined());
CHECK_ALIVE(VisitExpressions(expr->arguments()));
- if (expr->IsMonomorphic()) {
+ if (expr->IsMonomorphic() &&
+ !IsClassConstructor(expr->target()->shared()->kind())) {
Add<HCheckValue>(function, expr->target());
// Patch the global object on the stack by the expected receiver.
« no previous file with comments | « no previous file | src/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698