| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 662 | 662 |
| 663 protected: | 663 protected: |
| 664 void SetField(int field_position, Handle<Object> value) { | 664 void SetField(int field_position, Handle<Object> value) { |
| 665 SetElementSloppy(array_, field_position, value); | 665 SetElementSloppy(array_, field_position, value); |
| 666 } | 666 } |
| 667 void SetSmiValueField(int field_position, int value) { | 667 void SetSmiValueField(int field_position, int value) { |
| 668 SetElementSloppy(array_, | 668 SetElementSloppy(array_, |
| 669 field_position, | 669 field_position, |
| 670 Handle<Smi>(Smi::FromInt(value), isolate())); | 670 Handle<Smi>(Smi::FromInt(value), isolate())); |
| 671 } | 671 } |
| 672 Object* GetField(int field_position) { | 672 Handle<Object> GetField(int field_position) { |
| 673 return array_->GetElementNoExceptionThrown(isolate(), field_position); | 673 return Object::GetElementNoExceptionThrown( |
| 674 isolate(), array_, field_position); |
| 674 } | 675 } |
| 675 int GetSmiValueField(int field_position) { | 676 int GetSmiValueField(int field_position) { |
| 676 Object* res = GetField(field_position); | 677 Handle<Object> res = GetField(field_position); |
| 677 CHECK(res->IsSmi()); | 678 return Handle<Smi>::cast(res)->value(); |
| 678 return Smi::cast(res)->value(); | |
| 679 } | 679 } |
| 680 | 680 |
| 681 private: | 681 private: |
| 682 Handle<JSArray> array_; | 682 Handle<JSArray> array_; |
| 683 }; | 683 }; |
| 684 | 684 |
| 685 | 685 |
| 686 // Represents some function compilation details. This structure will be used | 686 // Represents some function compilation details. This structure will be used |
| 687 // from JavaScript. It contains Code object, which is kept wrapped | 687 // from JavaScript. It contains Code object, which is kept wrapped |
| 688 // into a BlindReference for sanitizing reasons. | 688 // into a BlindReference for sanitizing reasons. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 717 Handle<JSValue> info_holder = WrapInJSValue(info); | 717 Handle<JSValue> info_holder = WrapInJSValue(info); |
| 718 this->SetField(kSharedFunctionInfoOffset_, info_holder); | 718 this->SetField(kSharedFunctionInfoOffset_, info_holder); |
| 719 } | 719 } |
| 720 int GetLiteralCount() { | 720 int GetLiteralCount() { |
| 721 return this->GetSmiValueField(kLiteralNumOffset_); | 721 return this->GetSmiValueField(kLiteralNumOffset_); |
| 722 } | 722 } |
| 723 int GetParentIndex() { | 723 int GetParentIndex() { |
| 724 return this->GetSmiValueField(kParentIndexOffset_); | 724 return this->GetSmiValueField(kParentIndexOffset_); |
| 725 } | 725 } |
| 726 Handle<Code> GetFunctionCode() { | 726 Handle<Code> GetFunctionCode() { |
| 727 Object* element = this->GetField(kCodeOffset_); | 727 Handle<Object> element = this->GetField(kCodeOffset_); |
| 728 CHECK(element->IsJSValue()); | 728 Handle<JSValue> value_wrapper = Handle<JSValue>::cast(element); |
| 729 Handle<JSValue> value_wrapper(JSValue::cast(element)); | |
| 730 Handle<Object> raw_result = UnwrapJSValue(value_wrapper); | 729 Handle<Object> raw_result = UnwrapJSValue(value_wrapper); |
| 731 CHECK(raw_result->IsCode()); | 730 CHECK(raw_result->IsCode()); |
| 732 return Handle<Code>::cast(raw_result); | 731 return Handle<Code>::cast(raw_result); |
| 733 } | 732 } |
| 734 Handle<Object> GetCodeScopeInfo() { | 733 Handle<Object> GetCodeScopeInfo() { |
| 735 Object* element = this->GetField(kCodeScopeInfoOffset_); | 734 Handle<Object> element = this->GetField(kCodeScopeInfoOffset_); |
| 736 CHECK(element->IsJSValue()); | 735 return UnwrapJSValue(Handle<JSValue>::cast(element)); |
| 737 return UnwrapJSValue(Handle<JSValue>(JSValue::cast(element))); | |
| 738 } | 736 } |
| 739 int GetStartPosition() { | 737 int GetStartPosition() { |
| 740 return this->GetSmiValueField(kStartPositionOffset_); | 738 return this->GetSmiValueField(kStartPositionOffset_); |
| 741 } | 739 } |
| 742 int GetEndPosition() { | 740 int GetEndPosition() { |
| 743 return this->GetSmiValueField(kEndPositionOffset_); | 741 return this->GetSmiValueField(kEndPositionOffset_); |
| 744 } | 742 } |
| 745 | 743 |
| 746 private: | 744 private: |
| 747 static const int kFunctionNameOffset_ = 0; | 745 static const int kFunctionNameOffset_ = 0; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 760 }; | 758 }; |
| 761 | 759 |
| 762 | 760 |
| 763 // Wraps SharedFunctionInfo along with some of its fields for passing it | 761 // Wraps SharedFunctionInfo along with some of its fields for passing it |
| 764 // back to JavaScript. SharedFunctionInfo object itself is additionally | 762 // back to JavaScript. SharedFunctionInfo object itself is additionally |
| 765 // wrapped into BlindReference for sanitizing reasons. | 763 // wrapped into BlindReference for sanitizing reasons. |
| 766 class SharedInfoWrapper : public JSArrayBasedStruct<SharedInfoWrapper> { | 764 class SharedInfoWrapper : public JSArrayBasedStruct<SharedInfoWrapper> { |
| 767 public: | 765 public: |
| 768 static bool IsInstance(Handle<JSArray> array) { | 766 static bool IsInstance(Handle<JSArray> array) { |
| 769 return array->length() == Smi::FromInt(kSize_) && | 767 return array->length() == Smi::FromInt(kSize_) && |
| 770 array->GetElementNoExceptionThrown( | 768 Object::GetElementNoExceptionThrown( |
| 771 array->GetIsolate(), kSharedInfoOffset_)->IsJSValue(); | 769 array->GetIsolate(), array, kSharedInfoOffset_)->IsJSValue(); |
| 772 } | 770 } |
| 773 | 771 |
| 774 explicit SharedInfoWrapper(Handle<JSArray> array) | 772 explicit SharedInfoWrapper(Handle<JSArray> array) |
| 775 : JSArrayBasedStruct<SharedInfoWrapper>(array) { | 773 : JSArrayBasedStruct<SharedInfoWrapper>(array) { |
| 776 } | 774 } |
| 777 | 775 |
| 778 void SetProperties(Handle<String> name, int start_position, int end_position, | 776 void SetProperties(Handle<String> name, int start_position, int end_position, |
| 779 Handle<SharedFunctionInfo> info) { | 777 Handle<SharedFunctionInfo> info) { |
| 780 HandleScope scope(isolate()); | 778 HandleScope scope(isolate()); |
| 781 this->SetField(kFunctionNameOffset_, name); | 779 this->SetField(kFunctionNameOffset_, name); |
| 782 Handle<JSValue> info_holder = WrapInJSValue(info); | 780 Handle<JSValue> info_holder = WrapInJSValue(info); |
| 783 this->SetField(kSharedInfoOffset_, info_holder); | 781 this->SetField(kSharedInfoOffset_, info_holder); |
| 784 this->SetSmiValueField(kStartPositionOffset_, start_position); | 782 this->SetSmiValueField(kStartPositionOffset_, start_position); |
| 785 this->SetSmiValueField(kEndPositionOffset_, end_position); | 783 this->SetSmiValueField(kEndPositionOffset_, end_position); |
| 786 } | 784 } |
| 787 Handle<SharedFunctionInfo> GetInfo() { | 785 Handle<SharedFunctionInfo> GetInfo() { |
| 788 Object* element = this->GetField(kSharedInfoOffset_); | 786 Handle<Object> element = this->GetField(kSharedInfoOffset_); |
| 789 CHECK(element->IsJSValue()); | 787 Handle<JSValue> value_wrapper = Handle<JSValue>::cast(element); |
| 790 Handle<JSValue> value_wrapper(JSValue::cast(element)); | |
| 791 return UnwrapSharedFunctionInfoFromJSValue(value_wrapper); | 788 return UnwrapSharedFunctionInfoFromJSValue(value_wrapper); |
| 792 } | 789 } |
| 793 | 790 |
| 794 private: | 791 private: |
| 795 static const int kFunctionNameOffset_ = 0; | 792 static const int kFunctionNameOffset_ = 0; |
| 796 static const int kStartPositionOffset_ = 1; | 793 static const int kStartPositionOffset_ = 1; |
| 797 static const int kEndPositionOffset_ = 2; | 794 static const int kEndPositionOffset_ = 2; |
| 798 static const int kSharedInfoOffset_ = 3; | 795 static const int kSharedInfoOffset_ = 3; |
| 799 static const int kSize_ = 4; | 796 static const int kSize_ = 4; |
| 800 | 797 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 819 current_parent_index_); | 816 current_parent_index_); |
| 820 current_parent_index_ = len_; | 817 current_parent_index_ = len_; |
| 821 SetElementSloppy(result_, len_, info.GetJSArray()); | 818 SetElementSloppy(result_, len_, info.GetJSArray()); |
| 822 len_++; | 819 len_++; |
| 823 } | 820 } |
| 824 | 821 |
| 825 void FunctionDone() { | 822 void FunctionDone() { |
| 826 HandleScope scope(isolate()); | 823 HandleScope scope(isolate()); |
| 827 FunctionInfoWrapper info = | 824 FunctionInfoWrapper info = |
| 828 FunctionInfoWrapper::cast( | 825 FunctionInfoWrapper::cast( |
| 829 result_->GetElementNoExceptionThrown( | 826 *Object::GetElementNoExceptionThrown( |
| 830 isolate(), current_parent_index_)); | 827 isolate(), result_, current_parent_index_)); |
| 831 current_parent_index_ = info.GetParentIndex(); | 828 current_parent_index_ = info.GetParentIndex(); |
| 832 } | 829 } |
| 833 | 830 |
| 834 // Saves only function code, because for a script function we | 831 // Saves only function code, because for a script function we |
| 835 // may never create a SharedFunctionInfo object. | 832 // may never create a SharedFunctionInfo object. |
| 836 void FunctionCode(Handle<Code> function_code) { | 833 void FunctionCode(Handle<Code> function_code) { |
| 837 FunctionInfoWrapper info = | 834 FunctionInfoWrapper info = |
| 838 FunctionInfoWrapper::cast( | 835 FunctionInfoWrapper::cast( |
| 839 result_->GetElementNoExceptionThrown( | 836 *Object::GetElementNoExceptionThrown( |
| 840 isolate(), current_parent_index_)); | 837 isolate(), result_, current_parent_index_)); |
| 841 info.SetFunctionCode(function_code, | 838 info.SetFunctionCode(function_code, |
| 842 Handle<HeapObject>(isolate()->heap()->null_value())); | 839 Handle<HeapObject>(isolate()->heap()->null_value())); |
| 843 } | 840 } |
| 844 | 841 |
| 845 // Saves full information about a function: its code, its scope info | 842 // Saves full information about a function: its code, its scope info |
| 846 // and a SharedFunctionInfo object. | 843 // and a SharedFunctionInfo object. |
| 847 void FunctionInfo(Handle<SharedFunctionInfo> shared, Scope* scope, | 844 void FunctionInfo(Handle<SharedFunctionInfo> shared, Scope* scope, |
| 848 Zone* zone) { | 845 Zone* zone) { |
| 849 if (!shared->IsSharedFunctionInfo()) { | 846 if (!shared->IsSharedFunctionInfo()) { |
| 850 return; | 847 return; |
| 851 } | 848 } |
| 852 FunctionInfoWrapper info = | 849 FunctionInfoWrapper info = |
| 853 FunctionInfoWrapper::cast( | 850 FunctionInfoWrapper::cast( |
| 854 result_->GetElementNoExceptionThrown( | 851 *Object::GetElementNoExceptionThrown( |
| 855 isolate(), current_parent_index_)); | 852 isolate(), result_, current_parent_index_)); |
| 856 info.SetFunctionCode(Handle<Code>(shared->code()), | 853 info.SetFunctionCode(Handle<Code>(shared->code()), |
| 857 Handle<HeapObject>(shared->scope_info())); | 854 Handle<HeapObject>(shared->scope_info())); |
| 858 info.SetSharedFunctionInfo(shared); | 855 info.SetSharedFunctionInfo(shared); |
| 859 | 856 |
| 860 Handle<Object> scope_info_list(SerializeFunctionScope(scope, zone), | 857 Handle<Object> scope_info_list(SerializeFunctionScope(scope, zone), |
| 861 isolate()); | 858 isolate()); |
| 862 info.SetFunctionScopeInfo(scope_info_list); | 859 info.SetFunctionScopeInfo(scope_info_list); |
| 863 } | 860 } |
| 864 | 861 |
| 865 Handle<JSArray> GetResult() { return result_; } | 862 Handle<JSArray> GetResult() { return result_; } |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 980 } | 977 } |
| 981 | 978 |
| 982 | 979 |
| 983 void LiveEdit::WrapSharedFunctionInfos(Handle<JSArray> array) { | 980 void LiveEdit::WrapSharedFunctionInfos(Handle<JSArray> array) { |
| 984 Isolate* isolate = array->GetIsolate(); | 981 Isolate* isolate = array->GetIsolate(); |
| 985 HandleScope scope(isolate); | 982 HandleScope scope(isolate); |
| 986 int len = GetArrayLength(array); | 983 int len = GetArrayLength(array); |
| 987 for (int i = 0; i < len; i++) { | 984 for (int i = 0; i < len; i++) { |
| 988 Handle<SharedFunctionInfo> info( | 985 Handle<SharedFunctionInfo> info( |
| 989 SharedFunctionInfo::cast( | 986 SharedFunctionInfo::cast( |
| 990 array->GetElementNoExceptionThrown(isolate, i))); | 987 *Object::GetElementNoExceptionThrown(isolate, array, i))); |
| 991 SharedInfoWrapper info_wrapper = SharedInfoWrapper::Create(isolate); | 988 SharedInfoWrapper info_wrapper = SharedInfoWrapper::Create(isolate); |
| 992 Handle<String> name_handle(String::cast(info->name())); | 989 Handle<String> name_handle(String::cast(info->name())); |
| 993 info_wrapper.SetProperties(name_handle, info->start_position(), | 990 info_wrapper.SetProperties(name_handle, info->start_position(), |
| 994 info->end_position(), info); | 991 info->end_position(), info); |
| 995 SetElementSloppy(array, i, info_wrapper.GetJSArray()); | 992 SetElementSloppy(array, i, info_wrapper.GetJSArray()); |
| 996 } | 993 } |
| 997 } | 994 } |
| 998 | 995 |
| 999 | 996 |
| 1000 // Visitor that finds all references to a particular code object, | 997 // Visitor that finds all references to a particular code object, |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1354 // Only position in text beyond any changes may be successfully translated. | 1351 // Only position in text beyond any changes may be successfully translated. |
| 1355 // If a positions is inside some region that changed, result is currently | 1352 // If a positions is inside some region that changed, result is currently |
| 1356 // undefined. | 1353 // undefined. |
| 1357 static int TranslatePosition(int original_position, | 1354 static int TranslatePosition(int original_position, |
| 1358 Handle<JSArray> position_change_array) { | 1355 Handle<JSArray> position_change_array) { |
| 1359 int position_diff = 0; | 1356 int position_diff = 0; |
| 1360 int array_len = GetArrayLength(position_change_array); | 1357 int array_len = GetArrayLength(position_change_array); |
| 1361 Isolate* isolate = position_change_array->GetIsolate(); | 1358 Isolate* isolate = position_change_array->GetIsolate(); |
| 1362 // TODO(635): binary search may be used here | 1359 // TODO(635): binary search may be used here |
| 1363 for (int i = 0; i < array_len; i += 3) { | 1360 for (int i = 0; i < array_len; i += 3) { |
| 1364 Object* element = | 1361 HandleScope scope(isolate); |
| 1365 position_change_array->GetElementNoExceptionThrown(isolate, i); | 1362 Handle<Object> element = Object::GetElementNoExceptionThrown( |
| 1363 isolate, position_change_array, i); |
| 1366 CHECK(element->IsSmi()); | 1364 CHECK(element->IsSmi()); |
| 1367 int chunk_start = Smi::cast(element)->value(); | 1365 int chunk_start = Handle<Smi>::cast(element)->value(); |
| 1368 if (original_position < chunk_start) { | 1366 if (original_position < chunk_start) { |
| 1369 break; | 1367 break; |
| 1370 } | 1368 } |
| 1371 element = position_change_array->GetElementNoExceptionThrown(isolate, | 1369 element = Object::GetElementNoExceptionThrown( |
| 1372 i + 1); | 1370 isolate, position_change_array, i + 1); |
| 1373 CHECK(element->IsSmi()); | 1371 CHECK(element->IsSmi()); |
| 1374 int chunk_end = Smi::cast(element)->value(); | 1372 int chunk_end = Handle<Smi>::cast(element)->value(); |
| 1375 // Position mustn't be inside a chunk. | 1373 // Position mustn't be inside a chunk. |
| 1376 ASSERT(original_position >= chunk_end); | 1374 ASSERT(original_position >= chunk_end); |
| 1377 element = position_change_array->GetElementNoExceptionThrown(isolate, | 1375 element = Object::GetElementNoExceptionThrown( |
| 1378 i + 2); | 1376 isolate, position_change_array, i + 2); |
| 1379 CHECK(element->IsSmi()); | 1377 CHECK(element->IsSmi()); |
| 1380 int chunk_changed_end = Smi::cast(element)->value(); | 1378 int chunk_changed_end = Handle<Smi>::cast(element)->value(); |
| 1381 position_diff = chunk_changed_end - chunk_end; | 1379 position_diff = chunk_changed_end - chunk_end; |
| 1382 } | 1380 } |
| 1383 | 1381 |
| 1384 return original_position + position_diff; | 1382 return original_position + position_diff; |
| 1385 } | 1383 } |
| 1386 | 1384 |
| 1387 | 1385 |
| 1388 // Auto-growing buffer for writing relocation info code section. This buffer | 1386 // Auto-growing buffer for writing relocation info code section. This buffer |
| 1389 // is a simplified version of buffer from Assembler. Unlike Assembler, this | 1387 // is a simplified version of buffer from Assembler. Unlike Assembler, this |
| 1390 // class is platform-independent and it works without dealing with instructions. | 1388 // class is platform-independent and it works without dealing with instructions. |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1465 // returns new instance of code. | 1463 // returns new instance of code. |
| 1466 static Handle<Code> PatchPositionsInCode( | 1464 static Handle<Code> PatchPositionsInCode( |
| 1467 Handle<Code> code, | 1465 Handle<Code> code, |
| 1468 Handle<JSArray> position_change_array) { | 1466 Handle<JSArray> position_change_array) { |
| 1469 Isolate* isolate = code->GetIsolate(); | 1467 Isolate* isolate = code->GetIsolate(); |
| 1470 | 1468 |
| 1471 RelocInfoBuffer buffer_writer(code->relocation_size(), | 1469 RelocInfoBuffer buffer_writer(code->relocation_size(), |
| 1472 code->instruction_start()); | 1470 code->instruction_start()); |
| 1473 | 1471 |
| 1474 { | 1472 { |
| 1475 DisallowHeapAllocation no_allocation; | |
| 1476 for (RelocIterator it(*code); !it.done(); it.next()) { | 1473 for (RelocIterator it(*code); !it.done(); it.next()) { |
| 1477 RelocInfo* rinfo = it.rinfo(); | 1474 RelocInfo* rinfo = it.rinfo(); |
| 1478 if (RelocInfo::IsPosition(rinfo->rmode())) { | 1475 if (RelocInfo::IsPosition(rinfo->rmode())) { |
| 1479 int position = static_cast<int>(rinfo->data()); | 1476 int position = static_cast<int>(rinfo->data()); |
| 1480 int new_position = TranslatePosition(position, | 1477 int new_position = TranslatePosition(position, |
| 1481 position_change_array); | 1478 position_change_array); |
| 1482 if (position != new_position) { | 1479 if (position != new_position) { |
| 1483 RelocInfo info_copy(rinfo->pc(), rinfo->rmode(), new_position, NULL); | 1480 RelocInfo info_copy(rinfo->pc(), rinfo->rmode(), new_position, NULL); |
| 1484 buffer_writer.Write(&info_copy); | 1481 buffer_writer.Write(&info_copy); |
| 1485 continue; | 1482 continue; |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1624 Handle<JSArray> result, | 1621 Handle<JSArray> result, |
| 1625 StackFrame* frame, | 1622 StackFrame* frame, |
| 1626 LiveEdit::FunctionPatchabilityStatus status) { | 1623 LiveEdit::FunctionPatchabilityStatus status) { |
| 1627 if (!frame->is_java_script()) return false; | 1624 if (!frame->is_java_script()) return false; |
| 1628 | 1625 |
| 1629 Handle<JSFunction> function(JavaScriptFrame::cast(frame)->function()); | 1626 Handle<JSFunction> function(JavaScriptFrame::cast(frame)->function()); |
| 1630 | 1627 |
| 1631 Isolate* isolate = shared_info_array->GetIsolate(); | 1628 Isolate* isolate = shared_info_array->GetIsolate(); |
| 1632 int len = GetArrayLength(shared_info_array); | 1629 int len = GetArrayLength(shared_info_array); |
| 1633 for (int i = 0; i < len; i++) { | 1630 for (int i = 0; i < len; i++) { |
| 1634 Object* element = | 1631 HandleScope scope(isolate); |
| 1635 shared_info_array->GetElementNoExceptionThrown(isolate, i); | 1632 Handle<Object> element = |
| 1636 CHECK(element->IsJSValue()); | 1633 Object::GetElementNoExceptionThrown(isolate, shared_info_array, i); |
| 1637 Handle<JSValue> jsvalue(JSValue::cast(element)); | 1634 Handle<JSValue> jsvalue = Handle<JSValue>::cast(element); |
| 1638 Handle<SharedFunctionInfo> shared = | 1635 Handle<SharedFunctionInfo> shared = |
| 1639 UnwrapSharedFunctionInfoFromJSValue(jsvalue); | 1636 UnwrapSharedFunctionInfoFromJSValue(jsvalue); |
| 1640 | 1637 |
| 1641 if (function->shared() == *shared || IsInlined(*function, *shared)) { | 1638 if (function->shared() == *shared || IsInlined(*function, *shared)) { |
| 1642 SetElementSloppy(result, i, Handle<Smi>(Smi::FromInt(status), isolate)); | 1639 SetElementSloppy(result, i, Handle<Smi>(Smi::FromInt(status), isolate)); |
| 1643 return true; | 1640 return true; |
| 1644 } | 1641 } |
| 1645 } | 1642 } |
| 1646 return false; | 1643 return false; |
| 1647 } | 1644 } |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1942 shared_info_array->GetIsolate(), target, do_drop); | 1939 shared_info_array->GetIsolate(), target, do_drop); |
| 1943 if (message) { | 1940 if (message) { |
| 1944 return message; | 1941 return message; |
| 1945 } | 1942 } |
| 1946 | 1943 |
| 1947 Isolate* isolate = shared_info_array->GetIsolate(); | 1944 Isolate* isolate = shared_info_array->GetIsolate(); |
| 1948 int array_len = GetArrayLength(shared_info_array); | 1945 int array_len = GetArrayLength(shared_info_array); |
| 1949 | 1946 |
| 1950 // Replace "blocked on active" with "replaced on active" status. | 1947 // Replace "blocked on active" with "replaced on active" status. |
| 1951 for (int i = 0; i < array_len; i++) { | 1948 for (int i = 0; i < array_len; i++) { |
| 1952 Handle<Object> obj = Object::GetElement(isolate, result, i); | 1949 Handle<Object> obj = |
| 1953 CHECK_NOT_EMPTY_HANDLE(isolate, obj); | 1950 Object::GetElementNoExceptionThrown(isolate, result, i); |
| 1954 if (*obj == Smi::FromInt(LiveEdit::FUNCTION_BLOCKED_ON_ACTIVE_STACK)) { | 1951 if (*obj == Smi::FromInt(LiveEdit::FUNCTION_BLOCKED_ON_ACTIVE_STACK)) { |
| 1955 Handle<Object> replaced( | 1952 Handle<Object> replaced( |
| 1956 Smi::FromInt(LiveEdit::FUNCTION_REPLACED_ON_ACTIVE_STACK), isolate); | 1953 Smi::FromInt(LiveEdit::FUNCTION_REPLACED_ON_ACTIVE_STACK), isolate); |
| 1957 SetElementSloppy(result, i, replaced); | 1954 SetElementSloppy(result, i, replaced); |
| 1958 } | 1955 } |
| 1959 } | 1956 } |
| 1960 return NULL; | 1957 return NULL; |
| 1961 } | 1958 } |
| 1962 | 1959 |
| 1963 | 1960 |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2130 | 2127 |
| 2131 bool LiveEditFunctionTracker::IsActive(Isolate* isolate) { | 2128 bool LiveEditFunctionTracker::IsActive(Isolate* isolate) { |
| 2132 return false; | 2129 return false; |
| 2133 } | 2130 } |
| 2134 | 2131 |
| 2135 #endif // ENABLE_DEBUGGER_SUPPORT | 2132 #endif // ENABLE_DEBUGGER_SUPPORT |
| 2136 | 2133 |
| 2137 | 2134 |
| 2138 | 2135 |
| 2139 } } // namespace v8::internal | 2136 } } // namespace v8::internal |
| OLD | NEW |