Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
| 2 // All Rights Reserved. | 2 // All Rights Reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // met: |
| 7 // | 7 // |
| 8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
| 9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
| 10 // | 10 // |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 494 // Handle<Value> f(v8::Arguments&) | 494 // Handle<Value> f(v8::Arguments&) |
| 495 DIRECT_API_CALL, | 495 DIRECT_API_CALL, |
| 496 | 496 |
| 497 // Direct call to accessor getter callback. | 497 // Direct call to accessor getter callback. |
| 498 // Handle<value> f(Local<String> property, AccessorInfo& info) | 498 // Handle<value> f(Local<String> property, AccessorInfo& info) |
| 499 DIRECT_GETTER_CALL | 499 DIRECT_GETTER_CALL |
| 500 }; | 500 }; |
| 501 | 501 |
| 502 typedef void* ExternalReferenceRedirector(void* original, Type type); | 502 typedef void* ExternalReferenceRedirector(void* original, Type type); |
| 503 | 503 |
| 504 explicit ExternalReference(Builtins::CFunctionId id); | 504 explicit ExternalReference(Builtins::CFunctionId id, Isolate* isolate); |
|
Vitaly Repeshko
2011/03/21 17:06:57
I think these should be moved to some class that a
Mads Ager (chromium)
2011/03/22 08:42:37
I sort of agree. However, looking into it more, ex
| |
| 505 | 505 |
| 506 explicit ExternalReference(ApiFunction* ptr, Type type); | 506 explicit ExternalReference(ApiFunction* ptr, Type type, Isolate* isolate); |
| 507 | 507 |
| 508 explicit ExternalReference(Builtins::Name name); | 508 explicit ExternalReference(Builtins::Name name, Isolate* isolate); |
| 509 | 509 |
| 510 explicit ExternalReference(Runtime::FunctionId id); | 510 explicit ExternalReference(Runtime::FunctionId id, Isolate* isolate); |
| 511 | 511 |
| 512 explicit ExternalReference(const Runtime::Function* f); | 512 explicit ExternalReference(const Runtime::Function* f, Isolate* isolate); |
| 513 | 513 |
| 514 explicit ExternalReference(const IC_Utility& ic_utility); | 514 explicit ExternalReference(const IC_Utility& ic_utility, Isolate* isolate); |
| 515 | 515 |
| 516 #ifdef ENABLE_DEBUGGER_SUPPORT | 516 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 517 explicit ExternalReference(const Debug_Address& debug_address); | 517 explicit ExternalReference(const Debug_Address& debug_address, |
| 518 Isolate* isolate); | |
| 518 #endif | 519 #endif |
| 519 | 520 |
| 520 explicit ExternalReference(StatsCounter* counter); | 521 explicit ExternalReference(StatsCounter* counter); |
| 521 | 522 |
| 522 explicit ExternalReference(Isolate::AddressId id); | 523 explicit ExternalReference(Isolate::AddressId id, Isolate* isolate); |
| 523 | 524 |
| 524 explicit ExternalReference(const SCTableReference& table_ref); | 525 explicit ExternalReference(const SCTableReference& table_ref); |
| 525 | 526 |
| 526 // Isolate::Current() as an external reference. | 527 // Isolate::Current() as an external reference. |
| 527 static ExternalReference isolate_address(); | 528 static ExternalReference isolate_address(); |
| 528 | 529 |
| 529 // One-of-a-kind references. These references are not part of a general | 530 // One-of-a-kind references. These references are not part of a general |
| 530 // pattern. This means that they have to be added to the | 531 // pattern. This means that they have to be added to the |
| 531 // ExternalReferenceTable in serialize.cc manually. | 532 // ExternalReferenceTable in serialize.cc manually. |
| 532 | 533 |
| 533 static ExternalReference perform_gc_function(); | 534 static ExternalReference perform_gc_function(Isolate* isolate); |
| 534 static ExternalReference fill_heap_number_with_random_function(); | 535 static ExternalReference fill_heap_number_with_random_function( |
| 535 static ExternalReference random_uint32_function(); | 536 Isolate* isolate); |
| 536 static ExternalReference transcendental_cache_array_address(); | 537 static ExternalReference random_uint32_function(Isolate* isolate); |
| 537 static ExternalReference delete_handle_scope_extensions(); | 538 static ExternalReference transcendental_cache_array_address(Isolate* isolate); |
| 539 static ExternalReference delete_handle_scope_extensions(Isolate* isolate); | |
| 538 | 540 |
| 539 // Deoptimization support. | 541 // Deoptimization support. |
| 540 static ExternalReference new_deoptimizer_function(); | 542 static ExternalReference new_deoptimizer_function(Isolate* isolate); |
| 541 static ExternalReference compute_output_frames_function(); | 543 static ExternalReference compute_output_frames_function(Isolate* isolate); |
| 542 static ExternalReference global_contexts_list(); | 544 static ExternalReference global_contexts_list(Isolate* isolate); |
| 543 | 545 |
| 544 // Static data in the keyed lookup cache. | 546 // Static data in the keyed lookup cache. |
| 545 static ExternalReference keyed_lookup_cache_keys(); | 547 static ExternalReference keyed_lookup_cache_keys(Isolate* isolate); |
| 546 static ExternalReference keyed_lookup_cache_field_offsets(); | 548 static ExternalReference keyed_lookup_cache_field_offsets(Isolate* isolate); |
| 547 | 549 |
| 548 // Static variable Factory::the_hole_value.location() | 550 // Static variable Factory::the_hole_value.location() |
| 549 static ExternalReference the_hole_value_location(); | 551 static ExternalReference the_hole_value_location(Isolate* isolate); |
| 550 | 552 |
| 551 // Static variable Factory::arguments_marker.location() | 553 // Static variable Factory::arguments_marker.location() |
| 552 static ExternalReference arguments_marker_location(); | 554 static ExternalReference arguments_marker_location(Isolate* isolate); |
| 553 | 555 |
| 554 // Static variable Heap::roots_address() | 556 // Static variable Heap::roots_address() |
| 555 static ExternalReference roots_address(); | 557 static ExternalReference roots_address(Isolate* isolate); |
| 556 | 558 |
| 557 // Static variable StackGuard::address_of_jslimit() | 559 // Static variable StackGuard::address_of_jslimit() |
| 558 static ExternalReference address_of_stack_limit(); | 560 static ExternalReference address_of_stack_limit(Isolate* isolate); |
| 559 | 561 |
| 560 // Static variable StackGuard::address_of_real_jslimit() | 562 // Static variable StackGuard::address_of_real_jslimit() |
| 561 static ExternalReference address_of_real_stack_limit(); | 563 static ExternalReference address_of_real_stack_limit(Isolate* isolate); |
| 562 | 564 |
| 563 // Static variable RegExpStack::limit_address() | 565 // Static variable RegExpStack::limit_address() |
| 564 static ExternalReference address_of_regexp_stack_limit(); | 566 static ExternalReference address_of_regexp_stack_limit(Isolate* isolate); |
| 565 | 567 |
| 566 // Static variables for RegExp. | 568 // Static variables for RegExp. |
| 567 static ExternalReference address_of_static_offsets_vector(); | 569 static ExternalReference address_of_static_offsets_vector(Isolate* isolate); |
| 568 static ExternalReference address_of_regexp_stack_memory_address(); | 570 static ExternalReference address_of_regexp_stack_memory_address( |
| 569 static ExternalReference address_of_regexp_stack_memory_size(); | 571 Isolate* isolate); |
| 572 static ExternalReference address_of_regexp_stack_memory_size( | |
| 573 Isolate* isolate); | |
| 570 | 574 |
| 571 // Static variable Heap::NewSpaceStart() | 575 // Static variable Heap::NewSpaceStart() |
| 572 static ExternalReference new_space_start(); | 576 static ExternalReference new_space_start(Isolate* isolate); |
| 573 static ExternalReference new_space_mask(); | 577 static ExternalReference new_space_mask(Isolate* isolate); |
| 574 static ExternalReference heap_always_allocate_scope_depth(); | 578 static ExternalReference heap_always_allocate_scope_depth(Isolate* isolate); |
| 575 | 579 |
| 576 // Used for fast allocation in generated code. | 580 // Used for fast allocation in generated code. |
| 577 static ExternalReference new_space_allocation_top_address(); | 581 static ExternalReference new_space_allocation_top_address(Isolate* isolate); |
| 578 static ExternalReference new_space_allocation_limit_address(); | 582 static ExternalReference new_space_allocation_limit_address(Isolate* isolate); |
| 579 | 583 |
| 580 static ExternalReference double_fp_operation(Token::Value operation); | 584 static ExternalReference double_fp_operation(Token::Value operation, |
| 581 static ExternalReference compare_doubles(); | 585 Isolate* isolate); |
| 582 static ExternalReference power_double_double_function(); | 586 static ExternalReference compare_doubles(Isolate* isolate); |
| 583 static ExternalReference power_double_int_function(); | 587 static ExternalReference power_double_double_function(Isolate* isolate); |
| 588 static ExternalReference power_double_int_function(Isolate* isolate); | |
| 584 | 589 |
| 585 static ExternalReference handle_scope_next_address(); | 590 static ExternalReference handle_scope_next_address(); |
| 586 static ExternalReference handle_scope_limit_address(); | 591 static ExternalReference handle_scope_limit_address(); |
| 587 static ExternalReference handle_scope_level_address(); | 592 static ExternalReference handle_scope_level_address(); |
| 588 | 593 |
| 589 static ExternalReference scheduled_exception_address(); | 594 static ExternalReference scheduled_exception_address(Isolate* isolate); |
| 590 | 595 |
| 591 // Static variables containing common double constants. | 596 // Static variables containing common double constants. |
| 592 static ExternalReference address_of_min_int(); | 597 static ExternalReference address_of_min_int(); |
| 593 static ExternalReference address_of_one_half(); | 598 static ExternalReference address_of_one_half(); |
| 594 static ExternalReference address_of_minus_zero(); | 599 static ExternalReference address_of_minus_zero(); |
| 595 static ExternalReference address_of_negative_infinity(); | 600 static ExternalReference address_of_negative_infinity(); |
| 596 static ExternalReference address_of_nan(); | 601 static ExternalReference address_of_nan(); |
| 597 | 602 |
| 598 static ExternalReference math_sin_double_function(); | 603 static ExternalReference math_sin_double_function(Isolate* isolate); |
| 599 static ExternalReference math_cos_double_function(); | 604 static ExternalReference math_cos_double_function(Isolate* isolate); |
| 600 static ExternalReference math_log_double_function(); | 605 static ExternalReference math_log_double_function(Isolate* isolate); |
| 601 | 606 |
| 602 Address address() const {return reinterpret_cast<Address>(address_);} | 607 Address address() const {return reinterpret_cast<Address>(address_);} |
| 603 | 608 |
| 604 #ifdef ENABLE_DEBUGGER_SUPPORT | 609 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 605 // Function Debug::Break() | 610 // Function Debug::Break() |
| 606 static ExternalReference debug_break(); | 611 static ExternalReference debug_break(Isolate* isolate); |
| 607 | 612 |
| 608 // Used to check if single stepping is enabled in generated code. | 613 // Used to check if single stepping is enabled in generated code. |
| 609 static ExternalReference debug_step_in_fp_address(); | 614 static ExternalReference debug_step_in_fp_address(Isolate* isolate); |
| 610 #endif | 615 #endif |
| 611 | 616 |
| 612 #ifndef V8_INTERPRETED_REGEXP | 617 #ifndef V8_INTERPRETED_REGEXP |
| 613 // C functions called from RegExp generated code. | 618 // C functions called from RegExp generated code. |
| 614 | 619 |
| 615 // Function NativeRegExpMacroAssembler::CaseInsensitiveCompareUC16() | 620 // Function NativeRegExpMacroAssembler::CaseInsensitiveCompareUC16() |
| 616 static ExternalReference re_case_insensitive_compare_uc16(); | 621 static ExternalReference re_case_insensitive_compare_uc16(Isolate* isolate); |
| 617 | 622 |
| 618 // Function RegExpMacroAssembler*::CheckStackGuardState() | 623 // Function RegExpMacroAssembler*::CheckStackGuardState() |
| 619 static ExternalReference re_check_stack_guard_state(); | 624 static ExternalReference re_check_stack_guard_state(Isolate* isolate); |
| 620 | 625 |
| 621 // Function NativeRegExpMacroAssembler::GrowStack() | 626 // Function NativeRegExpMacroAssembler::GrowStack() |
| 622 static ExternalReference re_grow_stack(); | 627 static ExternalReference re_grow_stack(Isolate* isolate); |
| 623 | 628 |
| 624 // byte NativeRegExpMacroAssembler::word_character_bitmap | 629 // byte NativeRegExpMacroAssembler::word_character_bitmap |
| 625 static ExternalReference re_word_character_map(); | 630 static ExternalReference re_word_character_map(); |
| 626 | 631 |
| 627 #endif | 632 #endif |
| 628 | 633 |
| 629 // This lets you register a function that rewrites all external references. | 634 // This lets you register a function that rewrites all external references. |
| 630 // Used by the ARM simulator to catch calls to external references. | 635 // Used by the ARM simulator to catch calls to external references. |
| 631 static void set_redirector(ExternalReferenceRedirector* redirector) { | 636 static void set_redirector(ExternalReferenceRedirector* redirector) { |
| 632 // We can't stack them. | 637 // We can't stack them. |
| 633 ASSERT(Isolate::Current()->external_reference_redirector() == NULL); | 638 ASSERT(Isolate::Current()->external_reference_redirector() == NULL); |
| 634 Isolate::Current()->set_external_reference_redirector( | 639 Isolate::Current()->set_external_reference_redirector( |
| 635 reinterpret_cast<ExternalReferenceRedirectorPointer*>(redirector)); | 640 reinterpret_cast<ExternalReferenceRedirectorPointer*>(redirector)); |
| 636 } | 641 } |
| 637 | 642 |
| 638 private: | 643 private: |
| 639 explicit ExternalReference(void* address) | 644 explicit ExternalReference(void* address) |
| 640 : address_(address) {} | 645 : address_(address) {} |
| 641 | 646 |
| 642 static void* Redirect(void* address, | 647 static void* Redirect(Isolate* isolate, |
| 648 void* address, | |
| 643 Type type = ExternalReference::BUILTIN_CALL) { | 649 Type type = ExternalReference::BUILTIN_CALL) { |
| 644 ExternalReferenceRedirector* redirector = | 650 ExternalReferenceRedirector* redirector = |
| 645 reinterpret_cast<ExternalReferenceRedirector*>( | 651 reinterpret_cast<ExternalReferenceRedirector*>( |
| 646 Isolate::Current()->external_reference_redirector()); | 652 isolate->external_reference_redirector()); |
| 647 if (redirector == NULL) return address; | 653 if (redirector == NULL) return address; |
| 648 void* answer = (*redirector)(address, type); | 654 void* answer = (*redirector)(address, type); |
| 649 return answer; | 655 return answer; |
| 650 } | 656 } |
| 651 | 657 |
| 652 static void* Redirect(Address address_arg, | 658 static void* Redirect(Isolate* isolate, |
| 659 Address address_arg, | |
| 653 Type type = ExternalReference::BUILTIN_CALL) { | 660 Type type = ExternalReference::BUILTIN_CALL) { |
| 654 ExternalReferenceRedirector* redirector = | 661 ExternalReferenceRedirector* redirector = |
| 655 reinterpret_cast<ExternalReferenceRedirector*>( | 662 reinterpret_cast<ExternalReferenceRedirector*>( |
| 656 Isolate::Current()->external_reference_redirector()); | 663 isolate->external_reference_redirector()); |
| 657 void* address = reinterpret_cast<void*>(address_arg); | 664 void* address = reinterpret_cast<void*>(address_arg); |
| 658 void* answer = (redirector == NULL) ? | 665 void* answer = (redirector == NULL) ? |
| 659 address : | 666 address : |
| 660 (*redirector)(address, type); | 667 (*redirector)(address, type); |
| 661 return answer; | 668 return answer; |
| 662 } | 669 } |
| 663 | 670 |
| 664 void* address_; | 671 void* address_; |
| 665 }; | 672 }; |
| 666 | 673 |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 792 return num_bits_set; | 799 return num_bits_set; |
| 793 } | 800 } |
| 794 | 801 |
| 795 // Computes pow(x, y) with the special cases in the spec for Math.pow. | 802 // Computes pow(x, y) with the special cases in the spec for Math.pow. |
| 796 double power_double_int(double x, int y); | 803 double power_double_int(double x, int y); |
| 797 double power_double_double(double x, double y); | 804 double power_double_double(double x, double y); |
| 798 | 805 |
| 799 } } // namespace v8::internal | 806 } } // namespace v8::internal |
| 800 | 807 |
| 801 #endif // V8_ASSEMBLER_H_ | 808 #endif // V8_ASSEMBLER_H_ |
| OLD | NEW |