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 7130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7141 Handle<Context> frame_context(Context::cast(frame->context())); | 7141 Handle<Context> frame_context(Context::cast(frame->context())); |
7142 Handle<Context> function_context(frame_context->fcontext()); | 7142 Handle<Context> function_context(frame_context->fcontext()); |
7143 context = CopyWithContextChain(frame_context, context); | 7143 context = CopyWithContextChain(frame_context, context); |
7144 | 7144 |
7145 // Wrap the evaluation statement in a new function compiled in the newly | 7145 // Wrap the evaluation statement in a new function compiled in the newly |
7146 // created context. The function has one parameter which has to be called | 7146 // created context. The function has one parameter which has to be called |
7147 // 'arguments'. This it to have access to what would have been 'arguments' in | 7147 // 'arguments'. This it to have access to what would have been 'arguments' in |
7148 // the function being debugged. | 7148 // the function being debugged. |
7149 // function(arguments,__source__) {return eval(__source__);} | 7149 // function(arguments,__source__) {return eval(__source__);} |
7150 static const char* source_str = | 7150 static const char* source_str = |
7151 "function(arguments,__source__){return eval(__source__);}"; | 7151 "(function(arguments,__source__){return eval(__source__);})"; |
7152 static const int source_str_length = strlen(source_str); | 7152 static const int source_str_length = strlen(source_str); |
7153 Handle<String> function_source = | 7153 Handle<String> function_source = |
7154 Factory::NewStringFromAscii(Vector<const char>(source_str, | 7154 Factory::NewStringFromAscii(Vector<const char>(source_str, |
7155 source_str_length)); | 7155 source_str_length)); |
7156 Handle<JSFunction> boilerplate = | 7156 Handle<JSFunction> boilerplate = |
7157 Compiler::CompileEval(function_source, | 7157 Compiler::CompileEval(function_source, |
7158 context, | 7158 context, |
7159 context->IsGlobalContext(), | 7159 context->IsGlobalContext(), |
7160 Compiler::DONT_VALIDATE_JSON); | 7160 Compiler::DONT_VALIDATE_JSON); |
7161 if (boilerplate.is_null()) return Failure::Exception(); | 7161 if (boilerplate.is_null()) return Failure::Exception(); |
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7730 } else { | 7730 } else { |
7731 // Handle last resort GC and make sure to allow future allocations | 7731 // Handle last resort GC and make sure to allow future allocations |
7732 // to grow the heap without causing GCs (if possible). | 7732 // to grow the heap without causing GCs (if possible). |
7733 Counters::gc_last_resort_from_js.Increment(); | 7733 Counters::gc_last_resort_from_js.Increment(); |
7734 Heap::CollectAllGarbage(false); | 7734 Heap::CollectAllGarbage(false); |
7735 } | 7735 } |
7736 } | 7736 } |
7737 | 7737 |
7738 | 7738 |
7739 } } // namespace v8::internal | 7739 } } // namespace v8::internal |
OLD | NEW |