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

Side by Side Diff: src/ia32/assembler-ia32-inl.h

Issue 6542047: Basic implementation of incremental marking. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Created 9 years, 10 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
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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY); 81 ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY);
82 return reinterpret_cast<Address>(pc_); 82 return reinterpret_cast<Address>(pc_);
83 } 83 }
84 84
85 85
86 int RelocInfo::target_address_size() { 86 int RelocInfo::target_address_size() {
87 return Assembler::kExternalTargetSize; 87 return Assembler::kExternalTargetSize;
88 } 88 }
89 89
90 90
91 void RelocInfo::set_target_address(Address target) { 91 void RelocInfo::set_target_address(Address target, Code* code) {
92 ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY); 92 ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY);
93 if (code != NULL && IsCodeTarget(rmode_)) {
94 Object* target_code = Code::GetCodeFromTargetAddress(target);
95 IncrementalMarking::RecordWrite(code, HeapObject::cast(target_code));
96 }
93 Assembler::set_target_address_at(pc_, target); 97 Assembler::set_target_address_at(pc_, target);
94 } 98 }
95 99
96 100
97 Object* RelocInfo::target_object() { 101 Object* RelocInfo::target_object() {
98 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); 102 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
99 return Memory::Object_at(pc_); 103 return Memory::Object_at(pc_);
100 } 104 }
101 105
102 106
103 Handle<Object> RelocInfo::target_object_handle(Assembler* origin) { 107 Handle<Object> RelocInfo::target_object_handle(Assembler* origin) {
104 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); 108 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
105 return Memory::Object_Handle_at(pc_); 109 return Memory::Object_Handle_at(pc_);
106 } 110 }
107 111
108 112
109 Object** RelocInfo::target_object_address() { 113 Object** RelocInfo::target_object_address() {
110 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); 114 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
111 return &Memory::Object_at(pc_); 115 return &Memory::Object_at(pc_);
112 } 116 }
113 117
114 118
115 void RelocInfo::set_target_object(Object* target) { 119 void RelocInfo::set_target_object(Object* target, Code* code) {
116 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); 120 ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
117 Memory::Object_at(pc_) = target; 121 Memory::Object_at(pc_) = target;
118 CPU::FlushICache(pc_, sizeof(Address)); 122 CPU::FlushICache(pc_, sizeof(Address));
123 if (code != NULL && target->IsHeapObject()) {
124 IncrementalMarking::RecordWrite(code, HeapObject::cast(target));
125 }
119 } 126 }
120 127
121 128
122 Address* RelocInfo::target_reference_address() { 129 Address* RelocInfo::target_reference_address() {
123 ASSERT(rmode_ == RelocInfo::EXTERNAL_REFERENCE); 130 ASSERT(rmode_ == RelocInfo::EXTERNAL_REFERENCE);
124 return reinterpret_cast<Address*>(pc_); 131 return reinterpret_cast<Address*>(pc_);
125 } 132 }
126 133
127 134
128 Handle<JSGlobalPropertyCell> RelocInfo::target_cell_handle() { 135 Handle<JSGlobalPropertyCell> RelocInfo::target_cell_handle() {
129 ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL); 136 ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL);
130 Address address = Memory::Address_at(pc_); 137 Address address = Memory::Address_at(pc_);
131 return Handle<JSGlobalPropertyCell>( 138 return Handle<JSGlobalPropertyCell>(
132 reinterpret_cast<JSGlobalPropertyCell**>(address)); 139 reinterpret_cast<JSGlobalPropertyCell**>(address));
133 } 140 }
134 141
135 142
136 JSGlobalPropertyCell* RelocInfo::target_cell() { 143 JSGlobalPropertyCell* RelocInfo::target_cell() {
137 ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL); 144 ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL);
138 Address address = Memory::Address_at(pc_); 145 Address address = Memory::Address_at(pc_);
139 Object* object = HeapObject::FromAddress( 146 Object* object = HeapObject::FromAddress(
140 address - JSGlobalPropertyCell::kValueOffset); 147 address - JSGlobalPropertyCell::kValueOffset);
141 return reinterpret_cast<JSGlobalPropertyCell*>(object); 148 return reinterpret_cast<JSGlobalPropertyCell*>(object);
142 } 149 }
143 150
144 151
145 void RelocInfo::set_target_cell(JSGlobalPropertyCell* cell) { 152 void RelocInfo::set_target_cell(JSGlobalPropertyCell* cell, Code* code) {
146 ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL); 153 ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL);
147 Address address = cell->address() + JSGlobalPropertyCell::kValueOffset; 154 Address address = cell->address() + JSGlobalPropertyCell::kValueOffset;
148 Memory::Address_at(pc_) = address; 155 Memory::Address_at(pc_) = address;
149 CPU::FlushICache(pc_, sizeof(Address)); 156 CPU::FlushICache(pc_, sizeof(Address));
157 if (code != NULL) IncrementalMarking::RecordWrite(code, cell);
150 } 158 }
151 159
152 160
153 Address RelocInfo::call_address() { 161 Address RelocInfo::call_address() {
154 ASSERT((IsJSReturn(rmode()) && IsPatchedReturnSequence()) || 162 ASSERT((IsJSReturn(rmode()) && IsPatchedReturnSequence()) ||
155 (IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence())); 163 (IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence()));
156 return Assembler::target_address_at(pc_ + 1); 164 return Assembler::target_address_at(pc_ + 1);
157 } 165 }
158 166
159 167
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 428
421 Operand::Operand(int32_t disp, RelocInfo::Mode rmode) { 429 Operand::Operand(int32_t disp, RelocInfo::Mode rmode) {
422 // [disp/r] 430 // [disp/r]
423 set_modrm(0, ebp); 431 set_modrm(0, ebp);
424 set_dispr(disp, rmode); 432 set_dispr(disp, rmode);
425 } 433 }
426 434
427 } } // namespace v8::internal 435 } } // namespace v8::internal
428 436
429 #endif // V8_IA32_ASSEMBLER_IA32_INL_H_ 437 #endif // V8_IA32_ASSEMBLER_IA32_INL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698