field_position,
Handle<Smi>(Smi::FromInt(value), isolate()));
}
- Object* GetField(int field_position) {
- return array_->GetElementNoExceptionThrown(isolate(), field_position);
+ Handle<Object> GetField(int field_position) {
+ return Object::GetElementNoExceptionThrown(
+ isolate(), array_, field_position);
}
int GetSmiValueField(int field_position) {
- Object* res = GetField(field_position);
- CHECK(res->IsSmi());
- return Smi::cast(res)->value();
+ Handle<Object> res = GetField(field_position);
+ return Handle<Smi>::cast(res)->value();
}
private:
return this->GetSmiValueField(kParentIndexOffset_);
}
Handle<Code> GetFunctionCode() {
- Object* element = this->GetField(kCodeOffset_);
- CHECK(element->IsJSValue());
- Handle<JSValue> value_wrapper(JSValue::cast(element));
+ Handle<Object> element = this->GetField(kCodeOffset_);
+ Handle<JSValue> value_wrapper = Handle<JSValue>::cast(element);
Handle<Object> raw_result = UnwrapJSValue(value_wrapper);
CHECK(raw_result->IsCode());
return Handle<Code>::cast(raw_result);
}
Handle<Object> GetCodeScopeInfo() {
- Object* element = this->GetField(kCodeScopeInfoOffset_);
- CHECK(element->IsJSValue());
- return UnwrapJSValue(Handle<JSValue>(JSValue::cast(element)));
+ Handle<Object> element = this->GetField(kCodeScopeInfoOffset_);
+ return UnwrapJSValue(Handle<JSValue>::cast(element));
}
int GetStartPosition() {
return this->GetSmiValueField(kStartPositionOffset_);
public:
static bool IsInstance(Handle<JSArray> array) {
return array->length() == Smi::FromInt(kSize_) &&
- array->GetElementNoExceptionThrown(
- array->GetIsolate(), kSharedInfoOffset_)->IsJSValue();
+ Object::GetElementNoExceptionThrown(
+ array->GetIsolate(), array, kSharedInfoOffset_)->IsJSValue();
}
explicit SharedInfoWrapper(Handle<JSArray> array)
this->SetSmiValueField(kEndPositionOffset_, end_position);
}
Handle<SharedFunctionInfo> GetInfo() {
- Object* element = this->GetField(kSharedInfoOffset_);
- CHECK(element->IsJSValue());
- Handle<JSValue> value_wrapper(JSValue::cast(element));
+ Handle<Object> element = this->GetField(kSharedInfoOffset_);
+ Handle<JSValue> value_wrapper = Handle<JSValue>::cast(element);
return UnwrapSharedFunctionInfoFromJSValue(value_wrapper);
}
HandleScope scope(isolate());
FunctionInfoWrapper info =
FunctionInfoWrapper::cast(
- result_->GetElementNoExceptionThrown(
- isolate(), current_parent_index_));
+ *Object::GetElementNoExceptionThrown(
+ isolate(), result_, current_parent_index_));
current_parent_index_ = info.GetParentIndex();
}
void FunctionCode(Handle<Code> function_code) {
FunctionInfoWrapper info =
FunctionInfoWrapper::cast(
- result_->GetElementNoExceptionThrown(
- isolate(), current_parent_index_));
+ *Object::GetElementNoExceptionThrown(
+ isolate(), result_, current_parent_index_));
info.SetFunctionCode(function_code,
Handle<HeapObject>(isolate()->heap()->null_value()));
}
}
FunctionInfoWrapper info =
FunctionInfoWrapper::cast(
- result_->GetElementNoExceptionThrown(
- isolate(), current_parent_index_));
+ *Object::GetElementNoExceptionThrown(
+ isolate(), result_, current_parent_index_));
info.SetFunctionCode(Handle<Code>(shared->code()),
Handle<HeapObject>(shared->scope_info()));
info.SetSharedFunctionInfo(shared);
for (int i = 0; i < len; i++) {
Handle<SharedFunctionInfo> info(
SharedFunctionInfo::cast(
- array->GetElementNoExceptionThrown(isolate, i)));
+ *Object::GetElementNoExceptionThrown(isolate, array, i)));
SharedInfoWrapper info_wrapper = SharedInfoWrapper::Create(isolate);
Handle<String> name_handle(String::cast(info->name()));
info_wrapper.SetProperties(name_handle, info->start_position(),
Isolate* isolate = position_change_array->GetIsolate();
// TODO(635): binary search may be used here
for (int i = 0; i < array_len; i += 3) {
- Object* element =
- position_change_array->GetElementNoExceptionThrown(isolate, i);
+ HandleScope scope(isolate);
+ Handle<Object> element = Object::GetElementNoExceptionThrown(
+ isolate, position_change_array, i);
CHECK(element->IsSmi());
- int chunk_start = Smi::cast(element)->value();
+ int chunk_start = Handle<Smi>::cast(element)->value();
if (original_position < chunk_start) {
break;
}
- element = position_change_array->GetElementNoExceptionThrown(isolate,
- i + 1);
+ element = Object::GetElementNoExceptionThrown(
+ isolate, position_change_array, i + 1);
CHECK(element->IsSmi());
- int chunk_end = Smi::cast(element)->value();
+ int chunk_end = Handle<Smi>::cast(element)->value();
// Position mustn't be inside a chunk.
ASSERT(original_position >= chunk_end);
- element = position_change_array->GetElementNoExceptionThrown(isolate,
- i + 2);
+ element = Object::GetElementNoExceptionThrown(
+ isolate, position_change_array, i + 2);
CHECK(element->IsSmi());
- int chunk_changed_end = Smi::cast(element)->value();
+ int chunk_changed_end = Handle<Smi>::cast(element)->value();
position_diff = chunk_changed_end - chunk_end;
}
code->instruction_start());
{
- DisallowHeapAllocation no_allocation;
for (RelocIterator it(*code); !it.done(); it.next()) {
RelocInfo* rinfo = it.rinfo();
if (RelocInfo::IsPosition(rinfo->rmode())) {
Isolate* isolate = shared_info_array->GetIsolate();
int len = GetArrayLength(shared_info_array);
for (int i = 0; i < len; i++) {
- Object* element =
- shared_info_array->GetElementNoExceptionThrown(isolate, i);
- CHECK(element->IsJSValue());
- Handle<JSValue> jsvalue(JSValue::cast(element));
+ HandleScope scope(isolate);
+ Handle<Object> element =
+ Object::GetElementNoExceptionThrown(isolate, shared_info_array, i);
+ Handle<JSValue> jsvalue = Handle<JSValue>::cast(element);
Handle<SharedFunctionInfo> shared =
UnwrapSharedFunctionInfoFromJSValue(jsvalue);
// Replace "blocked on active" with "replaced on active" status.
for (int i = 0; i < array_len; i++) {
- Handle<Object> obj = Object::GetElement(isolate, result, i);
- CHECK_NOT_EMPTY_HANDLE(isolate, obj);
+ Handle<Object> obj =
+ Object::GetElementNoExceptionThrown(isolate, result, i);
if (*obj == Smi::FromInt(LiveEdit::FUNCTION_BLOCKED_ON_ACTIVE_STACK)) {
Handle<Object> replaced(
Smi::FromInt(LiveEdit::FUNCTION_REPLACED_ON_ACTIVE_STACK), isolate);
if (object->GetLocalElementAccessorPair(index) != NULL) {
old_value = Handle<Object>::cast(factory->the_hole_value());
} else {
- old_value = Object::GetElement(isolate, object, index);
- CHECK_NOT_EMPTY_HANDLE(isolate, old_value);
+ old_value = Object::GetElementNoExceptionThrown(isolate, object, index);
}
}
}
if (is_element) {
preexists = HasLocalElement(object, index);
if (preexists && object->GetLocalElementAccessorPair(index) == NULL) {
- old_value = Object::GetElement(isolate, object, index);
- CHECK_NOT_EMPTY_HANDLE(isolate, old_value);
+ old_value = Object::GetElementNoExceptionThrown(isolate, object, index);
}
} else {
LookupResult lookup(isolate);
if (object->GetLocalElementAccessorPair(index) != NULL) {
value = Handle<Object>::cast(isolate->factory()->the_hole_value());
} else {
- value = Object::GetElement(isolate, object, index);
- CHECK_NOT_EMPTY_HANDLE(isolate, value);
+ value = Object::GetElementNoExceptionThrown(isolate, object, index);
}
old_values->Add(value);
indices->Add(index);
if (old_attributes != ABSENT) {
if (object->GetLocalElementAccessorPair(index) == NULL) {
- old_value = Object::GetElement(isolate, object, index);
- CHECK_NOT_EMPTY_HANDLE(isolate, old_value);
+ old_value = Object::GetElementNoExceptionThrown(isolate, object, index);
}
} else if (object->IsJSArray()) {
// Store old array length in case adding an element grows the array.
} else if (old_value->IsTheHole()) {
EnqueueChangeRecord(object, "reconfigure", name, old_value);
} else {
- Handle<Object> new_value = Object::GetElement(isolate, object, index);
- CHECK_NOT_EMPTY_HANDLE(isolate, new_value);
+ Handle<Object> new_value =
+ Object::GetElementNoExceptionThrown(isolate, object, index);
bool value_changed = !old_value->SameValue(*new_value);
if (old_attributes != new_attributes) {
if (!value_changed) old_value = isolate->factory()->the_hole_value();