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

Side by Side Diff: src/hydrogen-instructions.h

Issue 298723014: Fix representation inference for mutable double boxes. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added TODOs per offline discussion. Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-3307.js » ('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 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_ 5 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_
6 #define V8_HYDROGEN_INSTRUCTIONS_H_ 6 #define V8_HYDROGEN_INSTRUCTIONS_H_
7 7
8 #include "v8.h" 8 #include "v8.h"
9 9
10 #include "allocation.h" 10 #include "allocation.h"
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after
707 ClearFlag(kFlexibleRepresentation); 707 ClearFlag(kFlexibleRepresentation);
708 } 708 }
709 } 709 }
710 virtual void AssumeRepresentation(Representation r); 710 virtual void AssumeRepresentation(Representation r);
711 711
712 virtual Representation KnownOptimalRepresentation() { 712 virtual Representation KnownOptimalRepresentation() {
713 Representation r = representation(); 713 Representation r = representation();
714 if (r.IsTagged()) { 714 if (r.IsTagged()) {
715 HType t = type(); 715 HType t = type();
716 if (t.IsSmi()) return Representation::Smi(); 716 if (t.IsSmi()) return Representation::Smi();
717 // TODO(mstarzinger): This is not correct for mutable HeapNumbers.
717 if (t.IsHeapNumber()) return Representation::Double(); 718 if (t.IsHeapNumber()) return Representation::Double();
718 if (t.IsHeapObject()) return r; 719 if (t.IsHeapObject()) return r;
719 return Representation::None(); 720 return Representation::None();
720 } 721 }
721 return r; 722 return r;
722 } 723 }
723 724
724 HType type() const { return type_; } 725 HType type() const { return type_; }
725 void set_type(HType new_type) { 726 void set_type(HType new_type) {
726 ASSERT(new_type.IsSubtypeOf(type_)); 727 ASSERT(new_type.IsSubtypeOf(type_));
(...skipping 4769 matching lines...) Expand 10 before | Expand all | Expand 10 after
5496 HValue* context() { return OperandAt(0); } 5497 HValue* context() { return OperandAt(0); }
5497 HValue* size() { return OperandAt(1); } 5498 HValue* size() { return OperandAt(1); }
5498 5499
5499 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { 5500 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
5500 if (index == 0) { 5501 if (index == 0) {
5501 return Representation::Tagged(); 5502 return Representation::Tagged();
5502 } else { 5503 } else {
5503 return Representation::Integer32(); 5504 return Representation::Integer32();
5504 } 5505 }
5505 } 5506 }
5507 // TODO(mstarzinger): Workaround until we track mutable HeapNumber types.
5508 virtual Representation KnownOptimalRepresentation() V8_OVERRIDE {
5509 return representation();
5510 }
5506 5511
5507 virtual Handle<Map> GetMonomorphicJSObjectMap() { 5512 virtual Handle<Map> GetMonomorphicJSObjectMap() {
5508 return known_initial_map_; 5513 return known_initial_map_;
5509 } 5514 }
5510 5515
5511 void set_known_initial_map(Handle<Map> known_initial_map) { 5516 void set_known_initial_map(Handle<Map> known_initial_map) {
5512 known_initial_map_ = known_initial_map; 5517 known_initial_map_ = known_initial_map;
5513 } 5518 }
5514 5519
5515 bool IsNewSpaceAllocation() const { 5520 bool IsNewSpaceAllocation() const {
(...skipping 2239 matching lines...) Expand 10 before | Expand all | Expand 10 after
7755 virtual bool IsDeletable() const V8_OVERRIDE { return true; } 7760 virtual bool IsDeletable() const V8_OVERRIDE { return true; }
7756 }; 7761 };
7757 7762
7758 7763
7759 #undef DECLARE_INSTRUCTION 7764 #undef DECLARE_INSTRUCTION
7760 #undef DECLARE_CONCRETE_INSTRUCTION 7765 #undef DECLARE_CONCRETE_INSTRUCTION
7761 7766
7762 } } // namespace v8::internal 7767 } } // namespace v8::internal
7763 7768
7764 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 7769 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-3307.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698