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

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

Issue 11361225: In optimized code use IC calls for instance calls that have no IC data instead of deoptimizing. The… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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/object.h ('k') | runtime/vm/raw_object.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/bigint_operations.h" 10 #include "vm/bigint_operations.h"
(...skipping 7432 matching lines...) Expand 10 before | Expand all | Expand 10 after
7443 7443
7444 void ICData::set_ic_data(const Array& value) const { 7444 void ICData::set_ic_data(const Array& value) const {
7445 StorePointer(&raw_ptr()->ic_data_, value.raw()); 7445 StorePointer(&raw_ptr()->ic_data_, value.raw());
7446 } 7446 }
7447 7447
7448 7448
7449 void ICData::set_deopt_reason(intptr_t deopt_reason) const { 7449 void ICData::set_deopt_reason(intptr_t deopt_reason) const {
7450 raw_ptr()->deopt_reason_ = deopt_reason; 7450 raw_ptr()->deopt_reason_ = deopt_reason;
7451 } 7451 }
7452 7452
7453 void ICData::set_is_closure_call(bool value) const {
7454 raw_ptr()->is_closure_call_ = value ? 1 : 0;
7455 }
7456
7453 7457
7454 intptr_t ICData::TestEntryLength() const { 7458 intptr_t ICData::TestEntryLength() const {
7455 return num_args_tested() + 1 /* target function*/; 7459 return num_args_tested() + 1 /* target function*/;
7456 } 7460 }
7457 7461
7458 7462
7459 intptr_t ICData::NumberOfChecks() const { 7463 intptr_t ICData::NumberOfChecks() const {
7460 // Do not count the sentinel; 7464 // Do not count the sentinel;
7461 return (Array::Handle(ic_data()).Length() / TestEntryLength()) - 1; 7465 return (Array::Handle(ic_data()).Length() / TestEntryLength()) - 1;
7462 } 7466 }
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
7719 ICData::InstanceSize(), 7723 ICData::InstanceSize(),
7720 Heap::kOld); 7724 Heap::kOld);
7721 NoGCScope no_gc; 7725 NoGCScope no_gc;
7722 result ^= raw; 7726 result ^= raw;
7723 } 7727 }
7724 result.set_function(function); 7728 result.set_function(function);
7725 result.set_target_name(target_name); 7729 result.set_target_name(target_name);
7726 result.set_deopt_id(deopt_id); 7730 result.set_deopt_id(deopt_id);
7727 result.set_num_args_tested(num_args_tested); 7731 result.set_num_args_tested(num_args_tested);
7728 result.set_deopt_reason(kDeoptUnknown); 7732 result.set_deopt_reason(kDeoptUnknown);
7733 result.set_is_closure_call(false);
7729 // Number of array elements in one test entry (num_args_tested + 1) 7734 // Number of array elements in one test entry (num_args_tested + 1)
7730 intptr_t len = result.TestEntryLength(); 7735 intptr_t len = result.TestEntryLength();
7731 // IC data array must be null terminated (sentinel entry). 7736 // IC data array must be null terminated (sentinel entry).
7732 const Array& ic_data = Array::Handle(Array::New(len, Heap::kOld)); 7737 const Array& ic_data = Array::Handle(Array::New(len, Heap::kOld));
7733 result.set_ic_data(ic_data); 7738 result.set_ic_data(ic_data);
7734 result.WriteSentinel(); 7739 result.WriteSentinel();
7735 return result.raw(); 7740 return result.raw();
7736 } 7741 }
7737 7742
7738 7743
(...skipping 4244 matching lines...) Expand 10 before | Expand all | Expand 10 after
11983 } 11988 }
11984 return result.raw(); 11989 return result.raw();
11985 } 11990 }
11986 11991
11987 11992
11988 const char* WeakProperty::ToCString() const { 11993 const char* WeakProperty::ToCString() const {
11989 return "_WeakProperty"; 11994 return "_WeakProperty";
11990 } 11995 }
11991 11996
11992 } // namespace dart 11997 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698