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

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

Issue 509153003: New bigint implementation in the vm. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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) 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 #include "vm/intermediate_language.h" 5 #include "vm/intermediate_language.h"
6 6
7 #include "vm/bigint_operations.h"
8 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
9 #include "vm/cpu.h" 8 #include "vm/cpu.h"
10 #include "vm/dart_entry.h" 9 #include "vm/dart_entry.h"
11 #include "vm/flow_graph_allocator.h" 10 #include "vm/flow_graph_allocator.h"
12 #include "vm/flow_graph_builder.h" 11 #include "vm/flow_graph_builder.h"
13 #include "vm/flow_graph_compiler.h" 12 #include "vm/flow_graph_compiler.h"
14 #include "vm/flow_graph_optimizer.h" 13 #include "vm/flow_graph_optimizer.h"
15 #include "vm/flow_graph_range_analysis.h" 14 #include "vm/flow_graph_range_analysis.h"
16 #include "vm/locations.h" 15 #include "vm/locations.h"
17 #include "vm/method_recognizer.h" 16 #include "vm/method_recognizer.h"
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 374
376 bool LoadIndexedInstr::AttributesEqual(Instruction* other) const { 375 bool LoadIndexedInstr::AttributesEqual(Instruction* other) const {
377 LoadIndexedInstr* other_load = other->AsLoadIndexed(); 376 LoadIndexedInstr* other_load = other->AsLoadIndexed();
378 ASSERT(other_load != NULL); 377 ASSERT(other_load != NULL);
379 return class_id() == other_load->class_id(); 378 return class_id() == other_load->class_id();
380 } 379 }
381 380
382 381
383 ConstantInstr::ConstantInstr(const Object& value) : value_(value) { 382 ConstantInstr::ConstantInstr(const Object& value) : value_(value) {
384 // Check that the value is not an incorrect Integer representation. 383 // Check that the value is not an incorrect Integer representation.
385 ASSERT(!value.IsBigint() || 384 ASSERT(!value.IsBigint() || !Bigint::Cast(value).FitsIntoSmi());
386 !BigintOperations::FitsIntoSmi(Bigint::Cast(value))); 385 ASSERT(!value.IsBigint() || !Bigint::Cast(value).FitsIntoInt64());
387 ASSERT(!value.IsBigint() ||
388 !BigintOperations::FitsIntoInt64(Bigint::Cast(value)));
389 ASSERT(!value.IsMint() || !Smi::IsValid(Mint::Cast(value).AsInt64Value())); 386 ASSERT(!value.IsMint() || !Smi::IsValid(Mint::Cast(value).AsInt64Value()));
390 } 387 }
391 388
392 389
393 bool ConstantInstr::AttributesEqual(Instruction* other) const { 390 bool ConstantInstr::AttributesEqual(Instruction* other) const {
394 ConstantInstr* other_constant = other->AsConstant(); 391 ConstantInstr* other_constant = other->AsConstant();
395 ASSERT(other_constant != NULL); 392 ASSERT(other_constant != NULL);
396 return (value().raw() == other_constant->value().raw()); 393 return (value().raw() == other_constant->value().raw());
397 } 394 }
398 395
(...skipping 2696 matching lines...) Expand 10 before | Expand all | Expand 10 after
3095 case Token::kTRUNCDIV: return 0; 3092 case Token::kTRUNCDIV: return 0;
3096 case Token::kMOD: return 1; 3093 case Token::kMOD: return 1;
3097 default: UNIMPLEMENTED(); return -1; 3094 default: UNIMPLEMENTED(); return -1;
3098 } 3095 }
3099 } 3096 }
3100 3097
3101 3098
3102 #undef __ 3099 #undef __
3103 3100
3104 } // namespace dart 3101 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698