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 1544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1555 } | 1555 } |
1556 #endif // ENABLE_DEBUGGER_SUPPORT | 1556 #endif // ENABLE_DEBUGGER_SUPPORT |
1557 if (it.done()) return Handle<Context>::null(); | 1557 if (it.done()) return Handle<Context>::null(); |
1558 JavaScriptFrame* frame = it.frame(); | 1558 JavaScriptFrame* frame = it.frame(); |
1559 Context* context = Context::cast(frame->context()); | 1559 Context* context = Context::cast(frame->context()); |
1560 return Handle<Context>(context->native_context()); | 1560 return Handle<Context>(context->native_context()); |
1561 } | 1561 } |
1562 | 1562 |
1563 | 1563 |
1564 char* Isolate::ArchiveThread(char* to) { | 1564 char* Isolate::ArchiveThread(char* to) { |
1565 memcpy(to, reinterpret_cast<char*>(thread_local_top()), | 1565 OS::MemCopy(to, reinterpret_cast<char*>(thread_local_top()), |
1566 sizeof(ThreadLocalTop)); | 1566 sizeof(ThreadLocalTop)); |
1567 InitializeThreadLocal(); | 1567 InitializeThreadLocal(); |
1568 clear_pending_exception(); | 1568 clear_pending_exception(); |
1569 clear_pending_message(); | 1569 clear_pending_message(); |
1570 clear_scheduled_exception(); | 1570 clear_scheduled_exception(); |
1571 return to + sizeof(ThreadLocalTop); | 1571 return to + sizeof(ThreadLocalTop); |
1572 } | 1572 } |
1573 | 1573 |
1574 | 1574 |
1575 char* Isolate::RestoreThread(char* from) { | 1575 char* Isolate::RestoreThread(char* from) { |
1576 memcpy(reinterpret_cast<char*>(thread_local_top()), from, | 1576 OS::MemCopy(reinterpret_cast<char*>(thread_local_top()), from, |
1577 sizeof(ThreadLocalTop)); | 1577 sizeof(ThreadLocalTop)); |
1578 // This might be just paranoia, but it seems to be needed in case a | 1578 // This might be just paranoia, but it seems to be needed in case a |
1579 // thread_local_top_ is restored on a separate OS thread. | 1579 // thread_local_top_ is restored on a separate OS thread. |
1580 #ifdef USE_SIMULATOR | 1580 #ifdef USE_SIMULATOR |
1581 #ifdef V8_TARGET_ARCH_ARM | 1581 #ifdef V8_TARGET_ARCH_ARM |
1582 thread_local_top()->simulator_ = Simulator::current(this); | 1582 thread_local_top()->simulator_ = Simulator::current(this); |
1583 #elif V8_TARGET_ARCH_MIPS | 1583 #elif V8_TARGET_ARCH_MIPS |
1584 thread_local_top()->simulator_ = Simulator::current(this); | 1584 thread_local_top()->simulator_ = Simulator::current(this); |
1585 #endif | 1585 #endif |
1586 #endif | 1586 #endif |
1587 ASSERT(context() == NULL || context()->IsContext()); | 1587 ASSERT(context() == NULL || context()->IsContext()); |
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2407 | 2407 |
2408 #ifdef DEBUG | 2408 #ifdef DEBUG |
2409 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 2409 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
2410 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); | 2410 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); |
2411 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 2411 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
2412 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 2412 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
2413 #undef ISOLATE_FIELD_OFFSET | 2413 #undef ISOLATE_FIELD_OFFSET |
2414 #endif | 2414 #endif |
2415 | 2415 |
2416 } } // namespace v8::internal | 2416 } } // namespace v8::internal |
OLD | NEW |