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

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

Issue 17723002: Remove skip_static_calls_ as it uses an obsolete way to check for uncalled static calls. Will be re… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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/object.h ('k') | no next file » | 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 7293 matching lines...) Expand 10 before | Expand all | Expand 10 after
7304 NoGCScope no_gc; 7304 NoGCScope no_gc;
7305 result ^= raw; 7305 result ^= raw;
7306 result.SetLength(num_descriptors); 7306 result.SetLength(num_descriptors);
7307 } 7307 }
7308 return result.raw(); 7308 return result.raw();
7309 } 7309 }
7310 7310
7311 7311
7312 const char* PcDescriptors::KindAsStr(intptr_t index) const { 7312 const char* PcDescriptors::KindAsStr(intptr_t index) const {
7313 switch (DescriptorKind(index)) { 7313 switch (DescriptorKind(index)) {
7314 case PcDescriptors::kDeopt: return "deopt "; 7314 case PcDescriptors::kDeopt: return "deopt ";
7315 case PcDescriptors::kEntryPatch: return "entry-patch "; 7315 case PcDescriptors::kEntryPatch: return "entry-patch ";
7316 case PcDescriptors::kPatchCode: return "patch "; 7316 case PcDescriptors::kPatchCode: return "patch ";
7317 case PcDescriptors::kLazyDeoptJump: return "lazy-deopt "; 7317 case PcDescriptors::kLazyDeoptJump: return "lazy-deopt ";
7318 case PcDescriptors::kIcCall: return "ic-call "; 7318 case PcDescriptors::kIcCall: return "ic-call ";
7319 case PcDescriptors::kFuncCall: return "fn-call "; 7319 case PcDescriptors::kOptStaticCall: return "opt-call ";
7320 case PcDescriptors::kClosureCall: return "closure-call "; 7320 case PcDescriptors::kUnoptStaticCall: return "unopt-call ";
7321 case PcDescriptors::kReturn: return "return "; 7321 case PcDescriptors::kClosureCall: return "closure-call ";
7322 case PcDescriptors::kRuntimeCall: return "runtime-call "; 7322 case PcDescriptors::kReturn: return "return ";
7323 case PcDescriptors::kOsrEntry: return "osr-entry "; 7323 case PcDescriptors::kRuntimeCall: return "runtime-call ";
7324 case PcDescriptors::kOther: return "other "; 7324 case PcDescriptors::kOsrEntry: return "osr-entry ";
7325 case PcDescriptors::kOther: return "other ";
7325 } 7326 }
7326 UNREACHABLE(); 7327 UNREACHABLE();
7327 return ""; 7328 return "";
7328 } 7329 }
7329 7330
7330 7331
7331 void PcDescriptors::PrintHeaderString() { 7332 void PcDescriptors::PrintHeaderString() {
7332 // 4 bits per hex digit + 2 for "0x". 7333 // 4 bits per hex digit + 2 for "0x".
7333 const int addr_width = (kBitsPerWord / 4) + 2; 7334 const int addr_width = (kBitsPerWord / 4) + 2;
7334 // "*" in a printf format specifier tells it to read the field width from 7335 // "*" in a printf format specifier tells it to read the field width from
(...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after
8235 intptr_t Code::ExtractIcDataArraysAtCalls( 8236 intptr_t Code::ExtractIcDataArraysAtCalls(
8236 GrowableArray<intptr_t>* node_ids, 8237 GrowableArray<intptr_t>* node_ids,
8237 const GrowableObjectArray& ic_data_objs) const { 8238 const GrowableObjectArray& ic_data_objs) const {
8238 ASSERT(node_ids != NULL); 8239 ASSERT(node_ids != NULL);
8239 ASSERT(!ic_data_objs.IsNull()); 8240 ASSERT(!ic_data_objs.IsNull());
8240 const PcDescriptors& descriptors = 8241 const PcDescriptors& descriptors =
8241 PcDescriptors::Handle(this->pc_descriptors()); 8242 PcDescriptors::Handle(this->pc_descriptors());
8242 ICData& ic_data_obj = ICData::Handle(); 8243 ICData& ic_data_obj = ICData::Handle();
8243 intptr_t max_id = -1; 8244 intptr_t max_id = -1;
8244 for (intptr_t i = 0; i < descriptors.Length(); i++) { 8245 for (intptr_t i = 0; i < descriptors.Length(); i++) {
8245 if (descriptors.DescriptorKind(i) == PcDescriptors::kIcCall) { 8246 PcDescriptors::Kind kind = descriptors.DescriptorKind(i);
8247 if ((kind == PcDescriptors::kIcCall) ||
8248 (kind == PcDescriptors::kUnoptStaticCall)) {
8246 intptr_t deopt_id = descriptors.DeoptId(i); 8249 intptr_t deopt_id = descriptors.DeoptId(i);
8247 if (deopt_id > max_id) { 8250 if (deopt_id > max_id) {
8248 max_id = deopt_id; 8251 max_id = deopt_id;
8249 } 8252 }
8250 node_ids->Add(deopt_id); 8253 node_ids->Add(deopt_id);
8251 CodePatcher::GetInstanceCallAt(descriptors.PC(i), *this, &ic_data_obj); 8254 uword ret_addr = descriptors.PC(i);
8255 if (kind == PcDescriptors::kIcCall) {
8256 CodePatcher::GetInstanceCallAt(ret_addr, *this, &ic_data_obj);
8257 } else {
8258 CodePatcher::GetUnoptimizedStaticCallAt(ret_addr, *this, &ic_data_obj);
8259 }
8252 ic_data_objs.Add(ic_data_obj); 8260 ic_data_objs.Add(ic_data_obj);
8253 } 8261 }
8254 } 8262 }
8255 return max_id; 8263 return max_id;
8256 } 8264 }
8257 8265
8258 8266
8259 RawArray* Code::ExtractTypeFeedbackArray() const { 8267 RawArray* Code::ExtractTypeFeedbackArray() const {
8260 ASSERT(!IsNull() && !is_optimized()); 8268 ASSERT(!IsNull() && !is_optimized());
8261 GrowableArray<intptr_t> deopt_ids; 8269 GrowableArray<intptr_t> deopt_ids;
8262 const GrowableObjectArray& ic_data_objs = 8270 const GrowableObjectArray& ic_data_objs =
8263 GrowableObjectArray::Handle(GrowableObjectArray::New()); 8271 GrowableObjectArray::Handle(GrowableObjectArray::New());
8264 const intptr_t max_id = 8272 const intptr_t max_id =
8265 ExtractIcDataArraysAtCalls(&deopt_ids, ic_data_objs); 8273 ExtractIcDataArraysAtCalls(&deopt_ids, ic_data_objs);
8266 const Array& result = Array::Handle(Array::New(max_id + 1)); 8274 const Array& result = Array::Handle(Array::New(max_id + 1));
8267 for (intptr_t i = 0; i < deopt_ids.length(); i++) { 8275 for (intptr_t i = 0; i < deopt_ids.length(); i++) {
8268 intptr_t result_index = deopt_ids[i]; 8276 intptr_t result_index = deopt_ids[i];
8269 ASSERT(result.At(result_index) == Object::null()); 8277 ASSERT(result.At(result_index) == Object::null());
8270 result.SetAt(result_index, Object::Handle(ic_data_objs.At(i))); 8278 result.SetAt(result_index, Object::Handle(ic_data_objs.At(i)));
8271 } 8279 }
8272 return result.raw(); 8280 return result.raw();
8273 } 8281 }
8274 8282
8275 8283
8276 void Code::ExtractUncalledStaticCallDeoptIds(
8277 GrowableArray<intptr_t>* deopt_ids) const {
8278 ASSERT(!IsNull() && !is_optimized());
8279 ASSERT(deopt_ids != NULL);
8280 deopt_ids->Clear();
8281 const PcDescriptors& descriptors =
8282 PcDescriptors::Handle(this->pc_descriptors());
8283 for (intptr_t i = 0; i < descriptors.Length(); i++) {
8284 if (descriptors.DescriptorKind(i) == PcDescriptors::kFuncCall) {
8285 // Static call.
8286 const uword target_addr =
8287 CodePatcher::GetStaticCallTargetAt(descriptors.PC(i), *this);
8288 if (target_addr == StubCode::CallStaticFunctionEntryPoint()) {
8289 deopt_ids->Add(descriptors.DeoptId(i));
8290 }
8291 }
8292 }
8293 }
8294
8295
8296 RawStackmap* Code::GetStackmap(uword pc, Array* maps, Stackmap* map) const { 8284 RawStackmap* Code::GetStackmap(uword pc, Array* maps, Stackmap* map) const {
8297 // This code is used during iterating frames during a GC and hence it 8285 // This code is used during iterating frames during a GC and hence it
8298 // should not in turn start a GC. 8286 // should not in turn start a GC.
8299 NoGCScope no_gc; 8287 NoGCScope no_gc;
8300 if (stackmaps() == Array::null()) { 8288 if (stackmaps() == Array::null()) {
8301 // No stack maps are present in the code object which means this 8289 // No stack maps are present in the code object which means this
8302 // frame relies on tagged pointers. 8290 // frame relies on tagged pointers.
8303 return Stackmap::null(); 8291 return Stackmap::null();
8304 } 8292 }
8305 // A stack map is present in the code object, use the stack map to visit 8293 // A stack map is present in the code object, use the stack map to visit
(...skipping 5370 matching lines...) Expand 10 before | Expand all | Expand 10 after
13676 space); 13664 space);
13677 return reinterpret_cast<RawWeakProperty*>(raw); 13665 return reinterpret_cast<RawWeakProperty*>(raw);
13678 } 13666 }
13679 13667
13680 13668
13681 const char* WeakProperty::ToCString() const { 13669 const char* WeakProperty::ToCString() const {
13682 return "_WeakProperty"; 13670 return "_WeakProperty";
13683 } 13671 }
13684 13672
13685 } // namespace dart 13673 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698