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

Unified Diff: src/compiler/code-assembler.cc

Issue 2407813002: [stubs] Port StringAddStub to TF (Closed)
Patch Set: Make ASSERT cheaper 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/compiler/code-assembler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/code-assembler.cc
diff --git a/src/compiler/code-assembler.cc b/src/compiler/code-assembler.cc
index 285259ffcd8e52b252e11d8cc1ab458473c7f1fb..043ea895ce4ec0257f84a5050b60ea635313f3ca 100644
--- a/src/compiler/code-assembler.cc
+++ b/src/compiler/code-assembler.cc
@@ -148,6 +148,20 @@ bool CodeAssembler::ToInt64Constant(Node* node, int64_t& out_value) {
return m.HasValue();
}
+bool CodeAssembler::ToSmiConstant(Node* node, Smi*& out_value) {
+ if (node->opcode() == IrOpcode::kBitcastWordToTaggedSigned) {
+ node = node->InputAt(0);
+ } else {
+ return false;
+ }
+ IntPtrMatcher m(node);
+ if (m.HasValue()) {
+ out_value = Smi::cast(bit_cast<Object*>(m.Value()));
+ return true;
+ }
+ return false;
+}
+
bool CodeAssembler::ToIntPtrConstant(Node* node, intptr_t& out_value) {
IntPtrMatcher m(node);
if (m.HasValue()) out_value = m.Value();
« no previous file with comments | « src/compiler/code-assembler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698