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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 // Signed right shift is arithmetic shift. Tested in test-utils.cc. | 200 // Signed right shift is arithmetic shift. Tested in test-utils.cc. |
201 data_delta = data_delta >> kBitsPerByte; | 201 data_delta = data_delta >> kBitsPerByte; |
202 } | 202 } |
203 } | 203 } |
204 | 204 |
205 | 205 |
206 void RelocInfoWriter::Write(const RelocInfo* rinfo) { | 206 void RelocInfoWriter::Write(const RelocInfo* rinfo) { |
207 #ifdef DEBUG | 207 #ifdef DEBUG |
208 byte* begin_pos = pos_; | 208 byte* begin_pos = pos_; |
209 #endif | 209 #endif |
210 Counters::reloc_info_count.Increment(); | 210 INC_COUNTER(reloc_info_count); |
211 ASSERT(rinfo->pc() - last_pc_ >= 0); | 211 ASSERT(rinfo->pc() - last_pc_ >= 0); |
212 ASSERT(RelocInfo::NUMBER_OF_MODES < kMaxRelocModes); | 212 ASSERT(RelocInfo::NUMBER_OF_MODES < kMaxRelocModes); |
213 // Use unsigned delta-encoding for pc. | 213 // Use unsigned delta-encoding for pc. |
214 uint32_t pc_delta = static_cast<uint32_t>(rinfo->pc() - last_pc_); | 214 uint32_t pc_delta = static_cast<uint32_t>(rinfo->pc() - last_pc_); |
215 RelocInfo::Mode rmode = rinfo->rmode(); | 215 RelocInfo::Mode rmode = rinfo->rmode(); |
216 | 216 |
217 // The two most common modes are given small tags, and usually fit in a byte. | 217 // The two most common modes are given small tags, and usually fit in a byte. |
218 if (rmode == RelocInfo::EMBEDDED_OBJECT) { | 218 if (rmode == RelocInfo::EMBEDDED_OBJECT) { |
219 WriteTaggedPC(pc_delta, kEmbeddedObjectTag); | 219 WriteTaggedPC(pc_delta, kEmbeddedObjectTag); |
220 } else if (rmode == RelocInfo::CODE_TARGET) { | 220 } else if (rmode == RelocInfo::CODE_TARGET) { |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 ExternalReference::ExternalReference(const SCTableReference& table_ref) | 557 ExternalReference::ExternalReference(const SCTableReference& table_ref) |
558 : address_(table_ref.address()) {} | 558 : address_(table_ref.address()) {} |
559 | 559 |
560 | 560 |
561 ExternalReference ExternalReference::perform_gc_function() { | 561 ExternalReference ExternalReference::perform_gc_function() { |
562 return ExternalReference(Redirect(FUNCTION_ADDR(Runtime::PerformGC))); | 562 return ExternalReference(Redirect(FUNCTION_ADDR(Runtime::PerformGC))); |
563 } | 563 } |
564 | 564 |
565 | 565 |
566 ExternalReference ExternalReference::builtin_passed_function() { | 566 ExternalReference ExternalReference::builtin_passed_function() { |
567 return ExternalReference(&Builtins::builtin_passed_function); | 567 return ExternalReference( |
| 568 &v8_context()->builtins_data_.builtin_passed_function_); |
568 } | 569 } |
569 | 570 |
570 | 571 |
571 ExternalReference ExternalReference::random_positive_smi_function() { | 572 ExternalReference ExternalReference::random_positive_smi_function() { |
572 return ExternalReference(Redirect(FUNCTION_ADDR(V8::RandomPositiveSmi))); | 573 return ExternalReference(Redirect(FUNCTION_ADDR(V8::RandomPositiveSmi))); |
573 } | 574 } |
574 | 575 |
575 | 576 |
576 ExternalReference ExternalReference::the_hole_value_location() { | 577 ExternalReference ExternalReference::the_hole_value_location() { |
577 return ExternalReference(Factory::the_hole_value().location()); | 578 return ExternalReference(Factory::the_hole_value().location()); |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
725 return ExternalReference(Redirect(FUNCTION_ADDR(function), true)); | 726 return ExternalReference(Redirect(FUNCTION_ADDR(function), true)); |
726 } | 727 } |
727 | 728 |
728 | 729 |
729 ExternalReference ExternalReference::compare_doubles() { | 730 ExternalReference ExternalReference::compare_doubles() { |
730 return ExternalReference(Redirect(FUNCTION_ADDR(native_compare_doubles), | 731 return ExternalReference(Redirect(FUNCTION_ADDR(native_compare_doubles), |
731 false)); | 732 false)); |
732 } | 733 } |
733 | 734 |
734 | 735 |
735 ExternalReferenceRedirector* ExternalReference::redirector_ = NULL; | |
736 | |
737 | 736 |
738 #ifdef ENABLE_DEBUGGER_SUPPORT | 737 #ifdef ENABLE_DEBUGGER_SUPPORT |
739 ExternalReference ExternalReference::debug_break() { | 738 ExternalReference ExternalReference::debug_break() { |
740 return ExternalReference(Redirect(FUNCTION_ADDR(Debug::Break))); | 739 return ExternalReference(Redirect(FUNCTION_ADDR(Debug::Break))); |
741 } | 740 } |
742 | 741 |
743 | 742 |
744 ExternalReference ExternalReference::debug_step_in_fp_address() { | 743 ExternalReference ExternalReference::debug_step_in_fp_address() { |
745 return ExternalReference(Debug::step_in_fp_addr()); | 744 return ExternalReference(Debug::step_in_fp_addr()); |
746 } | 745 } |
747 #endif | 746 #endif |
748 | 747 |
749 } } // namespace v8::internal | 748 } } // namespace v8::internal |
OLD | NEW |