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

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

Issue 2111923002: [interpreter] Introduce binary op bytecodes for Smi operand. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 5 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
« no previous file with comments | « no previous file | src/compiler/bytecode-graph-builder.h » ('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 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 <sstream> 7 #include <sstream>
8 8
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 1680 matching lines...) Expand 10 before | Expand all | Expand 10 after
1691 Label if_issmi(assembler), if_isnotsmi(assembler); 1691 Label if_issmi(assembler), if_isnotsmi(assembler);
1692 assembler->Branch(assembler->WordIsSmi(value), &if_issmi, &if_isnotsmi); 1692 assembler->Branch(assembler->WordIsSmi(value), &if_issmi, &if_isnotsmi);
1693 1693
1694 assembler->Bind(&if_issmi); 1694 assembler->Bind(&if_issmi);
1695 { 1695 {
1696 // Try fast Smi addition first. 1696 // Try fast Smi addition first.
1697 Node* one = assembler->SmiConstant(Smi::FromInt(1)); 1697 Node* one = assembler->SmiConstant(Smi::FromInt(1));
1698 Node* pair = assembler->SmiAddWithOverflow(value, one); 1698 Node* pair = assembler->SmiAddWithOverflow(value, one);
1699 Node* overflow = assembler->Projection(1, pair); 1699 Node* overflow = assembler->Projection(1, pair);
1700 1700
1701 // Check if the Smi additon overflowed. 1701 // Check if the Smi addition overflowed.
1702 Label if_overflow(assembler), if_notoverflow(assembler); 1702 Label if_overflow(assembler), if_notoverflow(assembler);
1703 assembler->Branch(overflow, &if_overflow, &if_notoverflow); 1703 assembler->Branch(overflow, &if_overflow, &if_notoverflow);
1704 1704
1705 assembler->Bind(&if_notoverflow); 1705 assembler->Bind(&if_notoverflow);
1706 result_var.Bind(assembler->Projection(0, pair)); 1706 result_var.Bind(assembler->Projection(0, pair));
1707 assembler->Goto(&end); 1707 assembler->Goto(&end);
1708 1708
1709 assembler->Bind(&if_overflow); 1709 assembler->Bind(&if_overflow);
1710 { 1710 {
1711 var_finc_value.Bind(assembler->SmiToFloat64(value)); 1711 var_finc_value.Bind(assembler->SmiToFloat64(value));
(...skipping 3148 matching lines...) Expand 10 before | Expand all | Expand 10 after
4860 if (type->Is(Type::UntaggedPointer())) { 4860 if (type->Is(Type::UntaggedPointer())) {
4861 return Representation::External(); 4861 return Representation::External();
4862 } 4862 }
4863 4863
4864 DCHECK(!type->Is(Type::Untagged())); 4864 DCHECK(!type->Is(Type::Untagged()));
4865 return Representation::Tagged(); 4865 return Representation::Tagged();
4866 } 4866 }
4867 4867
4868 } // namespace internal 4868 } // namespace internal
4869 } // namespace v8 4869 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/bytecode-graph-builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698