OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "execution.h" | 5 #include "execution.h" |
6 | 6 |
7 #include "bootstrapper.h" | 7 #include "bootstrapper.h" |
8 #include "codegen.h" | 8 #include "codegen.h" |
9 #include "deoptimizer.h" | 9 #include "deoptimizer.h" |
10 #include "isolate-inl.h" | 10 #include "isolate-inl.h" |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 thread_local_.interrupt_flags_ &= ~flagbit; | 373 thread_local_.interrupt_flags_ &= ~flagbit; |
374 if (!should_postpone_interrupts(lock) && !has_pending_interrupts(lock)) { | 374 if (!should_postpone_interrupts(lock) && !has_pending_interrupts(lock)) { |
375 reset_limits(lock); | 375 reset_limits(lock); |
376 } | 376 } |
377 return result; | 377 return result; |
378 } | 378 } |
379 | 379 |
380 | 380 |
381 char* StackGuard::ArchiveStackGuard(char* to) { | 381 char* StackGuard::ArchiveStackGuard(char* to) { |
382 ExecutionAccess access(isolate_); | 382 ExecutionAccess access(isolate_); |
383 MemCopy(to, reinterpret_cast<char*>(&thread_local_), sizeof(ThreadLocal)); | 383 OS::MemCopy(to, reinterpret_cast<char*>(&thread_local_), sizeof(ThreadLocal)); |
384 ThreadLocal blank; | 384 ThreadLocal blank; |
385 | 385 |
386 // Set the stack limits using the old thread_local_. | 386 // Set the stack limits using the old thread_local_. |
387 // TODO(isolates): This was the old semantics of constructing a ThreadLocal | 387 // TODO(isolates): This was the old semantics of constructing a ThreadLocal |
388 // (as the ctor called SetStackLimits, which looked at the | 388 // (as the ctor called SetStackLimits, which looked at the |
389 // current thread_local_ from StackGuard)-- but is this | 389 // current thread_local_ from StackGuard)-- but is this |
390 // really what was intended? | 390 // really what was intended? |
391 isolate_->heap()->SetStackLimits(); | 391 isolate_->heap()->SetStackLimits(); |
392 thread_local_ = blank; | 392 thread_local_ = blank; |
393 | 393 |
394 return to + sizeof(ThreadLocal); | 394 return to + sizeof(ThreadLocal); |
395 } | 395 } |
396 | 396 |
397 | 397 |
398 char* StackGuard::RestoreStackGuard(char* from) { | 398 char* StackGuard::RestoreStackGuard(char* from) { |
399 ExecutionAccess access(isolate_); | 399 ExecutionAccess access(isolate_); |
400 MemCopy(reinterpret_cast<char*>(&thread_local_), from, sizeof(ThreadLocal)); | 400 OS::MemCopy( |
| 401 reinterpret_cast<char*>(&thread_local_), from, sizeof(ThreadLocal)); |
401 isolate_->heap()->SetStackLimits(); | 402 isolate_->heap()->SetStackLimits(); |
402 return from + sizeof(ThreadLocal); | 403 return from + sizeof(ThreadLocal); |
403 } | 404 } |
404 | 405 |
405 | 406 |
406 void StackGuard::FreeThreadResources() { | 407 void StackGuard::FreeThreadResources() { |
407 Isolate::PerIsolateThreadData* per_thread = | 408 Isolate::PerIsolateThreadData* per_thread = |
408 isolate_->FindOrAllocatePerThreadDataForThisThread(); | 409 isolate_->FindOrAllocatePerThreadDataForThisThread(); |
409 per_thread->set_stack_limit(thread_local_.real_climit_); | 410 per_thread->set_stack_limit(thread_local_.real_climit_); |
410 } | 411 } |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
746 | 747 |
747 if (has_api_interrupt) { | 748 if (has_api_interrupt) { |
748 // Callback must be invoked outside of ExecusionAccess lock. | 749 // Callback must be invoked outside of ExecusionAccess lock. |
749 isolate_->InvokeApiInterruptCallback(); | 750 isolate_->InvokeApiInterruptCallback(); |
750 } | 751 } |
751 | 752 |
752 return isolate_->heap()->undefined_value(); | 753 return isolate_->heap()->undefined_value(); |
753 } | 754 } |
754 | 755 |
755 } } // namespace v8::internal | 756 } } // namespace v8::internal |
OLD | NEW |