Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(351)

Side by Side Diff: src/assembler.h

Issue 8139027: Version 3.6.5 (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: '' Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/array.js ('k') | src/assembler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 } 136 }
137 } 137 }
138 138
139 friend class Assembler; 139 friend class Assembler;
140 friend class RegexpAssembler; 140 friend class RegexpAssembler;
141 friend class Displacement; 141 friend class Displacement;
142 friend class RegExpMacroAssemblerIrregexp; 142 friend class RegExpMacroAssemblerIrregexp;
143 }; 143 };
144 144
145 145
146 enum SaveFPRegsMode { kDontSaveFPRegs, kSaveFPRegs };
147
148
146 // ----------------------------------------------------------------------------- 149 // -----------------------------------------------------------------------------
147 // Relocation information 150 // Relocation information
148 151
149 152
150 // Relocation information consists of the address (pc) of the datum 153 // Relocation information consists of the address (pc) of the datum
151 // to which the relocation information applies, the relocation mode 154 // to which the relocation information applies, the relocation mode
152 // (rmode), and an optional data field. The relocation mode may be 155 // (rmode), and an optional data field. The relocation mode may be
153 // "descriptive" and not indicate a need for relocation, but simply 156 // "descriptive" and not indicate a need for relocation, but simply
154 // describe a property of the datum. Such rmodes are useful for GC 157 // describe a property of the datum. Such rmodes are useful for GC
155 // and nice disassembly output. 158 // and nice disassembly output.
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 NUMBER_OF_MODES, // There are at most 14 modes with noncompact encoding. 212 NUMBER_OF_MODES, // There are at most 14 modes with noncompact encoding.
210 NONE, // never recorded 213 NONE, // never recorded
211 LAST_CODE_ENUM = DEBUG_BREAK, 214 LAST_CODE_ENUM = DEBUG_BREAK,
212 LAST_GCED_ENUM = GLOBAL_PROPERTY_CELL, 215 LAST_GCED_ENUM = GLOBAL_PROPERTY_CELL,
213 // Modes <= LAST_COMPACT_ENUM are guaranteed to have compact encoding. 216 // Modes <= LAST_COMPACT_ENUM are guaranteed to have compact encoding.
214 LAST_COMPACT_ENUM = CODE_TARGET_WITH_ID 217 LAST_COMPACT_ENUM = CODE_TARGET_WITH_ID
215 }; 218 };
216 219
217 220
218 RelocInfo() {} 221 RelocInfo() {}
219 RelocInfo(byte* pc, Mode rmode, intptr_t data) 222
220 : pc_(pc), rmode_(rmode), data_(data) { 223 RelocInfo(byte* pc, Mode rmode, intptr_t data, Code* host)
224 : pc_(pc), rmode_(rmode), data_(data), host_(host) {
221 } 225 }
222 226
223 static inline bool IsConstructCall(Mode mode) { 227 static inline bool IsConstructCall(Mode mode) {
224 return mode == CONSTRUCT_CALL; 228 return mode == CONSTRUCT_CALL;
225 } 229 }
226 static inline bool IsCodeTarget(Mode mode) { 230 static inline bool IsCodeTarget(Mode mode) {
227 return mode <= LAST_CODE_ENUM; 231 return mode <= LAST_CODE_ENUM;
228 } 232 }
229 // Is the relocation mode affected by GC? 233 // Is the relocation mode affected by GC?
230 static inline bool IsGCRelocMode(Mode mode) { 234 static inline bool IsGCRelocMode(Mode mode) {
(...skipping 20 matching lines...) Expand all
251 static inline bool IsDebugBreakSlot(Mode mode) { 255 static inline bool IsDebugBreakSlot(Mode mode) {
252 return mode == DEBUG_BREAK_SLOT; 256 return mode == DEBUG_BREAK_SLOT;
253 } 257 }
254 static inline int ModeMask(Mode mode) { return 1 << mode; } 258 static inline int ModeMask(Mode mode) { return 1 << mode; }
255 259
256 // Accessors 260 // Accessors
257 byte* pc() const { return pc_; } 261 byte* pc() const { return pc_; }
258 void set_pc(byte* pc) { pc_ = pc; } 262 void set_pc(byte* pc) { pc_ = pc; }
259 Mode rmode() const { return rmode_; } 263 Mode rmode() const { return rmode_; }
260 intptr_t data() const { return data_; } 264 intptr_t data() const { return data_; }
265 Code* host() const { return host_; }
261 266
262 // Apply a relocation by delta bytes 267 // Apply a relocation by delta bytes
263 INLINE(void apply(intptr_t delta)); 268 INLINE(void apply(intptr_t delta));
264 269
265 // Is the pointer this relocation info refers to coded like a plain pointer 270 // Is the pointer this relocation info refers to coded like a plain pointer
266 // or is it strange in some way (eg relative or patched into a series of 271 // or is it strange in some way (eg relative or patched into a series of
267 // instructions). 272 // instructions).
268 bool IsCodedSpecially(); 273 bool IsCodedSpecially();
269 274
270 // Read/modify the code target in the branch/call instruction 275 // Read/modify the code target in the branch/call instruction
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 static const int kApplyMask; // Modes affected by apply. Depends on arch. 351 static const int kApplyMask; // Modes affected by apply. Depends on arch.
347 352
348 private: 353 private:
349 // On ARM, note that pc_ is the address of the constant pool entry 354 // On ARM, note that pc_ is the address of the constant pool entry
350 // to be relocated and not the address of the instruction 355 // to be relocated and not the address of the instruction
351 // referencing the constant pool entry (except when rmode_ == 356 // referencing the constant pool entry (except when rmode_ ==
352 // comment). 357 // comment).
353 byte* pc_; 358 byte* pc_;
354 Mode rmode_; 359 Mode rmode_;
355 intptr_t data_; 360 intptr_t data_;
361 Code* host_;
356 #ifdef V8_TARGET_ARCH_MIPS 362 #ifdef V8_TARGET_ARCH_MIPS
357 // Code and Embedded Object pointers in mips are stored split 363 // Code and Embedded Object pointers in mips are stored split
358 // across two consecutive 32-bit instructions. Heap management 364 // across two consecutive 32-bit instructions. Heap management
359 // routines expect to access these pointers indirectly. The following 365 // routines expect to access these pointers indirectly. The following
360 // location provides a place for these pointers to exist natually 366 // location provides a place for these pointers to exist natually
361 // when accessed via the Iterator. 367 // when accessed via the Iterator.
362 Object *reconstructed_obj_ptr_; 368 Object *reconstructed_obj_ptr_;
363 // External-reference pointers are also split across instruction-pairs 369 // External-reference pointers are also split across instruction-pairs
364 // in mips, but are accessed via indirect pointers. This location 370 // in mips, but are accessed via indirect pointers. This location
365 // provides a place for that pointer to exist naturally. Its address 371 // provides a place for that pointer to exist naturally. Its address
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 560
555 explicit ExternalReference(const SCTableReference& table_ref); 561 explicit ExternalReference(const SCTableReference& table_ref);
556 562
557 // Isolate::Current() as an external reference. 563 // Isolate::Current() as an external reference.
558 static ExternalReference isolate_address(); 564 static ExternalReference isolate_address();
559 565
560 // One-of-a-kind references. These references are not part of a general 566 // One-of-a-kind references. These references are not part of a general
561 // pattern. This means that they have to be added to the 567 // pattern. This means that they have to be added to the
562 // ExternalReferenceTable in serialize.cc manually. 568 // ExternalReferenceTable in serialize.cc manually.
563 569
570 static ExternalReference incremental_marking_record_write_function(
571 Isolate* isolate);
572 static ExternalReference incremental_evacuation_record_write_function(
573 Isolate* isolate);
574 static ExternalReference store_buffer_overflow_function(
575 Isolate* isolate);
576 static ExternalReference flush_icache_function(Isolate* isolate);
564 static ExternalReference perform_gc_function(Isolate* isolate); 577 static ExternalReference perform_gc_function(Isolate* isolate);
565 static ExternalReference fill_heap_number_with_random_function( 578 static ExternalReference fill_heap_number_with_random_function(
566 Isolate* isolate); 579 Isolate* isolate);
567 static ExternalReference random_uint32_function(Isolate* isolate); 580 static ExternalReference random_uint32_function(Isolate* isolate);
568 static ExternalReference transcendental_cache_array_address(Isolate* isolate); 581 static ExternalReference transcendental_cache_array_address(Isolate* isolate);
569 static ExternalReference delete_handle_scope_extensions(Isolate* isolate); 582 static ExternalReference delete_handle_scope_extensions(Isolate* isolate);
570 583
571 // Deoptimization support. 584 // Deoptimization support.
572 static ExternalReference new_deoptimizer_function(Isolate* isolate); 585 static ExternalReference new_deoptimizer_function(Isolate* isolate);
573 static ExternalReference compute_output_frames_function(Isolate* isolate); 586 static ExternalReference compute_output_frames_function(Isolate* isolate);
574 static ExternalReference global_contexts_list(Isolate* isolate); 587 static ExternalReference global_contexts_list(Isolate* isolate);
575 588
576 // Static data in the keyed lookup cache. 589 // Static data in the keyed lookup cache.
577 static ExternalReference keyed_lookup_cache_keys(Isolate* isolate); 590 static ExternalReference keyed_lookup_cache_keys(Isolate* isolate);
578 static ExternalReference keyed_lookup_cache_field_offsets(Isolate* isolate); 591 static ExternalReference keyed_lookup_cache_field_offsets(Isolate* isolate);
579 592
580 // Static variable Factory::the_hole_value.location()
581 static ExternalReference the_hole_value_location(Isolate* isolate);
582
583 // Static variable Factory::arguments_marker.location()
584 static ExternalReference arguments_marker_location(Isolate* isolate);
585
586 // Static variable Heap::roots_address() 593 // Static variable Heap::roots_address()
587 static ExternalReference roots_address(Isolate* isolate); 594 static ExternalReference roots_address(Isolate* isolate);
588 595
589 // Static variable StackGuard::address_of_jslimit() 596 // Static variable StackGuard::address_of_jslimit()
590 static ExternalReference address_of_stack_limit(Isolate* isolate); 597 static ExternalReference address_of_stack_limit(Isolate* isolate);
591 598
592 // Static variable StackGuard::address_of_real_jslimit() 599 // Static variable StackGuard::address_of_real_jslimit()
593 static ExternalReference address_of_real_stack_limit(Isolate* isolate); 600 static ExternalReference address_of_real_stack_limit(Isolate* isolate);
594 601
595 // Static variable RegExpStack::limit_address() 602 // Static variable RegExpStack::limit_address()
596 static ExternalReference address_of_regexp_stack_limit(Isolate* isolate); 603 static ExternalReference address_of_regexp_stack_limit(Isolate* isolate);
597 604
598 // Static variables for RegExp. 605 // Static variables for RegExp.
599 static ExternalReference address_of_static_offsets_vector(Isolate* isolate); 606 static ExternalReference address_of_static_offsets_vector(Isolate* isolate);
600 static ExternalReference address_of_regexp_stack_memory_address( 607 static ExternalReference address_of_regexp_stack_memory_address(
601 Isolate* isolate); 608 Isolate* isolate);
602 static ExternalReference address_of_regexp_stack_memory_size( 609 static ExternalReference address_of_regexp_stack_memory_size(
603 Isolate* isolate); 610 Isolate* isolate);
604 611
605 // Static variable Heap::NewSpaceStart() 612 // Static variable Heap::NewSpaceStart()
606 static ExternalReference new_space_start(Isolate* isolate); 613 static ExternalReference new_space_start(Isolate* isolate);
607 static ExternalReference new_space_mask(Isolate* isolate); 614 static ExternalReference new_space_mask(Isolate* isolate);
608 static ExternalReference heap_always_allocate_scope_depth(Isolate* isolate); 615 static ExternalReference heap_always_allocate_scope_depth(Isolate* isolate);
616 static ExternalReference new_space_mark_bits(Isolate* isolate);
617
618 // Write barrier.
619 static ExternalReference store_buffer_top(Isolate* isolate);
609 620
610 // Used for fast allocation in generated code. 621 // Used for fast allocation in generated code.
611 static ExternalReference new_space_allocation_top_address(Isolate* isolate); 622 static ExternalReference new_space_allocation_top_address(Isolate* isolate);
612 static ExternalReference new_space_allocation_limit_address(Isolate* isolate); 623 static ExternalReference new_space_allocation_limit_address(Isolate* isolate);
613 624
614 static ExternalReference double_fp_operation(Token::Value operation, 625 static ExternalReference double_fp_operation(Token::Value operation,
615 Isolate* isolate); 626 Isolate* isolate);
616 static ExternalReference compare_doubles(Isolate* isolate); 627 static ExternalReference compare_doubles(Isolate* isolate);
617 static ExternalReference power_double_double_function(Isolate* isolate); 628 static ExternalReference power_double_double_function(Isolate* isolate);
618 static ExternalReference power_double_int_function(Isolate* isolate); 629 static ExternalReference power_double_int_function(Isolate* isolate);
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
855 public: 866 public:
856 NullCallWrapper() { } 867 NullCallWrapper() { }
857 virtual ~NullCallWrapper() { } 868 virtual ~NullCallWrapper() { }
858 virtual void BeforeCall(int call_size) const { } 869 virtual void BeforeCall(int call_size) const { }
859 virtual void AfterCall() const { } 870 virtual void AfterCall() const { }
860 }; 871 };
861 872
862 } } // namespace v8::internal 873 } } // namespace v8::internal
863 874
864 #endif // V8_ASSEMBLER_H_ 875 #endif // V8_ASSEMBLER_H_
OLDNEW
« no previous file with comments | « src/array.js ('k') | src/assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698