| 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/stack_frame.h" | 5 #include "vm/stack_frame.h" |
| 6 | 6 |
| 7 #include "vm/assembler.h" | 7 #include "vm/assembler.h" |
| 8 #include "vm/deopt_instructions.h" | 8 #include "vm/deopt_instructions.h" |
| 9 #include "vm/isolate.h" | 9 #include "vm/isolate.h" |
| 10 #include "vm/object.h" | 10 #include "vm/object.h" |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 | 261 |
| 262 bool StackFrame::IsValid() const { | 262 bool StackFrame::IsValid() const { |
| 263 if (IsEntryFrame() || IsExitFrame() || IsStubFrame()) { | 263 if (IsEntryFrame() || IsExitFrame() || IsStubFrame()) { |
| 264 return true; | 264 return true; |
| 265 } | 265 } |
| 266 return (LookupDartCode() != Code::null()); | 266 return (LookupDartCode() != Code::null()); |
| 267 } | 267 } |
| 268 | 268 |
| 269 | 269 |
| 270 void StackFrameIterator::SetupLastExitFrameData() { | 270 void StackFrameIterator::SetupLastExitFrameData() { |
| 271 Isolate* current = Isolate::Current(); | 271 uword exit_marker = isolate_->top_exit_frame_info(); |
| 272 uword exit_marker = current->top_exit_frame_info(); | |
| 273 frames_.fp_ = exit_marker; | 272 frames_.fp_ = exit_marker; |
| 274 } | 273 } |
| 275 | 274 |
| 276 | 275 |
| 277 void StackFrameIterator::SetupNextExitFrameData() { | 276 void StackFrameIterator::SetupNextExitFrameData() { |
| 278 uword exit_address = entry_.fp() + (kExitLinkSlotFromEntryFp * kWordSize); | 277 uword exit_address = entry_.fp() + (kExitLinkSlotFromEntryFp * kWordSize); |
| 279 uword exit_marker = *reinterpret_cast<uword*>(exit_address); | 278 uword exit_marker = *reinterpret_cast<uword*>(exit_address); |
| 280 frames_.fp_ = exit_marker; | 279 frames_.fp_ = exit_marker; |
| 281 frames_.sp_ = 0; | 280 frames_.sp_ = 0; |
| 282 frames_.pc_ = 0; | 281 frames_.pc_ = 0; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 ASSERT((validate_ == kDontValidateFrames) || current_frame_->IsValid()); | 360 ASSERT((validate_ == kDontValidateFrames) || current_frame_->IsValid()); |
| 362 if (current_frame_->IsEntryFrame()) { | 361 if (current_frame_->IsEntryFrame()) { |
| 363 if (HasNextFrame()) { // We have another chained block. | 362 if (HasNextFrame()) { // We have another chained block. |
| 364 current_frame_ = NextExitFrame(); | 363 current_frame_ = NextExitFrame(); |
| 365 return current_frame_; | 364 return current_frame_; |
| 366 } | 365 } |
| 367 current_frame_ = NULL; // No more frames. | 366 current_frame_ = NULL; // No more frames. |
| 368 return current_frame_; | 367 return current_frame_; |
| 369 } | 368 } |
| 370 ASSERT(current_frame_->IsExitFrame() || | 369 ASSERT(current_frame_->IsExitFrame() || |
| 371 current_frame_->IsDartFrame() || | 370 current_frame_->IsDartFrame(validate_) || |
| 372 current_frame_->IsStubFrame()); | 371 current_frame_->IsStubFrame()); |
| 373 | 372 |
| 374 // Consume dart/stub frames using StackFrameIterator::FrameSetIterator | 373 // Consume dart/stub frames using StackFrameIterator::FrameSetIterator |
| 375 // until we are out of dart/stub frames at which point we return the | 374 // until we are out of dart/stub frames at which point we return the |
| 376 // corresponding entry frame for that set of dart/stub frames. | 375 // corresponding entry frame for that set of dart/stub frames. |
| 377 current_frame_ = | 376 current_frame_ = |
| 378 (frames_.HasNext()) ? frames_.NextFrame(validate_) : NextEntryFrame(); | 377 (frames_.HasNext()) ? frames_.NextFrame(validate_) : NextEntryFrame(); |
| 379 return current_frame_; | 378 return current_frame_; |
| 380 } | 379 } |
| 381 | 380 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 if (deopt_instr->kind() == DeoptInstr::kCallerFp) { | 482 if (deopt_instr->kind() == DeoptInstr::kCallerFp) { |
| 484 return (index - num_materializations_); | 483 return (index - num_materializations_); |
| 485 } | 484 } |
| 486 } | 485 } |
| 487 UNREACHABLE(); | 486 UNREACHABLE(); |
| 488 return 0; | 487 return 0; |
| 489 } | 488 } |
| 490 | 489 |
| 491 | 490 |
| 492 } // namespace dart | 491 } // namespace dart |
| OLD | NEW |