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

Side by Side Diff: src/objects.cc

Issue 1449473005: [V8] Unify get function name for debugging purpose (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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.h ('k') | src/runtime/runtime.h » ('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/objects.h" 5 #include "src/objects.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <iomanip> 8 #include <iomanip>
9 #include <sstream> 9 #include <sstream>
10 10
(...skipping 11905 matching lines...) Expand 10 before | Expand all | Expand 10 after
11916 return true; 11916 return true;
11917 } 11917 }
11918 if (filter[filter.length() - 1] == '*' && 11918 if (filter[filter.length() - 1] == '*' &&
11919 name->IsUtf8EqualTo(filter.SubVector(0, filter.length() - 1), true)) { 11919 name->IsUtf8EqualTo(filter.SubVector(0, filter.length() - 1), true)) {
11920 return true; 11920 return true;
11921 } 11921 }
11922 return false; 11922 return false;
11923 } 11923 }
11924 11924
11925 11925
11926 Handle<String> JSFunction::GetDebugName(Handle<JSFunction> function) { 11926 Handle<String> JSFunction::GetName(Handle<JSFunction> function) {
11927 Isolate* isolate = function->GetIsolate(); 11927 Isolate* isolate = function->GetIsolate();
11928 Handle<Object> name = 11928 Handle<Object> name =
11929 JSReceiver::GetDataProperty(function, isolate->factory()->name_string()); 11929 JSReceiver::GetDataProperty(function, isolate->factory()->name_string());
11930 if (name->IsString()) return Handle<String>::cast(name); 11930 if (name->IsString()) return Handle<String>::cast(name);
11931 return handle(function->shared()->DebugName(), isolate); 11931 return handle(function->shared()->DebugName(), isolate);
11932 } 11932 }
11933 11933
11934 11934
11935 Handle<String> JSFunction::GetDebugName(Handle<JSFunction> function) {
11936 Isolate* isolate = function->GetIsolate();
11937 Handle<Object> name = JSReceiver::GetDataProperty(
11938 function, isolate->factory()->display_name_string());
11939 if (name->IsString()) return Handle<String>::cast(name);
11940 return JSFunction::GetName(function);
11941 }
11942
11943
11935 void Oddball::Initialize(Isolate* isolate, Handle<Oddball> oddball, 11944 void Oddball::Initialize(Isolate* isolate, Handle<Oddball> oddball,
11936 const char* to_string, Handle<Object> to_number, 11945 const char* to_string, Handle<Object> to_number,
11937 const char* type_of, byte kind) { 11946 const char* type_of, byte kind) {
11938 Handle<String> internalized_to_string = 11947 Handle<String> internalized_to_string =
11939 isolate->factory()->InternalizeUtf8String(to_string); 11948 isolate->factory()->InternalizeUtf8String(to_string);
11940 Handle<String> internalized_type_of = 11949 Handle<String> internalized_type_of =
11941 isolate->factory()->InternalizeUtf8String(type_of); 11950 isolate->factory()->InternalizeUtf8String(type_of);
11942 oddball->set_to_number(*to_number); 11951 oddball->set_to_number(*to_number);
11943 oddball->set_to_string(*internalized_to_string); 11952 oddball->set_to_string(*internalized_to_string);
11944 oddball->set_type_of(*internalized_type_of); 11953 oddball->set_type_of(*internalized_type_of);
(...skipping 6046 matching lines...) Expand 10 before | Expand all | Expand 10 after
17991 if (cell->value() != *new_value) { 18000 if (cell->value() != *new_value) {
17992 cell->set_value(*new_value); 18001 cell->set_value(*new_value);
17993 Isolate* isolate = cell->GetIsolate(); 18002 Isolate* isolate = cell->GetIsolate();
17994 cell->dependent_code()->DeoptimizeDependentCodeGroup( 18003 cell->dependent_code()->DeoptimizeDependentCodeGroup(
17995 isolate, DependentCode::kPropertyCellChangedGroup); 18004 isolate, DependentCode::kPropertyCellChangedGroup);
17996 } 18005 }
17997 } 18006 }
17998 18007
17999 } // namespace internal 18008 } // namespace internal
18000 } // namespace v8 18009 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698