~ubuntu-branches/ubuntu/trusty/libv8/trusty

« back to all changes in this revision

Viewing changes to src/arm/assembler-arm-inl.h

  • Committer: Package Import Robot
  • Author(s): Jérémy Lal
  • Date: 2012-02-20 14:08:17 UTC
  • mfrom: (15.1.24 sid)
  • Revision ID: package-import@ubuntu.com-20120220140817-bsvmeoa4sxsj5hbz
Tags: 3.7.12.22-3
Fix mipsel build, allow test debug-step-3 to fail (non-crucial)

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
 
33
33
// The original source code covered by the above license above has been modified
34
34
// significantly by Google Inc.
35
 
// Copyright 2006-2008 the V8 project authors. All rights reserved.
 
35
// Copyright 2012 the V8 project authors. All rights reserved.
36
36
 
37
37
#ifndef V8_ARM_ASSEMBLER_ARM_INL_H_
38
38
#define V8_ARM_ASSEMBLER_ARM_INL_H_
46
46
namespace internal {
47
47
 
48
48
 
 
49
int DwVfpRegister::ToAllocationIndex(DwVfpRegister reg) {
 
50
  ASSERT(!reg.is(kDoubleRegZero));
 
51
  ASSERT(!reg.is(kScratchDoubleReg));
 
52
  return reg.code();
 
53
}
 
54
 
 
55
 
49
56
void RelocInfo::apply(intptr_t delta) {
50
57
  if (RelocInfo::IsInternalReference(rmode_)) {
51
58
    // absolute code pointer inside code object moves with the code object.
64
71
 
65
72
 
66
73
Address RelocInfo::target_address_address() {
67
 
  ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY);
 
74
  ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY
 
75
                              || rmode_ == EMBEDDED_OBJECT
 
76
                              || rmode_ == EXTERNAL_REFERENCE);
68
77
  return reinterpret_cast<Address>(Assembler::target_address_address_at(pc_));
69
78
}
70
79
 
74
83
}
75
84
 
76
85
 
77
 
void RelocInfo::set_target_address(Address target) {
 
86
void RelocInfo::set_target_address(Address target, WriteBarrierMode mode) {
78
87
  ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY);
79
88
  Assembler::set_target_address_at(pc_, target);
 
89
  if (mode == UPDATE_WRITE_BARRIER && host() != NULL && IsCodeTarget(rmode_)) {
 
90
    Object* target_code = Code::GetCodeFromTargetAddress(target);
 
91
    host()->GetHeap()->incremental_marking()->RecordWriteIntoCode(
 
92
        host(), this, HeapObject::cast(target_code));
 
93
  }
80
94
}
81
95
 
82
96
 
98
112
}
99
113
 
100
114
 
101
 
void RelocInfo::set_target_object(Object* target) {
 
115
void RelocInfo::set_target_object(Object* target, WriteBarrierMode mode) {
102
116
  ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
103
117
  Assembler::set_target_address_at(pc_, reinterpret_cast<Address>(target));
 
118
  if (mode == UPDATE_WRITE_BARRIER &&
 
119
      host() != NULL &&
 
120
      target->IsHeapObject()) {
 
121
    host()->GetHeap()->incremental_marking()->RecordWrite(
 
122
        host(), &Memory::Object_at(pc_), HeapObject::cast(target));
 
123
  }
104
124
}
105
125
 
106
126
 
127
147
}
128
148
 
129
149
 
130
 
void RelocInfo::set_target_cell(JSGlobalPropertyCell* cell) {
 
150
void RelocInfo::set_target_cell(JSGlobalPropertyCell* cell,
 
151
                                WriteBarrierMode mode) {
131
152
  ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL);
132
153
  Address address = cell->address() + JSGlobalPropertyCell::kValueOffset;
133
154
  Memory::Address_at(pc_) = address;
 
155
  if (mode == UPDATE_WRITE_BARRIER && host() != NULL) {
 
156
    // TODO(1550) We are passing NULL as a slot because cell can never be on
 
157
    // evacuation candidate.
 
158
    host()->GetHeap()->incremental_marking()->RecordWrite(
 
159
        host(), NULL, cell);
 
160
  }
134
161
}
135
162
 
136
163
 
147
174
  ASSERT((IsJSReturn(rmode()) && IsPatchedReturnSequence()) ||
148
175
         (IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence()));
149
176
  Memory::Address_at(pc_ + 2 * Assembler::kInstrSize) = target;
 
177
  if (host() != NULL) {
 
178
    Object* target_code = Code::GetCodeFromTargetAddress(target);
 
179
    host()->GetHeap()->incremental_marking()->RecordWriteIntoCode(
 
180
        host(), this, HeapObject::cast(target_code));
 
181
  }
150
182
}
151
183
 
152
184
 
195
227
void RelocInfo::Visit(ObjectVisitor* visitor) {
196
228
  RelocInfo::Mode mode = rmode();
197
229
  if (mode == RelocInfo::EMBEDDED_OBJECT) {
198
 
    visitor->VisitPointer(target_object_address());
 
230
    visitor->VisitEmbeddedPointer(this);
199
231
  } else if (RelocInfo::IsCodeTarget(mode)) {
200
232
    visitor->VisitCodeTarget(this);
201
233
  } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) {
202
234
    visitor->VisitGlobalPropertyCell(this);
203
235
  } else if (mode == RelocInfo::EXTERNAL_REFERENCE) {
204
 
    visitor->VisitExternalReference(target_reference_address());
 
236
    visitor->VisitExternalReference(this);
205
237
#ifdef ENABLE_DEBUGGER_SUPPORT
206
238
  // TODO(isolates): Get a cached isolate below.
207
239
  } else if (((RelocInfo::IsJSReturn(mode) &&
221
253
void RelocInfo::Visit(Heap* heap) {
222
254
  RelocInfo::Mode mode = rmode();
223
255
  if (mode == RelocInfo::EMBEDDED_OBJECT) {
224
 
    StaticVisitor::VisitPointer(heap, target_object_address());
 
256
    StaticVisitor::VisitEmbeddedPointer(heap, this);
225
257
  } else if (RelocInfo::IsCodeTarget(mode)) {
226
258
    StaticVisitor::VisitCodeTarget(heap, this);
227
259
  } else if (mode == RelocInfo::GLOBAL_PROPERTY_CELL) {
228
260
    StaticVisitor::VisitGlobalPropertyCell(heap, this);
229
261
  } else if (mode == RelocInfo::EXTERNAL_REFERENCE) {
230
 
    StaticVisitor::VisitExternalReference(target_reference_address());
 
262
    StaticVisitor::VisitExternalReference(this);
231
263
#ifdef ENABLE_DEBUGGER_SUPPORT
232
264
  } else if (heap->isolate()->debug()->has_break_points() &&
233
265
             ((RelocInfo::IsJSReturn(mode) &&