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

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

Issue 10905065: Revert r11772: Add check for non-smi to the IL and use it for class checks. (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
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/intermediate_language.cc » ('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 (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 1276 matching lines...) Expand 10 before | Expand all | Expand 10 after
1287 M(CatchEntry, CatchEntryComp) \ 1287 M(CatchEntry, CatchEntryComp) \
1288 M(BinarySmiOp, BinarySmiOpComp) \ 1288 M(BinarySmiOp, BinarySmiOpComp) \
1289 M(BinaryMintOp, BinaryMintOpComp) \ 1289 M(BinaryMintOp, BinaryMintOpComp) \
1290 M(UnarySmiOp, UnarySmiOpComp) \ 1290 M(UnarySmiOp, UnarySmiOpComp) \
1291 M(NumberNegate, NumberNegateComp) \ 1291 M(NumberNegate, NumberNegateComp) \
1292 M(CheckStackOverflow, CheckStackOverflowComp) \ 1292 M(CheckStackOverflow, CheckStackOverflowComp) \
1293 M(DoubleToDouble, DoubleToDoubleComp) \ 1293 M(DoubleToDouble, DoubleToDoubleComp) \
1294 M(SmiToDouble, SmiToDoubleComp) \ 1294 M(SmiToDouble, SmiToDoubleComp) \
1295 M(CheckClass, CheckClassComp) \ 1295 M(CheckClass, CheckClassComp) \
1296 M(CheckSmi, CheckSmiComp) \ 1296 M(CheckSmi, CheckSmiComp) \
1297 M(CheckNonSmi, CheckNonSmiComp) \
1298 M(Constant, ConstantComp) \ 1297 M(Constant, ConstantComp) \
1299 M(CheckEitherNonSmi, CheckEitherNonSmiComp) \ 1298 M(CheckEitherNonSmi, CheckEitherNonSmiComp) \
1300 M(UnboxedDoubleBinaryOp, UnboxedDoubleBinaryOpComp) \ 1299 M(UnboxedDoubleBinaryOp, UnboxedDoubleBinaryOpComp) \
1301 M(UnboxDouble, UnboxDoubleComp) \ 1300 M(UnboxDouble, UnboxDoubleComp) \
1302 M(BoxDouble, BoxDoubleComp) \ 1301 M(BoxDouble, BoxDoubleComp) \
1303 M(CheckArrayBound, CheckArrayBoundComp) 1302 M(CheckArrayBound, CheckArrayBoundComp)
1304 1303
1305 1304
1306 #define FORWARD_DECLARATION(ShortName, ClassName) class ClassName; 1305 #define FORWARD_DECLARATION(ShortName, ClassName) class ClassName;
1307 FOR_EACH_COMPUTATION(FORWARD_DECLARATION) 1306 FOR_EACH_COMPUTATION(FORWARD_DECLARATION)
(...skipping 1934 matching lines...) Expand 10 before | Expand all | Expand 10 after
3242 3241
3243 virtual intptr_t deopt_id() const { return original_deopt_id_; } 3242 virtual intptr_t deopt_id() const { return original_deopt_id_; }
3244 3243
3245 private: 3244 private:
3246 const intptr_t original_deopt_id_; 3245 const intptr_t original_deopt_id_;
3247 3246
3248 DISALLOW_COPY_AND_ASSIGN(CheckSmiComp); 3247 DISALLOW_COPY_AND_ASSIGN(CheckSmiComp);
3249 }; 3248 };
3250 3249
3251 3250
3252 class CheckNonSmiComp : public TemplateComputation<1> {
3253 public:
3254 CheckNonSmiComp(Value* value, intptr_t original_deopt_id)
3255 : original_deopt_id_(original_deopt_id) {
3256 ASSERT(value != NULL);
3257 ASSERT(original_deopt_id != Isolate::kNoDeoptId);
3258 inputs_[0] = value;
3259 }
3260
3261 DECLARE_COMPUTATION(CheckNonSmi)
3262
3263 virtual bool CanDeoptimize() const { return true; }
3264 virtual intptr_t ResultCid() const { return kIllegalCid; }
3265
3266 virtual bool AttributesEqual(Computation* other) const { return true; }
3267
3268 virtual bool HasSideEffect() const { return false; }
3269
3270 Value* value() const { return inputs_[0]; }
3271
3272 virtual intptr_t deopt_id() const { return original_deopt_id_; }
3273
3274 private:
3275 const intptr_t original_deopt_id_;
3276
3277 DISALLOW_COPY_AND_ASSIGN(CheckNonSmiComp);
3278 };
3279
3280
3281 class CheckArrayBoundComp : public TemplateComputation<2> { 3251 class CheckArrayBoundComp : public TemplateComputation<2> {
3282 public: 3252 public:
3283 CheckArrayBoundComp(Value* array, 3253 CheckArrayBoundComp(Value* array,
3284 Value* index, 3254 Value* index,
3285 intptr_t array_type, 3255 intptr_t array_type,
3286 InstanceCallComp* instance_call) 3256 InstanceCallComp* instance_call)
3287 : array_type_(array_type), instance_call_(instance_call) { 3257 : array_type_(array_type), instance_call_(instance_call) {
3288 ASSERT(array != NULL); 3258 ASSERT(array != NULL);
3289 ASSERT(index != NULL); 3259 ASSERT(index != NULL);
3290 inputs_[0] = array; 3260 inputs_[0] = array;
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
3421 ForwardInstructionIterator* current_iterator_; 3391 ForwardInstructionIterator* current_iterator_;
3422 3392
3423 private: 3393 private:
3424 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 3394 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
3425 }; 3395 };
3426 3396
3427 3397
3428 } // namespace dart 3398 } // namespace dart
3429 3399
3430 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 3400 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698