| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 857 } | 857 } |
| 858 | 858 |
| 859 // Post-visiting method that iterates over all collected references and | 859 // Post-visiting method that iterates over all collected references and |
| 860 // modifies them. | 860 // modifies them. |
| 861 void Replace(Code* substitution) { | 861 void Replace(Code* substitution) { |
| 862 for (int i = 0; i < rvalues_.length(); i++) { | 862 for (int i = 0; i < rvalues_.length(); i++) { |
| 863 *(rvalues_[i]) = substitution; | 863 *(rvalues_[i]) = substitution; |
| 864 } | 864 } |
| 865 Address substitution_entry = substitution->instruction_start(); | 865 Address substitution_entry = substitution->instruction_start(); |
| 866 for (int i = 0; i < reloc_infos_.length(); i++) { | 866 for (int i = 0; i < reloc_infos_.length(); i++) { |
| 867 reloc_infos_[i].set_target_address(substitution_entry); | 867 reloc_infos_[i].set_target_address(substitution_entry, NULL); |
| 868 // TODO(gc) more precise barrier. |
| 869 IncrementalMarking::RecordWriteOf(substitution); |
| 868 } | 870 } |
| 869 for (int i = 0; i < code_entries_.length(); i++) { | 871 for (int i = 0; i < code_entries_.length(); i++) { |
| 870 Address entry = code_entries_[i]; | 872 Address entry = code_entries_[i]; |
| 871 Memory::Address_at(entry) = substitution_entry; | 873 Memory::Address_at(entry) = substitution_entry; |
| 872 } | 874 } |
| 873 } | 875 } |
| 874 | 876 |
| 875 private: | 877 private: |
| 876 Code* original_; | 878 Code* original_; |
| 877 ZoneList<Object**> rvalues_; | 879 ZoneList<Object**> rvalues_; |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1282 Handle<SharedFunctionInfo> parent_shared = | 1284 Handle<SharedFunctionInfo> parent_shared = |
| 1283 Handle<SharedFunctionInfo>::cast(UnwrapJSValue(parent_function_wrapper)); | 1285 Handle<SharedFunctionInfo>::cast(UnwrapJSValue(parent_function_wrapper)); |
| 1284 Handle<SharedFunctionInfo> orig_shared = | 1286 Handle<SharedFunctionInfo> orig_shared = |
| 1285 Handle<SharedFunctionInfo>::cast(UnwrapJSValue(orig_function_wrapper)); | 1287 Handle<SharedFunctionInfo>::cast(UnwrapJSValue(orig_function_wrapper)); |
| 1286 Handle<SharedFunctionInfo> subst_shared = | 1288 Handle<SharedFunctionInfo> subst_shared = |
| 1287 Handle<SharedFunctionInfo>::cast(UnwrapJSValue(subst_function_wrapper)); | 1289 Handle<SharedFunctionInfo>::cast(UnwrapJSValue(subst_function_wrapper)); |
| 1288 | 1290 |
| 1289 for (RelocIterator it(parent_shared->code()); !it.done(); it.next()) { | 1291 for (RelocIterator it(parent_shared->code()); !it.done(); it.next()) { |
| 1290 if (it.rinfo()->rmode() == RelocInfo::EMBEDDED_OBJECT) { | 1292 if (it.rinfo()->rmode() == RelocInfo::EMBEDDED_OBJECT) { |
| 1291 if (it.rinfo()->target_object() == *orig_shared) { | 1293 if (it.rinfo()->target_object() == *orig_shared) { |
| 1292 it.rinfo()->set_target_object(*subst_shared); | 1294 it.rinfo()->set_target_object(*subst_shared, NULL); |
| 1293 } | 1295 } |
| 1294 } | 1296 } |
| 1295 } | 1297 } |
| 1296 } | 1298 } |
| 1297 | 1299 |
| 1298 | 1300 |
| 1299 // Check an activation against list of functions. If there is a function | 1301 // Check an activation against list of functions. If there is a function |
| 1300 // that matches, its status in result array is changed to status argument value. | 1302 // that matches, its status in result array is changed to status argument value. |
| 1301 static bool CheckActivation(Handle<JSArray> shared_info_array, | 1303 static bool CheckActivation(Handle<JSArray> shared_info_array, |
| 1302 Handle<JSArray> result, | 1304 Handle<JSArray> result, |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1641 | 1643 |
| 1642 bool LiveEditFunctionTracker::IsActive() { | 1644 bool LiveEditFunctionTracker::IsActive() { |
| 1643 return false; | 1645 return false; |
| 1644 } | 1646 } |
| 1645 | 1647 |
| 1646 #endif // ENABLE_DEBUGGER_SUPPORT | 1648 #endif // ENABLE_DEBUGGER_SUPPORT |
| 1647 | 1649 |
| 1648 | 1650 |
| 1649 | 1651 |
| 1650 } } // namespace v8::internal | 1652 } } // namespace v8::internal |
| OLD | NEW |