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

Side by Side Diff: src/compiler/instruction.cc

Issue 1759383003: [compiler] Add relocatable pointer constants for wasm memory references. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Removing additional check Created 4 years, 9 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
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/compiler/common-operator.h" 5 #include "src/compiler/common-operator.h"
6 #include "src/compiler/graph.h" 6 #include "src/compiler/graph.h"
7 #include "src/compiler/instruction.h" 7 #include "src/compiler/instruction.h"
8 #include "src/compiler/schedule.h" 8 #include "src/compiler/schedule.h"
9 #include "src/compiler/state-values-utils.h" 9 #include "src/compiler/state-values-utils.h"
10 10
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 printable_op.op_ = *instr.InputAt(i); 497 printable_op.op_ = *instr.InputAt(i);
498 os << " " << printable_op; 498 os << " " << printable_op;
499 } 499 }
500 } 500 }
501 return os; 501 return os;
502 } 502 }
503 503
504 504
505 Constant::Constant(int32_t v) : type_(kInt32), value_(v) {} 505 Constant::Constant(int32_t v) : type_(kInt32), value_(v) {}
506 506
507 Constant::Constant(RelocatablePtrConstantInfo info)
508 #ifdef V8_HOST_ARCH_32_BIT
509 : type_(kInt32), value_(info.value()), rmode_(info.rmode()) {
510 }
511 #else
512 : type_(kInt64), value_(info.value()), rmode_(info.rmode()) {
513 }
514 #endif
507 515
508 std::ostream& operator<<(std::ostream& os, const Constant& constant) { 516 std::ostream& operator<<(std::ostream& os, const Constant& constant) {
509 switch (constant.type()) { 517 switch (constant.type()) {
510 case Constant::kInt32: 518 case Constant::kInt32:
511 return os << constant.ToInt32(); 519 return os << constant.ToInt32();
512 case Constant::kInt64: 520 case Constant::kInt64:
513 return os << constant.ToInt64() << "l"; 521 return os << constant.ToInt64() << "l";
514 case Constant::kFloat32: 522 case Constant::kFloat32:
515 return os << constant.ToFloat32() << "f"; 523 return os << constant.ToFloat32() << "f";
516 case Constant::kFloat64: 524 case Constant::kFloat64:
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
993 } 1001 }
994 for (int i = 0; i < code.InstructionBlockCount(); i++) { 1002 for (int i = 0; i < code.InstructionBlockCount(); i++) {
995 printable.sequence_->PrintBlock(printable.register_configuration_, i); 1003 printable.sequence_->PrintBlock(printable.register_configuration_, i);
996 } 1004 }
997 return os; 1005 return os;
998 } 1006 }
999 1007
1000 } // namespace compiler 1008 } // namespace compiler
1001 } // namespace internal 1009 } // namespace internal
1002 } // namespace v8 1010 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698