| 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 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 ExecutionAccess access(isolate_); | 495 ExecutionAccess access(isolate_); |
| 496 thread_local_.interrupt_flags_ &= ~static_cast<int>(after_what); | 496 thread_local_.interrupt_flags_ &= ~static_cast<int>(after_what); |
| 497 if (!should_postpone_interrupts(access) && !has_pending_interrupts(access)) { | 497 if (!should_postpone_interrupts(access) && !has_pending_interrupts(access)) { |
| 498 reset_limits(access); | 498 reset_limits(access); |
| 499 } | 499 } |
| 500 } | 500 } |
| 501 | 501 |
| 502 | 502 |
| 503 char* StackGuard::ArchiveStackGuard(char* to) { | 503 char* StackGuard::ArchiveStackGuard(char* to) { |
| 504 ExecutionAccess access(isolate_); | 504 ExecutionAccess access(isolate_); |
| 505 memcpy(to, reinterpret_cast<char*>(&thread_local_), sizeof(ThreadLocal)); | 505 OS::MemCopy(to, reinterpret_cast<char*>(&thread_local_), sizeof(ThreadLocal)); |
| 506 ThreadLocal blank; | 506 ThreadLocal blank; |
| 507 | 507 |
| 508 // Set the stack limits using the old thread_local_. | 508 // Set the stack limits using the old thread_local_. |
| 509 // TODO(isolates): This was the old semantics of constructing a ThreadLocal | 509 // TODO(isolates): This was the old semantics of constructing a ThreadLocal |
| 510 // (as the ctor called SetStackLimits, which looked at the | 510 // (as the ctor called SetStackLimits, which looked at the |
| 511 // current thread_local_ from StackGuard)-- but is this | 511 // current thread_local_ from StackGuard)-- but is this |
| 512 // really what was intended? | 512 // really what was intended? |
| 513 isolate_->heap()->SetStackLimits(); | 513 isolate_->heap()->SetStackLimits(); |
| 514 thread_local_ = blank; | 514 thread_local_ = blank; |
| 515 | 515 |
| 516 return to + sizeof(ThreadLocal); | 516 return to + sizeof(ThreadLocal); |
| 517 } | 517 } |
| 518 | 518 |
| 519 | 519 |
| 520 char* StackGuard::RestoreStackGuard(char* from) { | 520 char* StackGuard::RestoreStackGuard(char* from) { |
| 521 ExecutionAccess access(isolate_); | 521 ExecutionAccess access(isolate_); |
| 522 memcpy(reinterpret_cast<char*>(&thread_local_), from, sizeof(ThreadLocal)); | 522 OS::MemCopy( |
| 523 reinterpret_cast<char*>(&thread_local_), from, sizeof(ThreadLocal)); |
| 523 isolate_->heap()->SetStackLimits(); | 524 isolate_->heap()->SetStackLimits(); |
| 524 return from + sizeof(ThreadLocal); | 525 return from + sizeof(ThreadLocal); |
| 525 } | 526 } |
| 526 | 527 |
| 527 | 528 |
| 528 void StackGuard::FreeThreadResources() { | 529 void StackGuard::FreeThreadResources() { |
| 529 Isolate::PerIsolateThreadData* per_thread = | 530 Isolate::PerIsolateThreadData* per_thread = |
| 530 isolate_->FindOrAllocatePerThreadDataForThisThread(); | 531 isolate_->FindOrAllocatePerThreadDataForThisThread(); |
| 531 per_thread->set_stack_limit(thread_local_.real_climit_); | 532 per_thread->set_stack_limit(thread_local_.real_climit_); |
| 532 } | 533 } |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 913 } | 914 } |
| 914 if (stack_guard->IsFullDeopt()) { | 915 if (stack_guard->IsFullDeopt()) { |
| 915 stack_guard->Continue(FULL_DEOPT); | 916 stack_guard->Continue(FULL_DEOPT); |
| 916 Deoptimizer::DeoptimizeAll(isolate); | 917 Deoptimizer::DeoptimizeAll(isolate); |
| 917 } | 918 } |
| 918 return isolate->heap()->undefined_value(); | 919 return isolate->heap()->undefined_value(); |
| 919 } | 920 } |
| 920 | 921 |
| 921 | 922 |
| 922 } } // namespace v8::internal | 923 } } // namespace v8::internal |
| OLD | NEW |