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

Side by Side Diff: src/objects.cc

Issue 2512463002: Revert of Refactor SharedFunctionInfo::IsBuiltin. (Closed)
Patch Set: Created 4 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/objects-inl.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 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/objects.h" 5 #include "src/objects.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <iomanip> 8 #include <iomanip>
9 #include <memory> 9 #include <memory>
10 #include <sstream> 10 #include <sstream>
(...skipping 13277 matching lines...) Expand 10 before | Expand all | Expand 10 after
13288 return isolate->factory()->NewStringFromAsciiChecked(kNativeCodeSource); 13288 return isolate->factory()->NewStringFromAsciiChecked(kNativeCodeSource);
13289 } 13289 }
13290 13290
13291 13291
13292 // static 13292 // static
13293 Handle<String> JSFunction::ToString(Handle<JSFunction> function) { 13293 Handle<String> JSFunction::ToString(Handle<JSFunction> function) {
13294 Isolate* const isolate = function->GetIsolate(); 13294 Isolate* const isolate = function->GetIsolate();
13295 Handle<SharedFunctionInfo> shared_info(function->shared(), isolate); 13295 Handle<SharedFunctionInfo> shared_info(function->shared(), isolate);
13296 13296
13297 // Check if {function} should hide its source code. 13297 // Check if {function} should hide its source code.
13298 if (!shared_info->IsUserJavaScript()) { 13298 if (!shared_info->script()->IsScript() ||
13299 Script::cast(shared_info->script())->hide_source()) {
13299 return NativeCodeFunctionSourceString(shared_info); 13300 return NativeCodeFunctionSourceString(shared_info);
13300 } 13301 }
13301 13302
13302 // Check if we should print {function} as a class. 13303 // Check if we should print {function} as a class.
13303 Handle<Object> class_start_position = JSReceiver::GetDataProperty( 13304 Handle<Object> class_start_position = JSReceiver::GetDataProperty(
13304 function, isolate->factory()->class_start_position_symbol()); 13305 function, isolate->factory()->class_start_position_symbol());
13305 if (class_start_position->IsSmi()) { 13306 if (class_start_position->IsSmi()) {
13306 Handle<Object> class_end_position = JSReceiver::GetDataProperty( 13307 Handle<Object> class_end_position = JSReceiver::GetDataProperty(
13307 function, isolate->factory()->class_end_position_symbol()); 13308 function, isolate->factory()->class_end_position_symbol());
13308 Handle<String> script_source( 13309 Handle<String> script_source(
(...skipping 7090 matching lines...) Expand 10 before | Expand all | Expand 10 after
20399 // depend on this. 20400 // depend on this.
20400 return DICTIONARY_ELEMENTS; 20401 return DICTIONARY_ELEMENTS;
20401 } 20402 }
20402 DCHECK_LE(kind, LAST_ELEMENTS_KIND); 20403 DCHECK_LE(kind, LAST_ELEMENTS_KIND);
20403 return kind; 20404 return kind;
20404 } 20405 }
20405 } 20406 }
20406 20407
20407 } // namespace internal 20408 } // namespace internal
20408 } // namespace v8 20409 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698