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

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

Issue 2974953002: Revise assertions and fix bug in the implementation of shifts (Closed)
Patch Set: Outdated comment corrected Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_ 5 #ifndef RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_
6 #define RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_ 6 #define RUNTIME_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/flags.h" 10 #include "vm/flags.h"
(...skipping 7226 matching lines...) Expand 10 before | Expand all | Expand 10 after
7237 shift_range_(NULL) { 7237 shift_range_(NULL) {
7238 ASSERT((op_kind == Token::kSHR) || (op_kind == Token::kSHL)); 7238 ASSERT((op_kind == Token::kSHR) || (op_kind == Token::kSHL));
7239 if (FLAG_limit_ints_to_64_bits) { 7239 if (FLAG_limit_ints_to_64_bits) {
7240 mark_truncating(); 7240 mark_truncating();
7241 } 7241 }
7242 } 7242 }
7243 7243
7244 Range* shift_range() const { return shift_range_; } 7244 Range* shift_range() const { return shift_range_; }
7245 7245
7246 virtual bool ComputeCanDeoptimize() const { 7246 virtual bool ComputeCanDeoptimize() const {
7247 return has_shift_count_check() || 7247 return (!IsShiftCountInRange()) ||
7248 (can_overflow() && (op_kind() == Token::kSHL)); 7248 (can_overflow() && (op_kind() == Token::kSHL));
7249 } 7249 }
7250 7250
7251 virtual Representation representation() const { return kUnboxedMint; } 7251 virtual Representation representation() const { return kUnboxedMint; }
7252 7252
7253 virtual Representation RequiredInputRepresentation(intptr_t idx) const { 7253 virtual Representation RequiredInputRepresentation(intptr_t idx) const {
7254 ASSERT((idx == 0) || (idx == 1)); 7254 ASSERT((idx == 0) || (idx == 1));
7255 return (idx == 0) ? kUnboxedMint : kTagged; 7255 return (idx == 0) ? kUnboxedMint : kTagged;
7256 } 7256 }
7257 7257
7258 virtual void InferRange(RangeAnalysis* analysis, Range* range); 7258 virtual void InferRange(RangeAnalysis* analysis, Range* range);
7259 virtual CompileType ComputeType() const; 7259 virtual CompileType ComputeType() const;
7260 7260
7261 DECLARE_INSTRUCTION(ShiftMintOp) 7261 DECLARE_INSTRUCTION(ShiftMintOp)
7262 7262
7263 private: 7263 private:
7264 static const intptr_t kMintShiftCountLimit = 63; 7264 static const intptr_t kMintShiftCountLimit = 63;
7265 bool has_shift_count_check() const; 7265
7266 // Returns true if the shift amount is guranteed to be in
7267 // [0..kMintShiftCountLimit] range.
7268 bool IsShiftCountInRange() const;
7266 7269
7267 Range* shift_range_; 7270 Range* shift_range_;
7268 7271
7269 DISALLOW_COPY_AND_ASSIGN(ShiftMintOpInstr); 7272 DISALLOW_COPY_AND_ASSIGN(ShiftMintOpInstr);
7270 }; 7273 };
7271 7274
7272 7275
7273 // Handles only NEGATE. 7276 // Handles only NEGATE.
7274 class UnaryDoubleOpInstr : public TemplateDefinition<1, NoThrow, Pure> { 7277 class UnaryDoubleOpInstr : public TemplateDefinition<1, NoThrow, Pure> {
7275 public: 7278 public:
(...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after
8282 LocationSummary* Name::MakeLocationSummary(Zone* zone, bool opt) const { \ 8285 LocationSummary* Name::MakeLocationSummary(Zone* zone, bool opt) const { \
8283 UNIMPLEMENTED(); \ 8286 UNIMPLEMENTED(); \
8284 return NULL; \ 8287 return NULL; \
8285 } \ 8288 } \
8286 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); } 8289 void Name::EmitNativeCode(FlowGraphCompiler* compiler) { UNIMPLEMENTED(); }
8287 8290
8288 8291
8289 } // namespace dart 8292 } // namespace dart
8290 8293
8291 #endif // RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_ 8294 #endif // RUNTIME_VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/intermediate_language.cc » ('j') | runtime/vm/intermediate_language_arm.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698