| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1549 } | 1549 } |
| 1550 #endif // ENABLE_DEBUGGER_SUPPORT | 1550 #endif // ENABLE_DEBUGGER_SUPPORT |
| 1551 if (it.done()) return Handle<Context>::null(); | 1551 if (it.done()) return Handle<Context>::null(); |
| 1552 JavaScriptFrame* frame = it.frame(); | 1552 JavaScriptFrame* frame = it.frame(); |
| 1553 Context* context = Context::cast(frame->context()); | 1553 Context* context = Context::cast(frame->context()); |
| 1554 return Handle<Context>(context->native_context()); | 1554 return Handle<Context>(context->native_context()); |
| 1555 } | 1555 } |
| 1556 | 1556 |
| 1557 | 1557 |
| 1558 char* Isolate::ArchiveThread(char* to) { | 1558 char* Isolate::ArchiveThread(char* to) { |
| 1559 if (RuntimeProfiler::IsEnabled() && current_vm_state() == JS) { | |
| 1560 RuntimeProfiler::IsolateExitedJS(this); | |
| 1561 } | |
| 1562 memcpy(to, reinterpret_cast<char*>(thread_local_top()), | 1559 memcpy(to, reinterpret_cast<char*>(thread_local_top()), |
| 1563 sizeof(ThreadLocalTop)); | 1560 sizeof(ThreadLocalTop)); |
| 1564 InitializeThreadLocal(); | 1561 InitializeThreadLocal(); |
| 1565 clear_pending_exception(); | 1562 clear_pending_exception(); |
| 1566 clear_pending_message(); | 1563 clear_pending_message(); |
| 1567 clear_scheduled_exception(); | 1564 clear_scheduled_exception(); |
| 1568 return to + sizeof(ThreadLocalTop); | 1565 return to + sizeof(ThreadLocalTop); |
| 1569 } | 1566 } |
| 1570 | 1567 |
| 1571 | 1568 |
| 1572 char* Isolate::RestoreThread(char* from) { | 1569 char* Isolate::RestoreThread(char* from) { |
| 1573 memcpy(reinterpret_cast<char*>(thread_local_top()), from, | 1570 memcpy(reinterpret_cast<char*>(thread_local_top()), from, |
| 1574 sizeof(ThreadLocalTop)); | 1571 sizeof(ThreadLocalTop)); |
| 1575 // This might be just paranoia, but it seems to be needed in case a | 1572 // This might be just paranoia, but it seems to be needed in case a |
| 1576 // thread_local_top_ is restored on a separate OS thread. | 1573 // thread_local_top_ is restored on a separate OS thread. |
| 1577 #ifdef USE_SIMULATOR | 1574 #ifdef USE_SIMULATOR |
| 1578 #ifdef V8_TARGET_ARCH_ARM | 1575 #ifdef V8_TARGET_ARCH_ARM |
| 1579 thread_local_top()->simulator_ = Simulator::current(this); | 1576 thread_local_top()->simulator_ = Simulator::current(this); |
| 1580 #elif V8_TARGET_ARCH_MIPS | 1577 #elif V8_TARGET_ARCH_MIPS |
| 1581 thread_local_top()->simulator_ = Simulator::current(this); | 1578 thread_local_top()->simulator_ = Simulator::current(this); |
| 1582 #endif | 1579 #endif |
| 1583 #endif | 1580 #endif |
| 1584 if (RuntimeProfiler::IsEnabled() && current_vm_state() == JS) { | |
| 1585 RuntimeProfiler::IsolateEnteredJS(this); | |
| 1586 } | |
| 1587 ASSERT(context() == NULL || context()->IsContext()); | 1581 ASSERT(context() == NULL || context()->IsContext()); |
| 1588 return from + sizeof(ThreadLocalTop); | 1582 return from + sizeof(ThreadLocalTop); |
| 1589 } | 1583 } |
| 1590 | 1584 |
| 1591 | 1585 |
| 1592 Isolate::ThreadDataTable::ThreadDataTable() | 1586 Isolate::ThreadDataTable::ThreadDataTable() |
| 1593 : list_(NULL) { | 1587 : list_(NULL) { |
| 1594 } | 1588 } |
| 1595 | 1589 |
| 1596 | 1590 |
| (...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2407 | 2401 |
| 2408 #ifdef DEBUG | 2402 #ifdef DEBUG |
| 2409 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 2403 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
| 2410 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); | 2404 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); |
| 2411 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 2405 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
| 2412 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 2406 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
| 2413 #undef ISOLATE_FIELD_OFFSET | 2407 #undef ISOLATE_FIELD_OFFSET |
| 2414 #endif | 2408 #endif |
| 2415 | 2409 |
| 2416 } } // namespace v8::internal | 2410 } } // namespace v8::internal |
| OLD | NEW |