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

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

Issue 484693003: Improve polymorphic inlining of int/int double/double operations. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: rebased and addressed comments Created 6 years, 4 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/method_recognizer.h ('k') | runtime/vm/stub_code.h » ('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 #include "vm/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 11333 matching lines...) Expand 10 before | Expand all | Expand 10 after
11344 return false; 11344 return false;
11345 } 11345 }
11346 #endif // DEBUG 11346 #endif // DEBUG
11347 11347
11348 11348
11349 // Used for unoptimized static calls when no class-ids are checked. 11349 // Used for unoptimized static calls when no class-ids are checked.
11350 void ICData::AddTarget(const Function& target) const { 11350 void ICData::AddTarget(const Function& target) const {
11351 ASSERT(!target.IsNull()); 11351 ASSERT(!target.IsNull());
11352 if (NumArgsTested() > 0) { 11352 if (NumArgsTested() > 0) {
11353 // Create a fake cid entry, so that we can store the target. 11353 // Create a fake cid entry, so that we can store the target.
11354 GrowableArray<intptr_t> class_ids(NumArgsTested()); 11354 if (NumArgsTested() == 1) {
11355 for (intptr_t i = 0; i < NumArgsTested(); i++) { 11355 AddReceiverCheck(kObjectCid, target, 1);
11356 class_ids.Add(kObjectCid); 11356 } else {
11357 GrowableArray<intptr_t> class_ids(NumArgsTested());
11358 for (intptr_t i = 0; i < NumArgsTested(); i++) {
11359 class_ids.Add(kObjectCid);
11360 }
11361 AddCheck(class_ids, target);
11357 } 11362 }
11358 AddCheck(class_ids, target);
11359 return; 11363 return;
11360 } 11364 }
11361 ASSERT(NumArgsTested() >= 0); 11365 ASSERT(NumArgsTested() >= 0);
11362 // Can add only once. 11366 // Can add only once.
11363 const intptr_t old_num = NumberOfChecks(); 11367 const intptr_t old_num = NumberOfChecks();
11364 ASSERT(old_num == 0); 11368 ASSERT(old_num == 0);
11365 Array& data = Array::Handle(ic_data()); 11369 Array& data = Array::Handle(ic_data());
11366 const intptr_t new_len = data.Length() + TestEntryLength(); 11370 const intptr_t new_len = data.Length() + TestEntryLength();
11367 data = Array::Grow(data, new_len, Heap::kOld); 11371 data = Array::Grow(data, new_len, Heap::kOld);
11368 set_ic_data(data); 11372 set_ic_data(data);
(...skipping 8146 matching lines...) Expand 10 before | Expand all | Expand 10 after
19515 return tag_label.ToCString(); 19519 return tag_label.ToCString();
19516 } 19520 }
19517 19521
19518 19522
19519 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 19523 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
19520 Instance::PrintJSONImpl(stream, ref); 19524 Instance::PrintJSONImpl(stream, ref);
19521 } 19525 }
19522 19526
19523 19527
19524 } // namespace dart 19528 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/method_recognizer.h ('k') | runtime/vm/stub_code.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698