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

Side by Side Diff: src/compiler/ast-graph-builder.cc

Issue 558663002: Fix deoptimization of the count operation in Turbofan. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | test/mjsunit/regress/poly_count_operation.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/ast-graph-builder.h" 5 #include "src/compiler/ast-graph-builder.h"
6 6
7 #include "src/compiler.h" 7 #include "src/compiler.h"
8 #include "src/compiler/control-builders.h" 8 #include "src/compiler/control-builders.h"
9 #include "src/compiler/machine-operator.h" 9 #include "src/compiler/machine-operator.h"
10 #include "src/compiler/node-properties.h" 10 #include "src/compiler/node-properties.h"
(...skipping 1402 matching lines...) Expand 10 before | Expand all | Expand 10 after
1413 Node* value = 1413 Node* value =
1414 BuildBinaryOp(old_value, jsgraph()->OneConstant(), expr->binary_op()); 1414 BuildBinaryOp(old_value, jsgraph()->OneConstant(), expr->binary_op());
1415 // TODO(jarin) Insert proper bailout id here (will need to change 1415 // TODO(jarin) Insert proper bailout id here (will need to change
1416 // full code generator). 1416 // full code generator).
1417 PrepareFrameState(value, BailoutId::None()); 1417 PrepareFrameState(value, BailoutId::None());
1418 1418
1419 // Store the value. 1419 // Store the value.
1420 switch (assign_type) { 1420 switch (assign_type) {
1421 case VARIABLE: { 1421 case VARIABLE: {
1422 Variable* variable = expr->expression()->AsVariableProxy()->var(); 1422 Variable* variable = expr->expression()->AsVariableProxy()->var();
1423 environment()->Push(value);
1423 BuildVariableAssignment(variable, value, expr->op(), 1424 BuildVariableAssignment(variable, value, expr->op(),
1424 expr->AssignmentId()); 1425 expr->AssignmentId());
1426 environment()->Pop();
1425 break; 1427 break;
1426 } 1428 }
1427 case NAMED_PROPERTY: { 1429 case NAMED_PROPERTY: {
1428 Node* object = environment()->Pop(); 1430 Node* object = environment()->Pop();
1429 Unique<Name> name = 1431 Unique<Name> name =
1430 MakeUnique(property->key()->AsLiteral()->AsPropertyName()); 1432 MakeUnique(property->key()->AsLiteral()->AsPropertyName());
1431 Node* store = 1433 Node* store =
1432 NewNode(javascript()->StoreNamed(strict_mode(), name), object, value); 1434 NewNode(javascript()->StoreNamed(strict_mode(), name), object, value);
1435 environment()->Push(value);
Michael Starzinger 2014/09/10 21:38:38 This is approaching crankshaft-esque complexity le
1433 PrepareFrameState(store, expr->AssignmentId()); 1436 PrepareFrameState(store, expr->AssignmentId());
1437 environment()->Pop();
1434 break; 1438 break;
1435 } 1439 }
1436 case KEYED_PROPERTY: { 1440 case KEYED_PROPERTY: {
1437 Node* key = environment()->Pop(); 1441 Node* key = environment()->Pop();
1438 Node* object = environment()->Pop(); 1442 Node* object = environment()->Pop();
1439 Node* store = NewNode(javascript()->StoreProperty(strict_mode()), object, 1443 Node* store = NewNode(javascript()->StoreProperty(strict_mode()), object,
1440 key, value); 1444 key, value);
1445 environment()->Push(value);
1441 PrepareFrameState(store, expr->AssignmentId()); 1446 PrepareFrameState(store, expr->AssignmentId());
1447 environment()->Pop();
1442 break; 1448 break;
1443 } 1449 }
1444 } 1450 }
1445 1451
1446 // Restore old value for postfix expressions. 1452 // Restore old value for postfix expressions.
1447 if (is_postfix) value = environment()->Pop(); 1453 if (is_postfix) value = environment()->Pop();
1448 1454
1449 ast_context()->ProduceValue(value); 1455 ast_context()->ProduceValue(value);
1450 } 1456 }
1451 1457
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
2012 DCHECK(node->InputAt(frame_state_index)->op()->opcode() == IrOpcode::kDead); 2018 DCHECK(node->InputAt(frame_state_index)->op()->opcode() == IrOpcode::kDead);
2013 2019
2014 Node* frame_state_node = environment()->Checkpoint(ast_id, combine); 2020 Node* frame_state_node = environment()->Checkpoint(ast_id, combine);
2015 node->ReplaceInput(frame_state_index, frame_state_node); 2021 node->ReplaceInput(frame_state_index, frame_state_node);
2016 } 2022 }
2017 } 2023 }
2018 2024
2019 } 2025 }
2020 } 2026 }
2021 } // namespace v8::internal::compiler 2027 } // namespace v8::internal::compiler
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/poly_count_operation.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698