| Index: src/liveedit.cc
|
| ===================================================================
|
| --- src/liveedit.cc (revision 7180)
|
| +++ src/liveedit.cc (working copy)
|
| @@ -47,6 +47,18 @@
|
| #ifdef ENABLE_DEBUGGER_SUPPORT
|
|
|
|
|
| +void SetElementNonStrict(Handle<JSObject> object,
|
| + uint32_t index,
|
| + Handle<Object> value) {
|
| + // Ignore return value from SetElement. It can only be a failure if there
|
| + // are element setters causing exceptions and the debugger context has none
|
| + // of these.
|
| + Handle<Object> no_failure;
|
| + no_failure = SetElement(object, index, value, kNonStrictMode);
|
| + ASSERT(!no_failure.is_null());
|
| + USE(no_failure);
|
| +}
|
| +
|
| // A simple implementation of dynamic programming algorithm. It solves
|
| // the problem of finding the difference of 2 arrays. It uses a table of results
|
| // of subproblems. Each cell contains a number together with 2-bit flag
|
| @@ -286,11 +298,15 @@
|
| }
|
|
|
| void WriteChunk(int char_pos1, int char_pos2, int char_len1, int char_len2) {
|
| - SetElement(array_, current_size_, Handle<Object>(Smi::FromInt(char_pos1)));
|
| - SetElement(array_, current_size_ + 1,
|
| - Handle<Object>(Smi::FromInt(char_pos1 + char_len1)));
|
| - SetElement(array_, current_size_ + 2,
|
| - Handle<Object>(Smi::FromInt(char_pos2 + char_len2)));
|
| + SetElementNonStrict(array_,
|
| + current_size_,
|
| + Handle<Object>(Smi::FromInt(char_pos1)));
|
| + SetElementNonStrict(array_,
|
| + current_size_ + 1,
|
| + Handle<Object>(Smi::FromInt(char_pos1 + char_len1)));
|
| + SetElementNonStrict(array_,
|
| + current_size_ + 2,
|
| + Handle<Object>(Smi::FromInt(char_pos2 + char_len2)));
|
| current_size_ += 3;
|
| }
|
|
|
| @@ -545,10 +561,12 @@
|
|
|
| protected:
|
| void SetField(int field_position, Handle<Object> value) {
|
| - SetElement(array_, field_position, value);
|
| + SetElementNonStrict(array_, field_position, value);
|
| }
|
| void SetSmiValueField(int field_position, int value) {
|
| - SetElement(array_, field_position, Handle<Smi>(Smi::FromInt(value)));
|
| + SetElementNonStrict(array_,
|
| + field_position,
|
| + Handle<Smi>(Smi::FromInt(value)));
|
| }
|
| Object* GetField(int field_position) {
|
| return array_->GetElementNoExceptionThrown(field_position);
|
| @@ -687,7 +705,7 @@
|
| fun->end_position(), fun->num_parameters(),
|
| current_parent_index_);
|
| current_parent_index_ = len_;
|
| - SetElement(result_, len_, info.GetJSArray());
|
| + SetElementNonStrict(result_, len_, info.GetJSArray());
|
| len_++;
|
| }
|
|
|
| @@ -767,14 +785,19 @@
|
| list[k] = list[l];
|
| }
|
| for (int i = 0; i < j; i++) {
|
| - SetElement(scope_info_list, scope_info_length, list[i]->name());
|
| + SetElementNonStrict(scope_info_list,
|
| + scope_info_length,
|
| + list[i]->name());
|
| scope_info_length++;
|
| - SetElement(scope_info_list, scope_info_length,
|
| - Handle<Smi>(Smi::FromInt(list[i]->AsSlot()->index())));
|
| + SetElementNonStrict(
|
| + scope_info_list,
|
| + scope_info_length,
|
| + Handle<Smi>(Smi::FromInt(list[i]->AsSlot()->index())));
|
| scope_info_length++;
|
| }
|
| - SetElement(scope_info_list, scope_info_length,
|
| - Handle<Object>(Heap::null_value()));
|
| + SetElementNonStrict(scope_info_list,
|
| + scope_info_length,
|
| + Handle<Object>(Heap::null_value()));
|
| scope_info_length++;
|
|
|
| outer_scope = outer_scope->outer_scope();
|
| @@ -817,7 +840,7 @@
|
| Handle<String> name_handle(String::cast(info->name()));
|
| info_wrapper.SetProperties(name_handle, info->start_position(),
|
| info->end_position(), info);
|
| - SetElement(array, i, info_wrapper.GetJSArray());
|
| + SetElementNonStrict(array, i, info_wrapper.GetJSArray());
|
| }
|
| }
|
|
|
| @@ -1317,7 +1340,7 @@
|
| SharedFunctionInfo::cast(wrapper->value()));
|
|
|
| if (function->shared() == *shared || IsInlined(*function, *shared)) {
|
| - SetElement(result, i, Handle<Smi>(Smi::FromInt(status)));
|
| + SetElementNonStrict(result, i, Handle<Smi>(Smi::FromInt(status)));
|
| return true;
|
| }
|
| }
|
| @@ -1522,7 +1545,7 @@
|
| Smi::FromInt(LiveEdit::FUNCTION_BLOCKED_ON_ACTIVE_STACK)) {
|
| Handle<Object> replaced(
|
| Smi::FromInt(LiveEdit::FUNCTION_REPLACED_ON_ACTIVE_STACK));
|
| - SetElement(result, i, replaced);
|
| + SetElementNonStrict(result, i, replaced);
|
| }
|
| }
|
| return NULL;
|
| @@ -1562,8 +1585,10 @@
|
|
|
| // Fill the default values.
|
| for (int i = 0; i < len; i++) {
|
| - SetElement(result, i,
|
| - Handle<Smi>(Smi::FromInt(FUNCTION_AVAILABLE_FOR_PATCH)));
|
| + SetElementNonStrict(
|
| + result,
|
| + i,
|
| + Handle<Smi>(Smi::FromInt(FUNCTION_AVAILABLE_FOR_PATCH)));
|
| }
|
|
|
|
|
| @@ -1582,7 +1607,7 @@
|
| // Add error message as an array extra element.
|
| Vector<const char> vector_message(error_message, StrLength(error_message));
|
| Handle<String> str = Factory::NewStringFromAscii(vector_message);
|
| - SetElement(result, len, str);
|
| + SetElementNonStrict(result, len, str);
|
| }
|
| return result;
|
| }
|
|
|