OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 ASSERT(thread->stack_is_cooked()); | 339 ASSERT(thread->stack_is_cooked()); |
340 for (StackFrameIterator it(thread); !it.done(); it.Advance()) { | 340 for (StackFrameIterator it(thread); !it.done(); it.Advance()) { |
341 it.frame()->Uncook(); | 341 it.frame()->Uncook(); |
342 } | 342 } |
343 thread->set_stack_is_cooked(false); | 343 thread->set_stack_is_cooked(false); |
344 } | 344 } |
345 | 345 |
346 | 346 |
347 void StackFrame::Cook() { | 347 void StackFrame::Cook() { |
348 Code* code = this->code(); | 348 Code* code = this->code(); |
| 349 ASSERT(code->IsCode()); |
349 for (StackHandlerIterator it(this, top_handler()); !it.done(); it.Advance()) { | 350 for (StackHandlerIterator it(this, top_handler()); !it.done(); it.Advance()) { |
350 it.handler()->Cook(code); | 351 it.handler()->Cook(code); |
351 } | 352 } |
352 ASSERT(code->contains(pc())); | 353 ASSERT(code->contains(pc())); |
353 set_pc(AddressFrom<Address>(pc() - code->instruction_start())); | 354 set_pc(AddressFrom<Address>(pc() - code->instruction_start())); |
354 } | 355 } |
355 | 356 |
356 | 357 |
357 void StackFrame::Uncook() { | 358 void StackFrame::Uncook() { |
358 Code* code = this->code(); | 359 Code* code = this->code(); |
| 360 ASSERT(code->IsCode()); |
359 for (StackHandlerIterator it(this, top_handler()); !it.done(); it.Advance()) { | 361 for (StackHandlerIterator it(this, top_handler()); !it.done(); it.Advance()) { |
360 it.handler()->Uncook(code); | 362 it.handler()->Uncook(code); |
361 } | 363 } |
362 set_pc(code->instruction_start() + OffsetFrom(pc())); | 364 set_pc(code->instruction_start() + OffsetFrom(pc())); |
363 ASSERT(code->contains(pc())); | 365 ASSERT(code->contains(pc())); |
364 } | 366 } |
365 | 367 |
366 | 368 |
367 StackFrame::Type StackFrame::GetCallerState(State* state) const { | 369 StackFrame::Type StackFrame::GetCallerState(State* state) const { |
368 ComputeCallerState(state); | 370 ComputeCallerState(state); |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
759 reg_code[i++] = r; | 761 reg_code[i++] = r; |
760 | 762 |
761 ASSERT(i == kNumJSCallerSaved); | 763 ASSERT(i == kNumJSCallerSaved); |
762 } | 764 } |
763 ASSERT(0 <= n && n < kNumJSCallerSaved); | 765 ASSERT(0 <= n && n < kNumJSCallerSaved); |
764 return reg_code[n]; | 766 return reg_code[n]; |
765 } | 767 } |
766 | 768 |
767 | 769 |
768 } } // namespace v8::internal | 770 } } // namespace v8::internal |
OLD | NEW |