| 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 "src/execution.h" | 5 #include "src/execution.h" |
| 6 | 6 |
| 7 #include "src/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
| 8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
| 9 #include "src/deoptimizer.h" | |
| 10 #include "src/isolate-inl.h" | 9 #include "src/isolate-inl.h" |
| 11 #include "src/messages.h" | 10 #include "src/messages.h" |
| 12 #include "src/vm-state-inl.h" | 11 #include "src/vm-state-inl.h" |
| 13 | 12 |
| 14 namespace v8 { | 13 namespace v8 { |
| 15 namespace internal { | 14 namespace internal { |
| 16 | 15 |
| 17 StackGuard::StackGuard() | 16 StackGuard::StackGuard() |
| 18 : isolate_(NULL) { | 17 : isolate_(NULL) { |
| 19 } | 18 } |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 uintptr_t stored_limit = per_thread->stack_limit(); | 413 uintptr_t stored_limit = per_thread->stack_limit(); |
| 415 // You should hold the ExecutionAccess lock when you call this. | 414 // You should hold the ExecutionAccess lock when you call this. |
| 416 if (stored_limit != 0) { | 415 if (stored_limit != 0) { |
| 417 SetStackLimit(stored_limit); | 416 SetStackLimit(stored_limit); |
| 418 } | 417 } |
| 419 } | 418 } |
| 420 | 419 |
| 421 | 420 |
| 422 // --- C a l l s t o n a t i v e s --- | 421 // --- C a l l s t o n a t i v e s --- |
| 423 | 422 |
| 424 #define RETURN_NATIVE_CALL(name, args) \ | |
| 425 do { \ | |
| 426 Handle<Object> argv[] = args; \ | |
| 427 return Call(isolate, isolate->name##_fun(), \ | |
| 428 isolate->factory()->undefined_value(), arraysize(argv), argv); \ | |
| 429 } while (false) | |
| 430 | |
| 431 | |
| 432 MaybeHandle<Object> Execution::NewDate(Isolate* isolate, double time) { | |
| 433 Handle<Object> time_obj = isolate->factory()->NewNumber(time); | |
| 434 RETURN_NATIVE_CALL(create_date, { time_obj }); | |
| 435 } | |
| 436 | |
| 437 | |
| 438 #undef RETURN_NATIVE_CALL | |
| 439 | |
| 440 | 423 |
| 441 MaybeHandle<Object> Execution::ToObject(Isolate* isolate, Handle<Object> obj) { | 424 MaybeHandle<Object> Execution::ToObject(Isolate* isolate, Handle<Object> obj) { |
| 442 Handle<JSReceiver> receiver; | 425 Handle<JSReceiver> receiver; |
| 443 if (JSReceiver::ToObject(isolate, obj).ToHandle(&receiver)) { | 426 if (JSReceiver::ToObject(isolate, obj).ToHandle(&receiver)) { |
| 444 return receiver; | 427 return receiver; |
| 445 } | 428 } |
| 446 THROW_NEW_ERROR( | 429 THROW_NEW_ERROR( |
| 447 isolate, NewTypeError(MessageTemplate::kUndefinedOrNullToObject), Object); | 430 isolate, NewTypeError(MessageTemplate::kUndefinedOrNullToObject), Object); |
| 448 } | 431 } |
| 449 | 432 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 | 490 |
| 508 isolate_->counters()->stack_interrupts()->Increment(); | 491 isolate_->counters()->stack_interrupts()->Increment(); |
| 509 isolate_->counters()->runtime_profiler_ticks()->Increment(); | 492 isolate_->counters()->runtime_profiler_ticks()->Increment(); |
| 510 isolate_->runtime_profiler()->OptimizeNow(); | 493 isolate_->runtime_profiler()->OptimizeNow(); |
| 511 | 494 |
| 512 return isolate_->heap()->undefined_value(); | 495 return isolate_->heap()->undefined_value(); |
| 513 } | 496 } |
| 514 | 497 |
| 515 } // namespace internal | 498 } // namespace internal |
| 516 } // namespace v8 | 499 } // namespace v8 |
| OLD | NEW |