Harden yet more runtime functions

R=dslomov@chromium.org

Review URL: https://codereview.chromium.org/270273005

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21197 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 8999a006
......@@ -1108,7 +1108,7 @@ Handle<DebugInfo> Debug::GetDebugInfo(Handle<SharedFunctionInfo> shared) {
}
void Debug::SetBreakPoint(Handle<JSFunction> function,
bool Debug::SetBreakPoint(Handle<JSFunction> function,
Handle<Object> break_point_object,
int* source_position) {
HandleScope scope(isolate_);
......@@ -1119,7 +1119,7 @@ void Debug::SetBreakPoint(Handle<JSFunction> function,
Handle<SharedFunctionInfo> shared(function->shared());
if (!EnsureDebugInfo(shared, function)) {
// Return if retrieving debug info failed.
return;
return true;
}
Handle<DebugInfo> debug_info = GetDebugInfo(shared);
......@@ -1134,7 +1134,7 @@ void Debug::SetBreakPoint(Handle<JSFunction> function,
*source_position = it.position();
// At least one active break point now.
ASSERT(debug_info->GetBreakPointCount() > 0);
return debug_info->GetBreakPointCount() > 0;
}
......
......@@ -219,7 +219,7 @@ class Debug {
void PreemptionWhileInDebugger();
Object* Break(Arguments args);
void SetBreakPoint(Handle<JSFunction> function,
bool SetBreakPoint(Handle<JSFunction> function,
Handle<Object> break_point_object,
int* source_position);
bool SetBreakPointForScript(Handle<Script> script,
......
......@@ -278,9 +278,13 @@ class FunctionInfoWrapper : public JSArrayBasedStruct<FunctionInfoWrapper> {
class SharedInfoWrapper : public JSArrayBasedStruct<SharedInfoWrapper> {
public:
static bool IsInstance(Handle<JSArray> array) {
return array->length() == Smi::FromInt(kSize_) &&
Object::GetElement(array->GetIsolate(), array, kSharedInfoOffset_)
.ToHandleChecked()->IsJSValue();
if (array->length() != Smi::FromInt(kSize_)) return false;
Handle<Object> element(
Object::GetElement(array->GetIsolate(),
array,
kSharedInfoOffset_).ToHandleChecked());
if (!element->IsJSValue()) return false;
return Handle<JSValue>::cast(element)->value()->IsSharedFunctionInfo();
}
explicit SharedInfoWrapper(Handle<JSArray> array)
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment