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 9045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9056 ASSERT(args.length() == 3); | 9056 ASSERT(args.length() == 3); |
9057 CONVERT_ARG_CHECKED(JSFunction, fun, 0); | 9057 CONVERT_ARG_CHECKED(JSFunction, fun, 0); |
9058 Handle<SharedFunctionInfo> shared(fun->shared()); | 9058 Handle<SharedFunctionInfo> shared(fun->shared()); |
9059 CONVERT_NUMBER_CHECKED(int32_t, source_position, Int32, args[1]); | 9059 CONVERT_NUMBER_CHECKED(int32_t, source_position, Int32, args[1]); |
9060 RUNTIME_ASSERT(source_position >= 0); | 9060 RUNTIME_ASSERT(source_position >= 0); |
9061 Handle<Object> break_point_object_arg = args.at<Object>(2); | 9061 Handle<Object> break_point_object_arg = args.at<Object>(2); |
9062 | 9062 |
9063 // Set break point. | 9063 // Set break point. |
9064 Debug::SetBreakPoint(shared, break_point_object_arg, &source_position); | 9064 Debug::SetBreakPoint(shared, break_point_object_arg, &source_position); |
9065 | 9065 |
9066 return Heap::undefined_value(); | 9066 return Smi::FromInt(source_position); |
9067 } | 9067 } |
9068 | 9068 |
9069 | 9069 |
9070 Object* Runtime::FindSharedFunctionInfoInScript(Handle<Script> script, | 9070 Object* Runtime::FindSharedFunctionInfoInScript(Handle<Script> script, |
9071 int position) { | 9071 int position) { |
9072 // Iterate the heap looking for SharedFunctionInfo generated from the | 9072 // Iterate the heap looking for SharedFunctionInfo generated from the |
9073 // script. The inner most SharedFunctionInfo containing the source position | 9073 // script. The inner most SharedFunctionInfo containing the source position |
9074 // for the requested break point is found. | 9074 // for the requested break point is found. |
9075 // NOTE: This might reqire several heap iterations. If the SharedFunctionInfo | 9075 // NOTE: This might reqire several heap iterations. If the SharedFunctionInfo |
9076 // which is found is not compiled it is compiled and the heap is iterated | 9076 // which is found is not compiled it is compiled and the heap is iterated |
(...skipping 1302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10379 } else { | 10379 } else { |
10380 // Handle last resort GC and make sure to allow future allocations | 10380 // Handle last resort GC and make sure to allow future allocations |
10381 // to grow the heap without causing GCs (if possible). | 10381 // to grow the heap without causing GCs (if possible). |
10382 Counters::gc_last_resort_from_js.Increment(); | 10382 Counters::gc_last_resort_from_js.Increment(); |
10383 Heap::CollectAllGarbage(false); | 10383 Heap::CollectAllGarbage(false); |
10384 } | 10384 } |
10385 } | 10385 } |
10386 | 10386 |
10387 | 10387 |
10388 } } // namespace v8::internal | 10388 } } // namespace v8::internal |
OLD | NEW |