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

Side by Side Diff: src/debug/debug-scopes.cc

Issue 1375813002: [V8] Add name of function for function's closure scope (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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
« no previous file with comments | « src/debug/debug-scopes.h ('k') | src/debug/mirrors.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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/debug/debug-scopes.h" 5 #include "src/debug/debug-scopes.h"
6 6
7 #include "src/debug/debug.h" 7 #include "src/debug/debug.h"
8 #include "src/frames-inl.h" 8 #include "src/frames-inl.h"
9 #include "src/globals.h" 9 #include "src/globals.h"
10 #include "src/isolate-inl.h" 10 #include "src/isolate-inl.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 125
126 MUST_USE_RESULT MaybeHandle<JSObject> ScopeIterator::MaterializeScopeDetails() { 126 MUST_USE_RESULT MaybeHandle<JSObject> ScopeIterator::MaterializeScopeDetails() {
127 // Calculate the size of the result. 127 // Calculate the size of the result.
128 Handle<FixedArray> details = 128 Handle<FixedArray> details =
129 isolate_->factory()->NewFixedArray(kScopeDetailsSize); 129 isolate_->factory()->NewFixedArray(kScopeDetailsSize);
130 // Fill in scope details. 130 // Fill in scope details.
131 details->set(kScopeDetailsTypeIndex, Smi::FromInt(Type())); 131 details->set(kScopeDetailsTypeIndex, Smi::FromInt(Type()));
132 Handle<JSObject> scope_object; 132 Handle<JSObject> scope_object;
133 ASSIGN_RETURN_ON_EXCEPTION(isolate_, scope_object, ScopeObject(), JSObject); 133 ASSIGN_RETURN_ON_EXCEPTION(isolate_, scope_object, ScopeObject(), JSObject);
134 details->set(kScopeDetailsObjectIndex, *scope_object); 134 details->set(kScopeDetailsObjectIndex, *scope_object);
135 if (HasContext() && CurrentContext()->closure() != NULL) {
136 Handle<String> closure_name = JSFunction::GetDebugName(
137 Handle<JSFunction>(CurrentContext()->closure()));
138 if (!closure_name.is_null() && (closure_name->length() != 0))
139 details->set(kScopeDetailsNameIndex, *closure_name);
140 }
135 return isolate_->factory()->NewJSArrayWithElements(details); 141 return isolate_->factory()->NewJSArrayWithElements(details);
136 } 142 }
137 143
138 144
139 void ScopeIterator::Next() { 145 void ScopeIterator::Next() {
140 DCHECK(!failed_); 146 DCHECK(!failed_);
141 ScopeType scope_type = Type(); 147 ScopeType scope_type = Type();
142 if (scope_type == ScopeTypeGlobal) { 148 if (scope_type == ScopeTypeGlobal) {
143 // The global scope is always the last in the chain. 149 // The global scope is always the last in the chain.
144 DCHECK(context_->IsNativeContext()); 150 DCHECK(context_->IsNativeContext());
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 isolate_, value, Object::GetPropertyOrElement(extension, key), false); 785 isolate_, value, Object::GetPropertyOrElement(extension, key), false);
780 RETURN_ON_EXCEPTION_VALUE( 786 RETURN_ON_EXCEPTION_VALUE(
781 isolate_, JSObject::SetOwnPropertyIgnoreAttributes( 787 isolate_, JSObject::SetOwnPropertyIgnoreAttributes(
782 scope_object, key, value, NONE), false); 788 scope_object, key, value, NONE), false);
783 } 789 }
784 return true; 790 return true;
785 } 791 }
786 792
787 } // namespace internal 793 } // namespace internal
788 } // namespace v8 794 } // namespace v8
OLDNEW
« no previous file with comments | « src/debug/debug-scopes.h ('k') | src/debug/mirrors.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698