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

Side by Side Diff: src/messages.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/heap/heap.h ('k') | src/objects.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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/messages.h" 5 #include "src/messages.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/execution.h" 8 #include "src/execution.h"
9 #include "src/isolate-inl.h" 9 #include "src/isolate-inl.h"
10 #include "src/string-builder.h" 10 #include "src/string-builder.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 Handle<Object> CallSite::GetFileName() { 161 Handle<Object> CallSite::GetFileName() {
162 Handle<Object> script(fun_->shared()->script(), isolate_); 162 Handle<Object> script(fun_->shared()->script(), isolate_);
163 if (script->IsScript()) { 163 if (script->IsScript()) {
164 return Handle<Object>(Handle<Script>::cast(script)->name(), isolate_); 164 return Handle<Object>(Handle<Script>::cast(script)->name(), isolate_);
165 } 165 }
166 return isolate_->factory()->null_value(); 166 return isolate_->factory()->null_value();
167 } 167 }
168 168
169 169
170 Handle<Object> CallSite::GetFunctionName() { 170 Handle<Object> CallSite::GetFunctionName() {
171 Handle<String> result = JSFunction::GetDebugName(fun_); 171 Handle<String> result = JSFunction::GetName(fun_);
172 if (result->length() != 0) return result; 172 if (result->length() != 0) return result;
173
173 Handle<Object> script(fun_->shared()->script(), isolate_); 174 Handle<Object> script(fun_->shared()->script(), isolate_);
174 if (script->IsScript() && 175 if (script->IsScript() &&
175 Handle<Script>::cast(script)->compilation_type() == 176 Handle<Script>::cast(script)->compilation_type() ==
176 Script::COMPILATION_TYPE_EVAL) { 177 Script::COMPILATION_TYPE_EVAL) {
177 return isolate_->factory()->eval_string(); 178 return isolate_->factory()->eval_string();
178 } 179 }
179 return isolate_->factory()->null_value(); 180 return isolate_->factory()->null_value();
180 } 181 }
181 182
182 183
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 if (obj->IsUndefined()) return default_value; 475 if (obj->IsUndefined()) return default_value;
475 if (!obj->IsString()) { 476 if (!obj->IsString()) {
476 ASSIGN_RETURN_ON_EXCEPTION(isolate, obj, Object::ToString(isolate, obj), 477 ASSIGN_RETURN_ON_EXCEPTION(isolate, obj, Object::ToString(isolate, obj),
477 String); 478 String);
478 } 479 }
479 return Handle<String>::cast(obj); 480 return Handle<String>::cast(obj);
480 } 481 }
481 482
482 } // namespace internal 483 } // namespace internal
483 } // namespace v8 484 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/heap.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698