| 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 // possible break locations. kNoPosition is used to indicate an | 180 // possible break locations. kNoPosition is used to indicate an |
| 181 // invalid/uninitialized position value. | 181 // invalid/uninitialized position value. |
| 182 static const int kNoPosition = -1; | 182 static const int kNoPosition = -1; |
| 183 | 183 |
| 184 // This string is used to add padding comments to the reloc info in cases | 184 // This string is used to add padding comments to the reloc info in cases |
| 185 // where we are not sure to have enough space for patching in during | 185 // where we are not sure to have enough space for patching in during |
| 186 // lazy deoptimization. This is the case if we have indirect calls for which | 186 // lazy deoptimization. This is the case if we have indirect calls for which |
| 187 // we do not normally record relocation info. | 187 // we do not normally record relocation info. |
| 188 static const char* kFillerCommentString; | 188 static const char* kFillerCommentString; |
| 189 | 189 |
| 190 // The minimum size of a comment is equal to three bytes for the extra tagged |
| 191 // pc + the tag for the data, and kPointerSize for the actual pointer to the |
| 192 // comment. |
| 193 static const int kMinRelocCommentSize = 3 + kPointerSize; |
| 194 |
| 195 // The maximum size for a call instruction including pc-jump. |
| 196 static const int kMaxCallSize = 6; |
| 197 |
| 190 enum Mode { | 198 enum Mode { |
| 191 // Please note the order is important (see IsCodeTarget, IsGCRelocMode). | 199 // Please note the order is important (see IsCodeTarget, IsGCRelocMode). |
| 192 CONSTRUCT_CALL, // code target that is a call to a JavaScript constructor. | 200 CONSTRUCT_CALL, // code target that is a call to a JavaScript constructor. |
| 193 CODE_TARGET_CONTEXT, // Code target used for contextual loads and stores. | 201 CODE_TARGET_CONTEXT, // Code target used for contextual loads and stores. |
| 194 DEBUG_BREAK, // Code target for the debugger statement. | 202 DEBUG_BREAK, // Code target for the debugger statement. |
| 195 CODE_TARGET, // Code target which is not any of the above. | 203 CODE_TARGET, // Code target which is not any of the above. |
| 196 EMBEDDED_OBJECT, | 204 EMBEDDED_OBJECT, |
| 197 GLOBAL_PROPERTY_CELL, | 205 GLOBAL_PROPERTY_CELL, |
| 198 | 206 |
| 199 // Everything after runtime_entry (inclusive) is not GC'ed. | 207 // Everything after runtime_entry (inclusive) is not GC'ed. |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 | 477 |
| 470 | 478 |
| 471 // An ExternalReference represents a C++ address used in the generated | 479 // An ExternalReference represents a C++ address used in the generated |
| 472 // code. All references to C++ functions and variables must be encapsulated in | 480 // code. All references to C++ functions and variables must be encapsulated in |
| 473 // an ExternalReference instance. This is done in order to track the origin of | 481 // an ExternalReference instance. This is done in order to track the origin of |
| 474 // all external references in the code so that they can be bound to the correct | 482 // all external references in the code so that they can be bound to the correct |
| 475 // addresses when deserializing a heap. | 483 // addresses when deserializing a heap. |
| 476 class ExternalReference BASE_EMBEDDED { | 484 class ExternalReference BASE_EMBEDDED { |
| 477 public: | 485 public: |
| 478 // Used in the simulator to support different native api calls. | 486 // Used in the simulator to support different native api calls. |
| 479 // | |
| 480 // BUILTIN_CALL - builtin call. | |
| 481 // MaybeObject* f(v8::internal::Arguments). | |
| 482 // | |
| 483 // FP_RETURN_CALL - builtin call that returns floating point. | |
| 484 // double f(double, double). | |
| 485 // | |
| 486 // DIRECT_CALL - direct call to API function native callback | |
| 487 // from generated code. | |
| 488 // Handle<Value> f(v8::Arguments&) | |
| 489 // | |
| 490 enum Type { | 487 enum Type { |
| 488 // Builtin call. |
| 489 // MaybeObject* f(v8::internal::Arguments). |
| 491 BUILTIN_CALL, // default | 490 BUILTIN_CALL, // default |
| 491 |
| 492 // Builtin call that returns floating point. |
| 493 // double f(double, double). |
| 492 FP_RETURN_CALL, | 494 FP_RETURN_CALL, |
| 493 DIRECT_CALL | 495 |
| 496 // Direct call to API function callback. |
| 497 // Handle<Value> f(v8::Arguments&) |
| 498 DIRECT_API_CALL, |
| 499 |
| 500 // Direct call to accessor getter callback. |
| 501 // Handle<value> f(Local<String> property, AccessorInfo& info) |
| 502 DIRECT_GETTER_CALL |
| 494 }; | 503 }; |
| 495 | 504 |
| 496 typedef void* ExternalReferenceRedirector(void* original, Type type); | 505 typedef void* ExternalReferenceRedirector(void* original, Type type); |
| 497 | 506 |
| 498 explicit ExternalReference(Builtins::CFunctionId id); | 507 explicit ExternalReference(Builtins::CFunctionId id); |
| 499 | 508 |
| 500 explicit ExternalReference(ApiFunction* ptr, Type type); | 509 explicit ExternalReference(ApiFunction* ptr, Type type); |
| 501 | 510 |
| 502 explicit ExternalReference(Builtins::Name name); | 511 explicit ExternalReference(Builtins::Name name); |
| 503 | 512 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 static ExternalReference handle_scope_level_address(); | 591 static ExternalReference handle_scope_level_address(); |
| 583 | 592 |
| 584 static ExternalReference scheduled_exception_address(); | 593 static ExternalReference scheduled_exception_address(); |
| 585 | 594 |
| 586 // Static variables containing common double constants. | 595 // Static variables containing common double constants. |
| 587 static ExternalReference address_of_min_int(); | 596 static ExternalReference address_of_min_int(); |
| 588 static ExternalReference address_of_one_half(); | 597 static ExternalReference address_of_one_half(); |
| 589 static ExternalReference address_of_minus_zero(); | 598 static ExternalReference address_of_minus_zero(); |
| 590 static ExternalReference address_of_negative_infinity(); | 599 static ExternalReference address_of_negative_infinity(); |
| 591 | 600 |
| 601 static ExternalReference math_sin_double_function(); |
| 602 static ExternalReference math_cos_double_function(); |
| 603 static ExternalReference math_log_double_function(); |
| 604 |
| 592 Address address() const {return reinterpret_cast<Address>(address_);} | 605 Address address() const {return reinterpret_cast<Address>(address_);} |
| 593 | 606 |
| 594 #ifdef ENABLE_DEBUGGER_SUPPORT | 607 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 595 // Function Debug::Break() | 608 // Function Debug::Break() |
| 596 static ExternalReference debug_break(); | 609 static ExternalReference debug_break(); |
| 597 | 610 |
| 598 // Used to check if single stepping is enabled in generated code. | 611 // Used to check if single stepping is enabled in generated code. |
| 599 static ExternalReference debug_step_in_fp_address(); | 612 static ExternalReference debug_step_in_fp_address(); |
| 600 #endif | 613 #endif |
| 601 | 614 |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 776 return num_bits_set; | 789 return num_bits_set; |
| 777 } | 790 } |
| 778 | 791 |
| 779 // Computes pow(x, y) with the special cases in the spec for Math.pow. | 792 // Computes pow(x, y) with the special cases in the spec for Math.pow. |
| 780 double power_double_int(double x, int y); | 793 double power_double_int(double x, int y); |
| 781 double power_double_double(double x, double y); | 794 double power_double_double(double x, double y); |
| 782 | 795 |
| 783 } } // namespace v8::internal | 796 } } // namespace v8::internal |
| 784 | 797 |
| 785 #endif // V8_ASSEMBLER_H_ | 798 #endif // V8_ASSEMBLER_H_ |
| OLD | NEW |