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

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 #if 0 // TODO(regis): Are these asserts correct? We need to be able to optimize
386 !BigintOperations::FitsIntoSmi(Bigint::Cast(value))); 385 // bigint functions where small numbers are represented as bigint.
387 ASSERT(!value.IsBigint() || 386 ASSERT(!value.IsBigint() || !Bigint::Cast(value).FitsIntoSmi());
388 !BigintOperations::FitsIntoInt64(Bigint::Cast(value))); 387 ASSERT(!value.IsBigint() || !Bigint::Cast(value).FitsIntoInt64());
srdjan 2014/09/08 19:19:49 We need these asserts in some form.
regis 2014/09/09 19:18:14 I made the Bigint instances representing small num
388 #endif
389 ASSERT(!value.IsMint() || !Smi::IsValid(Mint::Cast(value).AsInt64Value())); 389 ASSERT(!value.IsMint() || !Smi::IsValid(Mint::Cast(value).AsInt64Value()));
390 } 390 }
391 391
392 392
393 bool ConstantInstr::AttributesEqual(Instruction* other) const { 393 bool ConstantInstr::AttributesEqual(Instruction* other) const {
394 ConstantInstr* other_constant = other->AsConstant(); 394 ConstantInstr* other_constant = other->AsConstant();
395 ASSERT(other_constant != NULL); 395 ASSERT(other_constant != NULL);
396 return (value().raw() == other_constant->value().raw()); 396 return (value().raw() == other_constant->value().raw());
397 } 397 }
398 398
(...skipping 2696 matching lines...) Expand 10 before | Expand all | Expand 10 after
3095 case Token::kTRUNCDIV: return 0; 3095 case Token::kTRUNCDIV: return 0;
3096 case Token::kMOD: return 1; 3096 case Token::kMOD: return 1;
3097 default: UNIMPLEMENTED(); return -1; 3097 default: UNIMPLEMENTED(); return -1;
3098 } 3098 }
3099 } 3099 }
3100 3100
3101 3101
3102 #undef __ 3102 #undef __
3103 3103
3104 } // namespace dart 3104 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698