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

Unified Diff: src/hydrogen-instructions.cc

Issue 1244693002: Add support for adding an external and a tagged pointer (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-instructions.cc
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
index 6b8768e9a9ba21067b23b9ce046e342fbeed5c25..24259c8b7bb4b1251851a6e336f16877c6df81fc 100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -1432,6 +1432,17 @@ HValue* HBitwise::Canonicalize() {
}
+// static
+HInstruction* HAdd::New(Isolate* isolate, Zone* zone, HValue* context,
+ HValue* left, HValue* right, Strength strength,
+ ExternalAddType external_add_type) {
+ // For everything else, you should use the other factory method without
+ // ExternalAddType.
+ DCHECK_EQ(external_add_type, AddOfExternalAndTagged);
+ return new (zone) HAdd(context, left, right, strength, external_add_type);
+}
+
+
Representation HAdd::RepresentationFromInputs() {
Representation left_rep = left()->representation();
if (left_rep.IsExternal()) {
@@ -1445,7 +1456,11 @@ Representation HAdd::RequiredInputRepresentation(int index) {
if (index == 2) {
Representation left_rep = left()->representation();
if (left_rep.IsExternal()) {
- return Representation::Integer32();
+ if (external_add_type_ == AddOfExternalAndTagged) {
+ return Representation::Tagged();
+ } else {
+ return Representation::Integer32();
+ }
}
}
return HArithmeticBinaryOperation::RequiredInputRepresentation(index);
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698