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

Side by Side Diff: runtime/vm/intermediate_language.h

Issue 10914008: Add explicit smi-checks to smi comparisons. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_ 5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_
6 #define VM_INTERMEDIATE_LANGUAGE_H_ 6 #define VM_INTERMEDIATE_LANGUAGE_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 #include "vm/ast.h" 9 #include "vm/ast.h"
10 #include "vm/growable_array.h" 10 #include "vm/growable_array.h"
(...skipping 1921 matching lines...) Expand 10 before | Expand all | Expand 10 after
1932 1932
1933 private: 1933 private:
1934 InstanceCallComp* original_; 1934 InstanceCallComp* original_;
1935 1935
1936 DISALLOW_COPY_AND_ASSIGN(CheckClassComp); 1936 DISALLOW_COPY_AND_ASSIGN(CheckClassComp);
1937 }; 1937 };
1938 1938
1939 1939
1940 class CheckSmiComp : public TemplateComputation<1> { 1940 class CheckSmiComp : public TemplateComputation<1> {
1941 public: 1941 public:
1942 CheckSmiComp(Value* value, InstanceCallComp* original) 1942 CheckSmiComp(Value* value, intptr_t original_deopt_id)
1943 : original_(original) { 1943 : original_deopt_id_(original_deopt_id) {
1944 ASSERT(value != NULL); 1944 ASSERT(value != NULL);
srdjan 2012/08/30 18:36:12 Assert that original_deopt_is valid (not kNoDeopt
Florian Schneider 2012/09/03 09:25:09 Done.
1945 inputs_[0] = value; 1945 inputs_[0] = value;
1946 } 1946 }
1947 1947
1948 DECLARE_COMPUTATION(CheckSmi) 1948 DECLARE_COMPUTATION(CheckSmi)
1949 1949
1950 virtual bool CanDeoptimize() const { return true; } 1950 virtual bool CanDeoptimize() const { return true; }
1951 virtual intptr_t ResultCid() const { return kIllegalCid; } 1951 virtual intptr_t ResultCid() const { return kIllegalCid; }
1952 1952
1953 virtual bool AttributesEqual(Computation* other) const { return true; } 1953 virtual bool AttributesEqual(Computation* other) const { return true; }
1954 1954
1955 virtual bool HasSideEffect() const { return false; } 1955 virtual bool HasSideEffect() const { return false; }
1956 1956
1957 virtual Definition* TryReplace(BindInstr* instr) const; 1957 virtual Definition* TryReplace(BindInstr* instr) const;
1958 1958
1959 Value* value() const { return inputs_[0]; } 1959 Value* value() const { return inputs_[0]; }
1960 1960
1961 intptr_t deopt_id() const { return original_->deopt_id(); } 1961 intptr_t deopt_id() const { return original_deopt_id_; }
srdjan 2012/08/30 18:36:12 Super class has a method deopt_id that is not virt
Florian Schneider 2012/09/03 09:25:09 Done. This is fragile right now: Computation::deop
1962 1962
1963 private: 1963 private:
1964 InstanceCallComp* original_; 1964 intptr_t original_deopt_id_;
srdjan 2012/08/30 18:36:12 const
Florian Schneider 2012/09/03 09:25:09 Done.
1965 1965
1966 DISALLOW_COPY_AND_ASSIGN(CheckSmiComp); 1966 DISALLOW_COPY_AND_ASSIGN(CheckSmiComp);
1967 }; 1967 };
1968 1968
1969 1969
1970 class CheckArrayBoundComp : public TemplateComputation<2> { 1970 class CheckArrayBoundComp : public TemplateComputation<2> {
1971 public: 1971 public:
1972 CheckArrayBoundComp(Value* array, 1972 CheckArrayBoundComp(Value* array,
1973 Value* index, 1973 Value* index,
1974 intptr_t array_type, 1974 intptr_t array_type,
(...skipping 1207 matching lines...) Expand 10 before | Expand all | Expand 10 after
3182 ForwardInstructionIterator* current_iterator_; 3182 ForwardInstructionIterator* current_iterator_;
3183 3183
3184 private: 3184 private:
3185 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 3185 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
3186 }; 3186 };
3187 3187
3188 3188
3189 } // namespace dart 3189 } // namespace dart
3190 3190
3191 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 3191 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698