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

Side by Side Diff: src/code-stubs-hydrogen.cc

Issue 1487973002: [turbofan] Add binary operation hints for javascript operators. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/code-stubs.h" 5 #include "src/code-stubs.h"
6 6
7 #include "src/bailout-reason.h" 7 #include "src/bailout-reason.h"
8 #include "src/crankshaft/hydrogen.h" 8 #include "src/crankshaft/hydrogen.h"
9 #include "src/crankshaft/lithium.h" 9 #include "src/crankshaft/lithium.h"
10 #include "src/field-index.h" 10 #include "src/field-index.h"
(...skipping 1439 matching lines...) Expand 10 before | Expand all | Expand 10 after
1450 } 1450 }
1451 1451
1452 1452
1453 template <> 1453 template <>
1454 HValue* CodeStubGraphBuilder<BinaryOpICStub>::BuildCodeInitializedStub() { 1454 HValue* CodeStubGraphBuilder<BinaryOpICStub>::BuildCodeInitializedStub() {
1455 BinaryOpICState state = casted_stub()->state(); 1455 BinaryOpICState state = casted_stub()->state();
1456 1456
1457 HValue* left = GetParameter(BinaryOpICStub::kLeft); 1457 HValue* left = GetParameter(BinaryOpICStub::kLeft);
1458 HValue* right = GetParameter(BinaryOpICStub::kRight); 1458 HValue* right = GetParameter(BinaryOpICStub::kRight);
1459 1459
1460 Type* left_type = state.GetLeftType(zone()); 1460 Type* left_type = state.GetLeftType();
1461 Type* right_type = state.GetRightType(zone()); 1461 Type* right_type = state.GetRightType();
1462 Type* result_type = state.GetResultType(zone()); 1462 Type* result_type = state.GetResultType();
1463 1463
1464 DCHECK(!left_type->Is(Type::None()) && !right_type->Is(Type::None()) && 1464 DCHECK(!left_type->Is(Type::None()) && !right_type->Is(Type::None()) &&
1465 (state.HasSideEffects() || !result_type->Is(Type::None()))); 1465 (state.HasSideEffects() || !result_type->Is(Type::None())));
1466 1466
1467 HValue* result = NULL; 1467 HValue* result = NULL;
1468 HAllocationMode allocation_mode(NOT_TENURED); 1468 HAllocationMode allocation_mode(NOT_TENURED);
1469 if (state.op() == Token::ADD && 1469 if (state.op() == Token::ADD &&
1470 (left_type->Maybe(Type::String()) || right_type->Maybe(Type::String())) && 1470 (left_type->Maybe(Type::String()) || right_type->Maybe(Type::String())) &&
1471 !left_type->Is(Type::String()) && !right_type->Is(Type::String())) { 1471 !left_type->Is(Type::String()) && !right_type->Is(Type::String())) {
1472 // For the generic add stub a fast case for string addition is performance 1472 // For the generic add stub a fast case for string addition is performance
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
1531 1531
1532 template <> 1532 template <>
1533 HValue* CodeStubGraphBuilder<BinaryOpWithAllocationSiteStub>::BuildCodeStub() { 1533 HValue* CodeStubGraphBuilder<BinaryOpWithAllocationSiteStub>::BuildCodeStub() {
1534 BinaryOpICState state = casted_stub()->state(); 1534 BinaryOpICState state = casted_stub()->state();
1535 1535
1536 HValue* allocation_site = GetParameter( 1536 HValue* allocation_site = GetParameter(
1537 BinaryOpWithAllocationSiteStub::kAllocationSite); 1537 BinaryOpWithAllocationSiteStub::kAllocationSite);
1538 HValue* left = GetParameter(BinaryOpWithAllocationSiteStub::kLeft); 1538 HValue* left = GetParameter(BinaryOpWithAllocationSiteStub::kLeft);
1539 HValue* right = GetParameter(BinaryOpWithAllocationSiteStub::kRight); 1539 HValue* right = GetParameter(BinaryOpWithAllocationSiteStub::kRight);
1540 1540
1541 Type* left_type = state.GetLeftType(zone()); 1541 Type* left_type = state.GetLeftType();
1542 Type* right_type = state.GetRightType(zone()); 1542 Type* right_type = state.GetRightType();
1543 Type* result_type = state.GetResultType(zone()); 1543 Type* result_type = state.GetResultType();
1544 HAllocationMode allocation_mode(allocation_site); 1544 HAllocationMode allocation_mode(allocation_site);
1545 1545
1546 return BuildBinaryOperation(state.op(), left, right, left_type, right_type, 1546 return BuildBinaryOperation(state.op(), left, right, left_type, right_type,
1547 result_type, state.fixed_right_arg(), 1547 result_type, state.fixed_right_arg(),
1548 allocation_mode, state.strength()); 1548 allocation_mode, state.strength());
1549 } 1549 }
1550 1550
1551 1551
1552 Handle<Code> BinaryOpWithAllocationSiteStub::GenerateCode() { 1552 Handle<Code> BinaryOpWithAllocationSiteStub::GenerateCode() {
1553 return DoGenerateCode(this); 1553 return DoGenerateCode(this);
(...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after
2444 return Pop(); 2444 return Pop();
2445 } 2445 }
2446 2446
2447 2447
2448 Handle<Code> KeyedLoadGenericStub::GenerateCode() { 2448 Handle<Code> KeyedLoadGenericStub::GenerateCode() {
2449 return DoGenerateCode(this); 2449 return DoGenerateCode(this);
2450 } 2450 }
2451 2451
2452 } // namespace internal 2452 } // namespace internal
2453 } // namespace v8 2453 } // namespace v8
OLDNEW
« no previous file with comments | « BUILD.gn ('k') | src/compiler/ast-graph-builder.h » ('j') | src/compiler/js-typed-lowering.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698