Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(307)

Side by Side Diff: src/runtime.cc

Issue 11111015: Allow evals for debugger even if they are prohibited in the debugee context (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | test/cctest/test-debug.cc » ('j') | test/cctest/test-debug.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 11775 matching lines...) Expand 10 before | Expand all | Expand 10 after
11786 Execution::Call(compiled_function, receiver, 0, NULL, 11786 Execution::Call(compiled_function, receiver, 0, NULL,
11787 &has_pending_exception); 11787 &has_pending_exception);
11788 if (has_pending_exception) return Failure::Exception(); 11788 if (has_pending_exception) return Failure::Exception();
11789 11789
11790 Handle<Object> arguments = GetArgumentsObject(isolate, 11790 Handle<Object> arguments = GetArgumentsObject(isolate,
11791 frame, 11791 frame,
11792 &frame_inspector, 11792 &frame_inspector,
11793 scope_info, 11793 scope_info,
11794 function_context); 11794 function_context);
11795 11795
11796
Michael Starzinger 2012/10/15 09:51:25 Remove second empty newline for readability.
yurys 2012/10/15 10:14:53 Done.
11797 // Check if eval is blocked in the context and temporarily allow it
11798 // for debugger.
11799 Handle<Context> native_context = Handle<Context>(context->native_context());
11800 bool eval_disabled =
11801 native_context->allow_code_gen_from_strings()->IsFalse();
11802 if (eval_disabled) {
11803 native_context->set_allow_code_gen_from_strings(
11804 isolate->heap()->true_value());
11805 }
11796 // Invoke the evaluation function and return the result. 11806 // Invoke the evaluation function and return the result.
11797 Handle<Object> argv[] = { arguments, source }; 11807 Handle<Object> argv[] = { arguments, source };
11798 Handle<Object> result = 11808 Handle<Object> result =
11799 Execution::Call(Handle<JSFunction>::cast(evaluation_function), 11809 Execution::Call(Handle<JSFunction>::cast(evaluation_function),
11800 receiver, 11810 receiver,
11801 ARRAY_SIZE(argv), 11811 ARRAY_SIZE(argv),
11802 argv, 11812 argv,
11803 &has_pending_exception); 11813 &has_pending_exception);
11814 if (eval_disabled) {
11815 native_context->set_allow_code_gen_from_strings(
11816 isolate->heap()->false_value());
11817 }
11804 if (has_pending_exception) return Failure::Exception(); 11818 if (has_pending_exception) return Failure::Exception();
11805 11819
11806 // Skip the global proxy as it has no properties and always delegates to the 11820 // Skip the global proxy as it has no properties and always delegates to the
11807 // real global object. 11821 // real global object.
11808 if (result->IsJSGlobalProxy()) { 11822 if (result->IsJSGlobalProxy()) {
11809 result = Handle<JSObject>(JSObject::cast(result->GetPrototype())); 11823 result = Handle<JSObject>(JSObject::cast(result->GetPrototype()));
11810 } 11824 }
11811 11825
11812 return *result; 11826 return *result;
11813 } 11827 }
(...skipping 1465 matching lines...) Expand 10 before | Expand all | Expand 10 after
13279 // Handle last resort GC and make sure to allow future allocations 13293 // Handle last resort GC and make sure to allow future allocations
13280 // to grow the heap without causing GCs (if possible). 13294 // to grow the heap without causing GCs (if possible).
13281 isolate->counters()->gc_last_resort_from_js()->Increment(); 13295 isolate->counters()->gc_last_resort_from_js()->Increment();
13282 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, 13296 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags,
13283 "Runtime::PerformGC"); 13297 "Runtime::PerformGC");
13284 } 13298 }
13285 } 13299 }
13286 13300
13287 13301
13288 } } // namespace v8::internal 13302 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-debug.cc » ('j') | test/cctest/test-debug.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698