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

Side by Side Diff: src/profiler/heap-snapshot-generator.cc

Issue 1369293003: Wrap JSFunction bindings in a helper object (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: comments. 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/objects-inl.h ('k') | src/runtime/runtime-debug.cc » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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/profiler/heap-snapshot-generator.h" 5 #include "src/profiler/heap-snapshot-generator.h"
6 6
7 #include "src/code-stubs.h" 7 #include "src/code-stubs.h"
8 #include "src/conversions.h" 8 #include "src/conversions.h"
9 #include "src/debug/debug.h" 9 #include "src/debug/debug.h"
10 #include "src/profiler/allocation-tracker.h" 10 #include "src/profiler/allocation-tracker.h"
(...skipping 1575 matching lines...) Expand 10 before | Expand all | Expand 10 after
1586 } 1586 }
1587 } 1587 }
1588 } 1588 }
1589 1589
1590 1590
1591 void V8HeapExplorer::ExtractClosureReferences(JSObject* js_obj, int entry) { 1591 void V8HeapExplorer::ExtractClosureReferences(JSObject* js_obj, int entry) {
1592 if (!js_obj->IsJSFunction()) return; 1592 if (!js_obj->IsJSFunction()) return;
1593 1593
1594 JSFunction* func = JSFunction::cast(js_obj); 1594 JSFunction* func = JSFunction::cast(js_obj);
1595 if (func->shared()->bound()) { 1595 if (func->shared()->bound()) {
1596 FixedArray* bindings = func->function_bindings(); 1596 BindingsArray* bindings = func->function_bindings();
1597 SetNativeBindReference(js_obj, entry, "bound_this", 1597 SetNativeBindReference(js_obj, entry, "bound_this", bindings->bound_this());
1598 bindings->get(JSFunction::kBoundThisIndex));
1599 SetNativeBindReference(js_obj, entry, "bound_function", 1598 SetNativeBindReference(js_obj, entry, "bound_function",
1600 bindings->get(JSFunction::kBoundFunctionIndex)); 1599 bindings->bound_function());
1601 for (int i = JSFunction::kBoundArgumentsStartIndex; 1600 for (int i = 0; i < bindings->bindings_count(); i++) {
1602 i < bindings->length(); i++) { 1601 const char* reference_name = names_->GetFormatted("bound_argument_%d", i);
1603 const char* reference_name = names_->GetFormatted(
1604 "bound_argument_%d",
1605 i - JSFunction::kBoundArgumentsStartIndex);
1606 SetNativeBindReference(js_obj, entry, reference_name, 1602 SetNativeBindReference(js_obj, entry, reference_name,
1607 bindings->get(i)); 1603 bindings->binding(i));
1608 } 1604 }
1609 } 1605 }
1610 } 1606 }
1611 1607
1612 1608
1613 void V8HeapExplorer::ExtractPropertyReferences(JSObject* js_obj, int entry) { 1609 void V8HeapExplorer::ExtractPropertyReferences(JSObject* js_obj, int entry) {
1614 if (js_obj->HasFastProperties()) { 1610 if (js_obj->HasFastProperties()) {
1615 DescriptorArray* descs = js_obj->map()->instance_descriptors(); 1611 DescriptorArray* descs = js_obj->map()->instance_descriptors();
1616 int real_size = js_obj->map()->NumberOfOwnDescriptors(); 1612 int real_size = js_obj->map()->NumberOfOwnDescriptors();
1617 for (int i = 0; i < real_size; i++) { 1613 for (int i = 0; i < real_size; i++) {
(...skipping 1554 matching lines...) Expand 10 before | Expand all | Expand 10 after
3172 for (int i = 1; i < sorted_strings.length(); ++i) { 3168 for (int i = 1; i < sorted_strings.length(); ++i) {
3173 writer_->AddCharacter(','); 3169 writer_->AddCharacter(',');
3174 SerializeString(sorted_strings[i]); 3170 SerializeString(sorted_strings[i]);
3175 if (writer_->aborted()) return; 3171 if (writer_->aborted()) return;
3176 } 3172 }
3177 } 3173 }
3178 3174
3179 3175
3180 } // namespace internal 3176 } // namespace internal
3181 } // namespace v8 3177 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | src/runtime/runtime-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698