| OLD | NEW |
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 9712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9723 } | 9723 } |
| 9724 } | 9724 } |
| 9725 | 9725 |
| 9726 // Replaces code of SharedFunctionInfo with a new one. | 9726 // Replaces code of SharedFunctionInfo with a new one. |
| 9727 static Object* Runtime_LiveEditReplaceFunctionCode(Arguments args) { | 9727 static Object* Runtime_LiveEditReplaceFunctionCode(Arguments args) { |
| 9728 ASSERT(args.length() == 2); | 9728 ASSERT(args.length() == 2); |
| 9729 HandleScope scope; | 9729 HandleScope scope; |
| 9730 CONVERT_ARG_CHECKED(JSArray, new_compile_info, 0); | 9730 CONVERT_ARG_CHECKED(JSArray, new_compile_info, 0); |
| 9731 CONVERT_ARG_CHECKED(JSArray, shared_info, 1); | 9731 CONVERT_ARG_CHECKED(JSArray, shared_info, 1); |
| 9732 | 9732 |
| 9733 LiveEdit::ReplaceFunctionCode(new_compile_info, shared_info); | 9733 return LiveEdit::ReplaceFunctionCode(new_compile_info, shared_info); |
| 9734 | |
| 9735 return Heap::undefined_value(); | |
| 9736 } | 9734 } |
| 9737 | 9735 |
| 9738 // Connects SharedFunctionInfo to another script. | 9736 // Connects SharedFunctionInfo to another script. |
| 9739 static Object* Runtime_LiveEditFunctionSetScript(Arguments args) { | 9737 static Object* Runtime_LiveEditFunctionSetScript(Arguments args) { |
| 9740 ASSERT(args.length() == 2); | 9738 ASSERT(args.length() == 2); |
| 9741 HandleScope scope; | 9739 HandleScope scope; |
| 9742 Handle<Object> function_object(args[0]); | 9740 Handle<Object> function_object(args[0]); |
| 9743 Handle<Object> script_object(args[1]); | 9741 Handle<Object> script_object(args[1]); |
| 9744 | 9742 |
| 9745 if (function_object->IsJSValue()) { | 9743 if (function_object->IsJSValue()) { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9780 // to script source change. Text change is described in second parameter as | 9778 // to script source change. Text change is described in second parameter as |
| 9781 // array of groups of 3 numbers: | 9779 // array of groups of 3 numbers: |
| 9782 // (change_begin, change_end, change_end_new_position). | 9780 // (change_begin, change_end, change_end_new_position). |
| 9783 // Each group describes a change in text; groups are sorted by change_begin. | 9781 // Each group describes a change in text; groups are sorted by change_begin. |
| 9784 static Object* Runtime_LiveEditPatchFunctionPositions(Arguments args) { | 9782 static Object* Runtime_LiveEditPatchFunctionPositions(Arguments args) { |
| 9785 ASSERT(args.length() == 2); | 9783 ASSERT(args.length() == 2); |
| 9786 HandleScope scope; | 9784 HandleScope scope; |
| 9787 CONVERT_ARG_CHECKED(JSArray, shared_array, 0); | 9785 CONVERT_ARG_CHECKED(JSArray, shared_array, 0); |
| 9788 CONVERT_ARG_CHECKED(JSArray, position_change_array, 1); | 9786 CONVERT_ARG_CHECKED(JSArray, position_change_array, 1); |
| 9789 | 9787 |
| 9790 LiveEdit::PatchFunctionPositions(shared_array, position_change_array); | 9788 return LiveEdit::PatchFunctionPositions(shared_array, position_change_array); |
| 9791 | |
| 9792 return Heap::undefined_value(); | |
| 9793 } | 9789 } |
| 9794 | 9790 |
| 9795 | 9791 |
| 9796 // For array of SharedFunctionInfo's (each wrapped in JSValue) | 9792 // For array of SharedFunctionInfo's (each wrapped in JSValue) |
| 9797 // checks that none of them have activations on stacks (of any thread). | 9793 // checks that none of them have activations on stacks (of any thread). |
| 9798 // Returns array of the same length with corresponding results of | 9794 // Returns array of the same length with corresponding results of |
| 9799 // LiveEdit::FunctionPatchabilityStatus type. | 9795 // LiveEdit::FunctionPatchabilityStatus type. |
| 9800 static Object* Runtime_LiveEditCheckAndDropActivations(Arguments args) { | 9796 static Object* Runtime_LiveEditCheckAndDropActivations(Arguments args) { |
| 9801 ASSERT(args.length() == 2); | 9797 ASSERT(args.length() == 2); |
| 9802 HandleScope scope; | 9798 HandleScope scope; |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10242 } else { | 10238 } else { |
| 10243 // Handle last resort GC and make sure to allow future allocations | 10239 // Handle last resort GC and make sure to allow future allocations |
| 10244 // to grow the heap without causing GCs (if possible). | 10240 // to grow the heap without causing GCs (if possible). |
| 10245 Counters::gc_last_resort_from_js.Increment(); | 10241 Counters::gc_last_resort_from_js.Increment(); |
| 10246 Heap::CollectAllGarbage(false); | 10242 Heap::CollectAllGarbage(false); |
| 10247 } | 10243 } |
| 10248 } | 10244 } |
| 10249 | 10245 |
| 10250 | 10246 |
| 10251 } } // namespace v8::internal | 10247 } } // namespace v8::internal |
| OLD | NEW |