| OLD | NEW |
| 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/isolate.h" | 5 #include "vm/isolate.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 "lib/mirrors.h" | 9 #include "lib/mirrors.h" |
| 10 #include "vm/compiler_stats.h" | 10 #include "vm/compiler_stats.h" |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 MutexLocker ml(mutex_); | 298 MutexLocker ml(mutex_); |
| 299 if (stack_limit_ == saved_stack_limit_) { | 299 if (stack_limit_ == saved_stack_limit_) { |
| 300 return 0; // No interrupt was requested. | 300 return 0; // No interrupt was requested. |
| 301 } | 301 } |
| 302 uword interrupt_bits = stack_limit_ & kInterruptsMask; | 302 uword interrupt_bits = stack_limit_ & kInterruptsMask; |
| 303 stack_limit_ = saved_stack_limit_; | 303 stack_limit_ = saved_stack_limit_; |
| 304 return interrupt_bits; | 304 return interrupt_bits; |
| 305 } | 305 } |
| 306 | 306 |
| 307 | 307 |
| 308 ICData* Isolate::GetICDataForCid(intptr_t cid) const { |
| 309 if (ic_data_array() == Array::null()) { |
| 310 return NULL; |
| 311 } |
| 312 const Array& array_handle = Array::Handle(ic_data_array()); |
| 313 if (cid >= array_handle.Length()) { |
| 314 // For computations being added in the optimizing compiler. |
| 315 return NULL; |
| 316 } |
| 317 ICData& ic_data_handle = ICData::ZoneHandle(); |
| 318 ic_data_handle ^= array_handle.At(cid); |
| 319 return &ic_data_handle; |
| 320 } |
| 321 |
| 322 |
| 308 static int MostUsedFunctionFirst(const Function* const* a, | 323 static int MostUsedFunctionFirst(const Function* const* a, |
| 309 const Function* const* b) { | 324 const Function* const* b) { |
| 310 if ((*a)->usage_counter() > (*b)->usage_counter()) { | 325 if ((*a)->usage_counter() > (*b)->usage_counter()) { |
| 311 return -1; | 326 return -1; |
| 312 } else if ((*a)->usage_counter() < (*b)->usage_counter()) { | 327 } else if ((*a)->usage_counter() < (*b)->usage_counter()) { |
| 313 return 1; | 328 return 1; |
| 314 } else { | 329 } else { |
| 315 return 0; | 330 return 0; |
| 316 } | 331 } |
| 317 } | 332 } |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 | 469 |
| 455 | 470 |
| 456 void Isolate::VisitWeakPersistentHandles(HandleVisitor* visitor, | 471 void Isolate::VisitWeakPersistentHandles(HandleVisitor* visitor, |
| 457 bool visit_prologue_weak_handles) { | 472 bool visit_prologue_weak_handles) { |
| 458 if (api_state() != NULL) { | 473 if (api_state() != NULL) { |
| 459 api_state()->VisitWeakHandles(visitor, visit_prologue_weak_handles); | 474 api_state()->VisitWeakHandles(visitor, visit_prologue_weak_handles); |
| 460 } | 475 } |
| 461 } | 476 } |
| 462 | 477 |
| 463 } // namespace dart | 478 } // namespace dart |
| OLD | NEW |