void RelocInfo::set_call_address(Address target) {
- ASSERT(IsPatchedReturnSequence());
- // The 2 instructions offset assumes patched return sequence.
- ASSERT(IsJSReturn(rmode()));
+ ASSERT((IsJSReturn(rmode()) && IsPatchedReturnSequence()) ||
+ (IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence()));
Memory::Address_at(pc_ + 2 * Assembler::kInstrSize) = target;
}
}
-Object** RelocInfo::call_object_address() {
- ASSERT(IsPatchedReturnSequence());
- // The 2 instructions offset assumes patched return sequence.
- ASSERT(IsJSReturn(rmode()));
- return reinterpret_cast<Object**>(pc_ + 2 * Assembler::kInstrSize);
+void RelocInfo::set_call_object(Object* target) {
+ *call_object_address() = target;
}
-void RelocInfo::set_call_object(Object* target) {
- *call_object_address() = target;
+Object** RelocInfo::call_object_address() {
+ ASSERT((IsJSReturn(rmode()) && IsPatchedReturnSequence()) ||
+ (IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence()));
+ return reinterpret_cast<Object**>(pc_ + 2 * Assembler::kInstrSize);
}
INLINE(Address call_address());
INLINE(void set_call_address(Address target));
INLINE(Object* call_object());
- INLINE(Object** call_object_address());
INLINE(void set_call_object(Object* target));
+ INLINE(Object** call_object_address());
inline void Visit(ObjectVisitor* v);
Address RelocInfo::call_address() {
- ASSERT(IsPatchedReturnSequence());
+ ASSERT((IsJSReturn(rmode()) && IsPatchedReturnSequence()) ||
+ (IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence()));
return Assembler::target_address_at(pc_ + 1);
}
void RelocInfo::set_call_address(Address target) {
- ASSERT(IsPatchedReturnSequence());
+ ASSERT((IsJSReturn(rmode()) && IsPatchedReturnSequence()) ||
+ (IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence()));
Assembler::set_target_address_at(pc_ + 1, target);
}
Object* RelocInfo::call_object() {
- ASSERT(IsPatchedReturnSequence());
return *call_object_address();
}
-Object** RelocInfo::call_object_address() {
- ASSERT(IsPatchedReturnSequence());
- return reinterpret_cast<Object**>(pc_ + 1);
+void RelocInfo::set_call_object(Object* target) {
+ *call_object_address() = target;
}
-void RelocInfo::set_call_object(Object* target) {
- ASSERT(IsPatchedReturnSequence());
- *call_object_address() = target;
+Object** RelocInfo::call_object_address() {
+ ASSERT((IsJSReturn(rmode()) && IsPatchedReturnSequence()) ||
+ (IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence()));
+ return reinterpret_cast<Object**>(pc_ + 1);
}
Memory::Address_at(pc_) += static_cast<int32_t>(delta);
} else if (IsCodeTarget(rmode_)) {
Memory::int32_at(pc_) -= static_cast<int32_t>(delta);
- } else if (rmode_ == JS_RETURN && IsPatchedReturnSequence()) {
- // Special handling of js_return when a break point is set (call
- // instruction has been inserted).
- Memory::int32_at(pc_ + 1) -= static_cast<int32_t>(delta); // relocate entry
- } else if (rmode_ == DEBUG_BREAK_SLOT && IsPatchedDebugBreakSlotSequence()) {
- // Special handling of debug break slot when a break point is set (call
- // instruction has been inserted).
- Memory::int32_at(pc_ + 1) -= static_cast<int32_t>(delta); // relocate entry
}
}
Address RelocInfo::call_address() {
- ASSERT(IsPatchedReturnSequence());
+ ASSERT((IsJSReturn(rmode()) && IsPatchedReturnSequence()) ||
+ (IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence()));
return Memory::Address_at(
pc_ + Assembler::kRealPatchReturnSequenceAddressOffset);
}
void RelocInfo::set_call_address(Address target) {
- ASSERT(IsPatchedReturnSequence());
+ ASSERT((IsJSReturn(rmode()) && IsPatchedReturnSequence()) ||
+ (IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence()));
Memory::Address_at(pc_ + Assembler::kRealPatchReturnSequenceAddressOffset) =
target;
}
Object* RelocInfo::call_object() {
- ASSERT(IsPatchedReturnSequence());
return *call_object_address();
}
void RelocInfo::set_call_object(Object* target) {
- ASSERT(IsPatchedReturnSequence());
*call_object_address() = target;
}
Object** RelocInfo::call_object_address() {
- ASSERT(IsPatchedReturnSequence());
+ ASSERT((IsJSReturn(rmode()) && IsPatchedReturnSequence()) ||
+ (IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence()));
return reinterpret_cast<Object**>(
pc_ + Assembler::kPatchReturnSequenceAddressOffset);
}
const int RelocInfo::kApplyMask = RelocInfo::kCodeTargetMask |
- 1 << RelocInfo::INTERNAL_REFERENCE |
- 1 << RelocInfo::JS_RETURN |
- 1 << RelocInfo::DEBUG_BREAK_SLOT;
+ 1 << RelocInfo::INTERNAL_REFERENCE;
bool RelocInfo::IsCodedSpecially() {
v8::Local<v8::Function> foo;
// Test IC store break point with garbage collection.
- foo = CompileFunction(&env, "function foo(){bar=0;}", "foo");
- SetBreakPoint(foo, 0);
+ {
+ v8::Local<v8::Function> bar =
+ CompileFunction(&env, "function foo(){}", "foo");
+ foo = CompileFunction(&env, "function foo(){bar=0;}", "foo");
+ SetBreakPoint(foo, 0);
+ }
CallAndGC(env->Global(), foo, force_compaction);
// Test IC load break point with garbage collection.
- foo = CompileFunction(&env, "bar=1;function foo(){var x=bar;}", "foo");
- SetBreakPoint(foo, 0);
+ {
+ v8::Local<v8::Function> bar =
+ CompileFunction(&env, "function foo(){}", "foo");
+ foo = CompileFunction(&env, "bar=1;function foo(){var x=bar;}", "foo");
+ SetBreakPoint(foo, 0);
+ }
CallAndGC(env->Global(), foo, force_compaction);
// Test IC call break point with garbage collection.
- foo = CompileFunction(&env, "function bar(){};function foo(){bar();}", "foo");
- SetBreakPoint(foo, 0);
+ {
+ v8::Local<v8::Function> bar =
+ CompileFunction(&env, "function foo(){}", "foo");
+ foo = CompileFunction(&env,
+ "function bar(){};function foo(){bar();}",
+ "foo");
+ SetBreakPoint(foo, 0);
+ }
CallAndGC(env->Global(), foo, force_compaction);
// Test return break point with garbage collection.
- foo = CompileFunction(&env, "function foo(){}", "foo");
- SetBreakPoint(foo, 0);
+ {
+ v8::Local<v8::Function> bar =
+ CompileFunction(&env, "function foo(){}", "foo");
+ foo = CompileFunction(&env, "function foo(){}", "foo");
+ SetBreakPoint(foo, 0);
+ }
CallAndGC(env->Global(), foo, force_compaction);
+ // Test non IC break point with garbage collection.
+ {
+ v8::Local<v8::Function> bar =
+ CompileFunction(&env, "function foo(){}", "foo");
+ foo = CompileFunction(&env, "function foo(){var bar=0;}", "foo");
+ SetBreakPoint(foo, 0);
+ }
+ CallAndGC(env->Global(), foo, force_compaction);
+
+
v8::Debug::SetDebugEventListener(NULL);
CheckDebuggerUnloaded();
}