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

Unified Diff: src/full-codegen/s390/full-codegen-s390.cc

Issue 2449473002: PPC/s390: [full-codegen] Eliminate unnecessary hole checks for stores (Closed)
Patch Set: Created 4 years, 2 months 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 | « src/full-codegen/ppc/full-codegen-ppc.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen/s390/full-codegen-s390.cc
diff --git a/src/full-codegen/s390/full-codegen-s390.cc b/src/full-codegen/s390/full-codegen-s390.cc
index c1e838dbea781514e886a7ec7b29bf65037a0080..612333fbb23c1941bdc09a1cb20a41293916797d 100644
--- a/src/full-codegen/s390/full-codegen-s390.cc
+++ b/src/full-codegen/s390/full-codegen-s390.cc
@@ -1221,7 +1221,7 @@ void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy,
DCHECK_EQ(NOT_INSIDE_TYPEOF, typeof_mode);
Comment cmnt(masm_, var->IsContextSlot() ? "[ Context variable"
: "[ Stack variable");
- if (proxy->needs_hole_check()) {
+ if (proxy->hole_check_mode() == HoleCheckMode::kRequired) {
// Throw a reference error when using an uninitialized let/const
// binding in harmony mode.
Label done;
@@ -1656,12 +1656,14 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) {
// Store the value.
switch (assign_type) {
- case VARIABLE:
- EmitVariableAssignment(expr->target()->AsVariableProxy()->var(),
- expr->op(), expr->AssignmentSlot());
+ case VARIABLE: {
+ VariableProxy* proxy = expr->target()->AsVariableProxy();
+ EmitVariableAssignment(proxy->var(), expr->op(), expr->AssignmentSlot(),
+ proxy->hole_check_mode());
PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER);
context()->Plug(r2);
break;
+ }
case NAMED_PROPERTY:
EmitNamedPropertyAssignment(expr);
break;
@@ -1986,9 +1988,10 @@ void FullCodeGenerator::EmitAssignment(Expression* expr,
switch (assign_type) {
case VARIABLE: {
- Variable* var = expr->AsVariableProxy()->var();
+ VariableProxy* proxy = expr->AsVariableProxy();
EffectContext context(this);
- EmitVariableAssignment(var, Token::ASSIGN, slot);
+ EmitVariableAssignment(proxy->var(), Token::ASSIGN, slot,
+ proxy->hole_check_mode());
break;
}
case NAMED_PROPERTY: {
@@ -2063,7 +2066,8 @@ void FullCodeGenerator::EmitStoreToStackLocalOrContextSlot(
}
void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op,
- FeedbackVectorSlot slot) {
+ FeedbackVectorSlot slot,
+ HoleCheckMode hole_check_mode) {
if (var->IsUnallocated()) {
// Global var, const, or let.
__ LoadGlobalObject(StoreDescriptor::ReceiverRegister());
@@ -2075,7 +2079,7 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op,
DCHECK(var->IsStackAllocated() || var->IsContextSlot());
MemOperand location = VarOperand(var, r3);
// Perform an initialization check for lexically declared variables.
- if (var->binding_needs_init()) {
+ if (hole_check_mode == HoleCheckMode::kRequired) {
Label assign;
__ LoadP(r5, location);
__ CompareRoot(r5, Heap::kTheHoleValueRootIndex);
@@ -3113,12 +3117,13 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
// Store the value returned in r2.
switch (assign_type) {
- case VARIABLE:
+ case VARIABLE: {
+ VariableProxy* proxy = expr->expression()->AsVariableProxy();
if (expr->is_postfix()) {
{
EffectContext context(this);
- EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(),
- Token::ASSIGN, expr->CountSlot());
+ EmitVariableAssignment(proxy->var(), Token::ASSIGN, expr->CountSlot(),
+ proxy->hole_check_mode());
PrepareForBailoutForId(expr->AssignmentId(),
BailoutState::TOS_REGISTER);
context.Plug(r2);
@@ -3129,13 +3134,14 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
context()->PlugTOS();
}
} else {
- EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(),
- Token::ASSIGN, expr->CountSlot());
+ EmitVariableAssignment(proxy->var(), Token::ASSIGN, expr->CountSlot(),
+ proxy->hole_check_mode());
PrepareForBailoutForId(expr->AssignmentId(),
BailoutState::TOS_REGISTER);
context()->Plug(r2);
}
break;
+ }
case NAMED_PROPERTY: {
PopOperand(StoreDescriptor::ReceiverRegister());
CallStoreIC(expr->CountSlot(), prop->key()->AsLiteral()->value());
« no previous file with comments | « src/full-codegen/ppc/full-codegen-ppc.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698