| OLD | NEW | 
|---|
| 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  Loading... | 
| 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  Loading... | 
| 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  Loading... | 
| 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 | 
| OLD | NEW | 
|---|