| 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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 static const int kMaxSmallPCDelta; | 247 static const int kMaxSmallPCDelta; |
| 248 | 248 |
| 249 enum Mode { | 249 enum Mode { |
| 250 // Please note the order is important (see IsCodeTarget, IsGCRelocMode). | 250 // Please note the order is important (see IsCodeTarget, IsGCRelocMode). |
| 251 CODE_TARGET, // Code target which is not any of the above. | 251 CODE_TARGET, // Code target which is not any of the above. |
| 252 CODE_TARGET_WITH_ID, | 252 CODE_TARGET_WITH_ID, |
| 253 CONSTRUCT_CALL, // code target that is a call to a JavaScript constructor. | 253 CONSTRUCT_CALL, // code target that is a call to a JavaScript constructor. |
| 254 CODE_TARGET_CONTEXT, // Code target used for contextual loads and stores. | 254 CODE_TARGET_CONTEXT, // Code target used for contextual loads and stores. |
| 255 DEBUG_BREAK, // Code target for the debugger statement. | 255 DEBUG_BREAK, // Code target for the debugger statement. |
| 256 EMBEDDED_OBJECT, | 256 EMBEDDED_OBJECT, |
| 257 GLOBAL_PROPERTY_CELL, | 257 CELL, |
| 258 | 258 |
| 259 // Everything after runtime_entry (inclusive) is not GC'ed. | 259 // Everything after runtime_entry (inclusive) is not GC'ed. |
| 260 RUNTIME_ENTRY, | 260 RUNTIME_ENTRY, |
| 261 JS_RETURN, // Marks start of the ExitJSFrame code. | 261 JS_RETURN, // Marks start of the ExitJSFrame code. |
| 262 COMMENT, | 262 COMMENT, |
| 263 POSITION, // See comment for kNoPosition above. | 263 POSITION, // See comment for kNoPosition above. |
| 264 STATEMENT_POSITION, // See comment for kNoPosition above. | 264 STATEMENT_POSITION, // See comment for kNoPosition above. |
| 265 DEBUG_BREAK_SLOT, // Additional code inserted for debug break slot. | 265 DEBUG_BREAK_SLOT, // Additional code inserted for debug break slot. |
| 266 EXTERNAL_REFERENCE, // The address of an external C++ function. | 266 EXTERNAL_REFERENCE, // The address of an external C++ function. |
| 267 INTERNAL_REFERENCE, // An address inside the same function. | 267 INTERNAL_REFERENCE, // An address inside the same function. |
| 268 | 268 |
| 269 // Marks a constant pool. Only used on ARM. | 269 // Marks a constant pool. Only used on ARM. |
| 270 // It uses a custom noncompact encoding. | 270 // It uses a custom noncompact encoding. |
| 271 CONST_POOL, | 271 CONST_POOL, |
| 272 | 272 |
| 273 // add more as needed | 273 // add more as needed |
| 274 // Pseudo-types | 274 // Pseudo-types |
| 275 NUMBER_OF_MODES, // There are at most 15 modes with noncompact encoding. | 275 NUMBER_OF_MODES, // There are at most 15 modes with noncompact encoding. |
| 276 NONE32, // never recorded 32-bit value | 276 NONE32, // never recorded 32-bit value |
| 277 NONE64, // never recorded 64-bit value | 277 NONE64, // never recorded 64-bit value |
| 278 CODE_AGE_SEQUENCE, // Not stored in RelocInfo array, used explictly by | 278 CODE_AGE_SEQUENCE, // Not stored in RelocInfo array, used explictly by |
| 279 // code aging. | 279 // code aging. |
| 280 FIRST_REAL_RELOC_MODE = CODE_TARGET, | 280 FIRST_REAL_RELOC_MODE = CODE_TARGET, |
| 281 LAST_REAL_RELOC_MODE = CONST_POOL, | 281 LAST_REAL_RELOC_MODE = CONST_POOL, |
| 282 FIRST_PSEUDO_RELOC_MODE = CODE_AGE_SEQUENCE, | 282 FIRST_PSEUDO_RELOC_MODE = CODE_AGE_SEQUENCE, |
| 283 LAST_PSEUDO_RELOC_MODE = CODE_AGE_SEQUENCE, | 283 LAST_PSEUDO_RELOC_MODE = CODE_AGE_SEQUENCE, |
| 284 LAST_CODE_ENUM = DEBUG_BREAK, | 284 LAST_CODE_ENUM = DEBUG_BREAK, |
| 285 LAST_GCED_ENUM = GLOBAL_PROPERTY_CELL, | 285 LAST_GCED_ENUM = CELL, |
| 286 // Modes <= LAST_COMPACT_ENUM are guaranteed to have compact encoding. | 286 // Modes <= LAST_COMPACT_ENUM are guaranteed to have compact encoding. |
| 287 LAST_COMPACT_ENUM = CODE_TARGET_WITH_ID, | 287 LAST_COMPACT_ENUM = CODE_TARGET_WITH_ID, |
| 288 LAST_STANDARD_NONCOMPACT_ENUM = INTERNAL_REFERENCE | 288 LAST_STANDARD_NONCOMPACT_ENUM = INTERNAL_REFERENCE |
| 289 }; | 289 }; |
| 290 | 290 |
| 291 | 291 |
| 292 RelocInfo() {} | 292 RelocInfo() {} |
| 293 | 293 |
| 294 RelocInfo(byte* pc, Mode rmode, intptr_t data, Code* host) | 294 RelocInfo(byte* pc, Mode rmode, intptr_t data, Code* host) |
| 295 : pc_(pc), rmode_(rmode), data_(data), host_(host) { | 295 : pc_(pc), rmode_(rmode), data_(data), host_(host) { |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 WriteBarrierMode mode = UPDATE_WRITE_BARRIER)); | 379 WriteBarrierMode mode = UPDATE_WRITE_BARRIER)); |
| 380 INLINE(Object* target_object()); | 380 INLINE(Object* target_object()); |
| 381 INLINE(Handle<Object> target_object_handle(Assembler* origin)); | 381 INLINE(Handle<Object> target_object_handle(Assembler* origin)); |
| 382 INLINE(Object** target_object_address()); | 382 INLINE(Object** target_object_address()); |
| 383 INLINE(void set_target_object(Object* target, | 383 INLINE(void set_target_object(Object* target, |
| 384 WriteBarrierMode mode = UPDATE_WRITE_BARRIER)); | 384 WriteBarrierMode mode = UPDATE_WRITE_BARRIER)); |
| 385 INLINE(Address target_runtime_entry(Assembler* origin)); | 385 INLINE(Address target_runtime_entry(Assembler* origin)); |
| 386 INLINE(void set_target_runtime_entry(Address target, | 386 INLINE(void set_target_runtime_entry(Address target, |
| 387 WriteBarrierMode mode = | 387 WriteBarrierMode mode = |
| 388 UPDATE_WRITE_BARRIER)); | 388 UPDATE_WRITE_BARRIER)); |
| 389 INLINE(JSGlobalPropertyCell* target_cell()); | 389 INLINE(Cell* target_cell()); |
| 390 INLINE(Handle<JSGlobalPropertyCell> target_cell_handle()); | 390 INLINE(Handle<Cell> target_cell_handle()); |
| 391 INLINE(void set_target_cell(JSGlobalPropertyCell* cell, | 391 INLINE(void set_target_cell(Cell* cell, |
| 392 WriteBarrierMode mode = UPDATE_WRITE_BARRIER)); | 392 WriteBarrierMode mode = UPDATE_WRITE_BARRIER)); |
| 393 INLINE(Code* code_age_stub()); | 393 INLINE(Code* code_age_stub()); |
| 394 INLINE(void set_code_age_stub(Code* stub)); | 394 INLINE(void set_code_age_stub(Code* stub)); |
| 395 | 395 |
| 396 // Read the address of the word containing the target_address in an | 396 // Read the address of the word containing the target_address in an |
| 397 // instruction stream. What this means exactly is architecture-independent. | 397 // instruction stream. What this means exactly is architecture-independent. |
| 398 // The only architecture-independent user of this function is the serializer. | 398 // The only architecture-independent user of this function is the serializer. |
| 399 // The serializer uses it to find out how many raw bytes of instruction to | 399 // The serializer uses it to find out how many raw bytes of instruction to |
| 400 // output before the next target. Architecture-independent code shouldn't | 400 // output before the next target. Architecture-independent code shouldn't |
| 401 // dereference the pointer it gets back from this. | 401 // dereference the pointer it gets back from this. |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 BUILTIN_FP_CALL, | 640 BUILTIN_FP_CALL, |
| 641 | 641 |
| 642 // Builtin call that returns floating point. | 642 // Builtin call that returns floating point. |
| 643 // double f(double, int). | 643 // double f(double, int). |
| 644 BUILTIN_FP_INT_CALL, | 644 BUILTIN_FP_INT_CALL, |
| 645 | 645 |
| 646 // Direct call to API function callback. | 646 // Direct call to API function callback. |
| 647 // Handle<Value> f(v8::Arguments&) | 647 // Handle<Value> f(v8::Arguments&) |
| 648 DIRECT_API_CALL, | 648 DIRECT_API_CALL, |
| 649 | 649 |
| 650 // Call to invocation callback via InvokeInvocationCallback. |
| 651 // Handle<Value> f(v8::Arguments&, v8::InvocationCallback) |
| 652 PROFILING_API_CALL, |
| 653 |
| 650 // Direct call to API function callback. | 654 // Direct call to API function callback. |
| 651 // void f(v8::Arguments&) | 655 // void f(v8::Arguments&) |
| 652 DIRECT_API_CALL_NEW, | 656 DIRECT_API_CALL_NEW, |
| 653 | 657 |
| 658 // Call to function callback via InvokeFunctionCallback. |
| 659 // void f(v8::Arguments&, v8::FunctionCallback) |
| 660 PROFILING_API_CALL_NEW, |
| 661 |
| 654 // Direct call to accessor getter callback. | 662 // Direct call to accessor getter callback. |
| 655 // Handle<value> f(Local<String> property, AccessorInfo& info) | 663 // Handle<value> f(Local<String> property, AccessorInfo& info) |
| 656 DIRECT_GETTER_CALL, | 664 DIRECT_GETTER_CALL, |
| 657 | 665 |
| 666 // Call to accessor getter callback via InvokeAccessorGetter. |
| 667 // Handle<value> f(Local<String> property, AccessorInfo& info, |
| 668 // AccessorGetter getter) |
| 669 PROFILING_GETTER_CALL, |
| 670 |
| 658 // Direct call to accessor getter callback. | 671 // Direct call to accessor getter callback. |
| 659 // void f(Local<String> property, AccessorInfo& info) | 672 // void f(Local<String> property, AccessorInfo& info) |
| 660 DIRECT_GETTER_CALL_NEW | 673 DIRECT_GETTER_CALL_NEW, |
| 674 |
| 675 // Call to accessor getter callback via InvokeAccessorGetterCallback. |
| 676 // void f(Local<String> property, AccessorInfo& info, |
| 677 // AccessorGetterCallback callback) |
| 678 PROFILING_GETTER_CALL_NEW |
| 661 }; | 679 }; |
| 662 | 680 |
| 663 static void SetUp(); | 681 static void SetUp(); |
| 664 static void InitializeMathExpData(); | 682 static void InitializeMathExpData(); |
| 665 static void TearDownMathExpData(); | 683 static void TearDownMathExpData(); |
| 666 | 684 |
| 667 typedef void* ExternalReferenceRedirector(void* original, Type type); | 685 typedef void* ExternalReferenceRedirector(void* original, Type type); |
| 668 | 686 |
| 669 ExternalReference(Builtins::CFunctionId id, Isolate* isolate); | 687 ExternalReference(Builtins::CFunctionId id, Isolate* isolate); |
| 670 | 688 |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1015 public: | 1033 public: |
| 1016 NullCallWrapper() { } | 1034 NullCallWrapper() { } |
| 1017 virtual ~NullCallWrapper() { } | 1035 virtual ~NullCallWrapper() { } |
| 1018 virtual void BeforeCall(int call_size) const { } | 1036 virtual void BeforeCall(int call_size) const { } |
| 1019 virtual void AfterCall() const { } | 1037 virtual void AfterCall() const { } |
| 1020 }; | 1038 }; |
| 1021 | 1039 |
| 1022 } } // namespace v8::internal | 1040 } } // namespace v8::internal |
| 1023 | 1041 |
| 1024 #endif // V8_ASSEMBLER_H_ | 1042 #endif // V8_ASSEMBLER_H_ |
| OLD | NEW |