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

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

Issue 652363006: [turbofan] First step towards correctified 64-bit addressing. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixes2 Created 6 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « src/compiler/ia32/instruction-selector-ia32.cc ('k') | src/compiler/machine-type.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 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 #ifndef V8_COMPILER_INSTRUCTION_H_ 5 #ifndef V8_COMPILER_INSTRUCTION_H_
6 #define V8_COMPILER_INSTRUCTION_H_ 6 #define V8_COMPILER_INSTRUCTION_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <iosfwd> 9 #include <iosfwd>
10 #include <map> 10 #include <map>
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 explicit Constant(float v) : type_(kFloat32), value_(bit_cast<int32_t>(v)) {} 668 explicit Constant(float v) : type_(kFloat32), value_(bit_cast<int32_t>(v)) {}
669 explicit Constant(double v) : type_(kFloat64), value_(bit_cast<int64_t>(v)) {} 669 explicit Constant(double v) : type_(kFloat64), value_(bit_cast<int64_t>(v)) {}
670 explicit Constant(ExternalReference ref) 670 explicit Constant(ExternalReference ref)
671 : type_(kExternalReference), value_(bit_cast<intptr_t>(ref)) {} 671 : type_(kExternalReference), value_(bit_cast<intptr_t>(ref)) {}
672 explicit Constant(Handle<HeapObject> obj) 672 explicit Constant(Handle<HeapObject> obj)
673 : type_(kHeapObject), value_(bit_cast<intptr_t>(obj)) {} 673 : type_(kHeapObject), value_(bit_cast<intptr_t>(obj)) {}
674 674
675 Type type() const { return type_; } 675 Type type() const { return type_; }
676 676
677 int32_t ToInt32() const { 677 int32_t ToInt32() const {
678 DCHECK_EQ(kInt32, type()); 678 DCHECK(type() == kInt32 || type() == kInt64);
679 return static_cast<int32_t>(value_); 679 const int32_t value = static_cast<int32_t>(value_);
680 DCHECK_EQ(value_, static_cast<int64_t>(value));
681 return value;
680 } 682 }
681 683
682 int64_t ToInt64() const { 684 int64_t ToInt64() const {
683 if (type() == kInt32) return ToInt32(); 685 if (type() == kInt32) return ToInt32();
684 DCHECK_EQ(kInt64, type()); 686 DCHECK_EQ(kInt64, type());
685 return value_; 687 return value_;
686 } 688 }
687 689
688 float ToFloat32() const { 690 float ToFloat32() const {
689 DCHECK_EQ(kFloat32, type()); 691 DCHECK_EQ(kFloat32, type());
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
970 DeoptimizationVector deoptimization_entries_; 972 DeoptimizationVector deoptimization_entries_;
971 }; 973 };
972 974
973 std::ostream& operator<<(std::ostream& os, const InstructionSequence& code); 975 std::ostream& operator<<(std::ostream& os, const InstructionSequence& code);
974 976
975 } // namespace compiler 977 } // namespace compiler
976 } // namespace internal 978 } // namespace internal
977 } // namespace v8 979 } // namespace v8
978 980
979 #endif // V8_COMPILER_INSTRUCTION_H_ 981 #endif // V8_COMPILER_INSTRUCTION_H_
OLDNEW
« no previous file with comments | « src/compiler/ia32/instruction-selector-ia32.cc ('k') | src/compiler/machine-type.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698