OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
974 } | 974 } |
975 | 975 |
976 // Post-visiting method that iterates over all collected references and | 976 // Post-visiting method that iterates over all collected references and |
977 // modifies them. | 977 // modifies them. |
978 void Replace(Code* substitution) { | 978 void Replace(Code* substitution) { |
979 for (int i = 0; i < rvalues_.length(); i++) { | 979 for (int i = 0; i < rvalues_.length(); i++) { |
980 *(rvalues_[i]) = substitution; | 980 *(rvalues_[i]) = substitution; |
981 } | 981 } |
982 Address substitution_entry = substitution->instruction_start(); | 982 Address substitution_entry = substitution->instruction_start(); |
983 for (int i = 0; i < reloc_infos_.length(); i++) { | 983 for (int i = 0; i < reloc_infos_.length(); i++) { |
984 reloc_infos_[i].set_target_address(substitution_entry, NULL); | 984 reloc_infos_[i].set_target_address(substitution_entry); |
985 substitution->GetHeap()->incremental_marking()->RecordWriteOf( | |
986 substitution); | |
987 } | 985 } |
988 for (int i = 0; i < code_entries_.length(); i++) { | 986 for (int i = 0; i < code_entries_.length(); i++) { |
989 Address entry = code_entries_[i]; | 987 Address entry = code_entries_[i]; |
990 Memory::Address_at(entry) = substitution_entry; | 988 Memory::Address_at(entry) = substitution_entry; |
991 } | 989 } |
992 } | 990 } |
993 | 991 |
994 private: | 992 private: |
995 Code* original_; | 993 Code* original_; |
996 ZoneList<Object**> rvalues_; | 994 ZoneList<Object**> rvalues_; |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1411 Handle<SharedFunctionInfo> parent_shared = | 1409 Handle<SharedFunctionInfo> parent_shared = |
1412 Handle<SharedFunctionInfo>::cast(UnwrapJSValue(parent_function_wrapper)); | 1410 Handle<SharedFunctionInfo>::cast(UnwrapJSValue(parent_function_wrapper)); |
1413 Handle<SharedFunctionInfo> orig_shared = | 1411 Handle<SharedFunctionInfo> orig_shared = |
1414 Handle<SharedFunctionInfo>::cast(UnwrapJSValue(orig_function_wrapper)); | 1412 Handle<SharedFunctionInfo>::cast(UnwrapJSValue(orig_function_wrapper)); |
1415 Handle<SharedFunctionInfo> subst_shared = | 1413 Handle<SharedFunctionInfo> subst_shared = |
1416 Handle<SharedFunctionInfo>::cast(UnwrapJSValue(subst_function_wrapper)); | 1414 Handle<SharedFunctionInfo>::cast(UnwrapJSValue(subst_function_wrapper)); |
1417 | 1415 |
1418 for (RelocIterator it(parent_shared->code()); !it.done(); it.next()) { | 1416 for (RelocIterator it(parent_shared->code()); !it.done(); it.next()) { |
1419 if (it.rinfo()->rmode() == RelocInfo::EMBEDDED_OBJECT) { | 1417 if (it.rinfo()->rmode() == RelocInfo::EMBEDDED_OBJECT) { |
1420 if (it.rinfo()->target_object() == *orig_shared) { | 1418 if (it.rinfo()->target_object() == *orig_shared) { |
1421 it.rinfo()->set_target_object(*subst_shared, NULL); | 1419 it.rinfo()->set_target_object(*subst_shared); |
1422 } | 1420 } |
1423 } | 1421 } |
1424 } | 1422 } |
1425 } | 1423 } |
1426 | 1424 |
1427 | 1425 |
1428 // Check an activation against list of functions. If there is a function | 1426 // Check an activation against list of functions. If there is a function |
1429 // that matches, its status in result array is changed to status argument value. | 1427 // that matches, its status in result array is changed to status argument value. |
1430 static bool CheckActivation(Handle<JSArray> shared_info_array, | 1428 static bool CheckActivation(Handle<JSArray> shared_info_array, |
1431 Handle<JSArray> result, | 1429 Handle<JSArray> result, |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1785 | 1783 |
1786 bool LiveEditFunctionTracker::IsActive(Isolate* isolate) { | 1784 bool LiveEditFunctionTracker::IsActive(Isolate* isolate) { |
1787 return false; | 1785 return false; |
1788 } | 1786 } |
1789 | 1787 |
1790 #endif // ENABLE_DEBUGGER_SUPPORT | 1788 #endif // ENABLE_DEBUGGER_SUPPORT |
1791 | 1789 |
1792 | 1790 |
1793 | 1791 |
1794 } } // namespace v8::internal | 1792 } } // namespace v8::internal |
OLD | NEW |