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

Side by Side Diff: src/runtime.cc

Issue 10585002: Correctly resolve local var shadowing a context-allocated var in debugger. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 6 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/mjsunit/regress/regress-131994.js » ('j') | no next file with comments »
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 12087 matching lines...) Expand 10 before | Expand all | Expand 10 after
12098 // Materialize the content of the local scope into a JSObject. 12098 // Materialize the content of the local scope into a JSObject.
12099 Handle<JSObject> local_scope = MaterializeLocalScopeWithFrameInspector( 12099 Handle<JSObject> local_scope = MaterializeLocalScopeWithFrameInspector(
12100 isolate, frame, &frame_inspector); 12100 isolate, frame, &frame_inspector);
12101 RETURN_IF_EMPTY_HANDLE(isolate, local_scope); 12101 RETURN_IF_EMPTY_HANDLE(isolate, local_scope);
12102 12102
12103 // Allocate a new context for the debug evaluation and set the extension 12103 // Allocate a new context for the debug evaluation and set the extension
12104 // object build. 12104 // object build.
12105 Handle<Context> context = 12105 Handle<Context> context =
12106 isolate->factory()->NewFunctionContext(Context::MIN_CONTEXT_SLOTS, 12106 isolate->factory()->NewFunctionContext(Context::MIN_CONTEXT_SLOTS,
12107 go_between); 12107 go_between);
12108 context->set_extension(*local_scope); 12108
12109 // Use the materialized local scope in a with context.
12110 context =
12111 isolate->factory()->NewWithContext(go_between, context, local_scope);
12112
12109 // Copy any with contexts present and chain them in front of this context. 12113 // Copy any with contexts present and chain them in front of this context.
12110 Handle<Context> frame_context(Context::cast(frame->context())); 12114 Handle<Context> frame_context(Context::cast(frame->context()));
12111 Handle<Context> function_context; 12115 Handle<Context> function_context;
12112 // Get the function's context if it has one. 12116 // Get the function's context if it has one.
12113 if (scope_info->HasContext()) { 12117 if (scope_info->HasContext()) {
12114 function_context = Handle<Context>(frame_context->declaration_context()); 12118 function_context = Handle<Context>(frame_context->declaration_context());
12115 } 12119 }
12116 context = CopyNestedScopeContextChain(isolate, 12120 context = CopyNestedScopeContextChain(isolate,
12117 go_between, 12121 go_between,
12118 context, 12122 context,
(...skipping 1514 matching lines...) Expand 10 before | Expand all | Expand 10 after
13633 // Handle last resort GC and make sure to allow future allocations 13637 // Handle last resort GC and make sure to allow future allocations
13634 // to grow the heap without causing GCs (if possible). 13638 // to grow the heap without causing GCs (if possible).
13635 isolate->counters()->gc_last_resort_from_js()->Increment(); 13639 isolate->counters()->gc_last_resort_from_js()->Increment();
13636 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, 13640 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags,
13637 "Runtime::PerformGC"); 13641 "Runtime::PerformGC");
13638 } 13642 }
13639 } 13643 }
13640 13644
13641 13645
13642 } } // namespace v8::internal 13646 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-131994.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698