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

Side by Side Diff: src/api.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/accessors.cc ('k') | src/ast/prettyprinter.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/api.h" 5 #include "src/api.h"
6 6
7 #include <string.h> // For memcpy, strlen. 7 #include <string.h> // For memcpy, strlen.
8 #ifdef V8_USE_ADDRESS_SANITIZER 8 #ifdef V8_USE_ADDRESS_SANITIZER
9 #include <sanitizer/asan_interface.h> 9 #include <sanitizer/asan_interface.h>
10 #endif // V8_USE_ADDRESS_SANITIZER 10 #endif // V8_USE_ADDRESS_SANITIZER
(...skipping 5091 matching lines...) Expand 10 before | Expand all | Expand 10 after
5102 return kLineOffsetNotFound; 5102 return kLineOffsetNotFound;
5103 } 5103 }
5104 5104
5105 5105
5106 bool Function::IsBuiltin() const { 5106 bool Function::IsBuiltin() const {
5107 auto self = Utils::OpenHandle(this); 5107 auto self = Utils::OpenHandle(this);
5108 if (!self->IsJSFunction()) { 5108 if (!self->IsJSFunction()) {
5109 return false; 5109 return false;
5110 } 5110 }
5111 auto func = i::Handle<i::JSFunction>::cast(self); 5111 auto func = i::Handle<i::JSFunction>::cast(self);
5112 return !func->shared()->IsUserJavaScript(); 5112 return func->shared()->IsBuiltin();
5113 } 5113 }
5114 5114
5115 5115
5116 int Function::ScriptId() const { 5116 int Function::ScriptId() const {
5117 auto self = Utils::OpenHandle(this); 5117 auto self = Utils::OpenHandle(this);
5118 if (!self->IsJSFunction()) { 5118 if (!self->IsJSFunction()) {
5119 return v8::UnboundScript::kNoScriptId; 5119 return v8::UnboundScript::kNoScriptId;
5120 } 5120 }
5121 auto func = i::Handle<i::JSFunction>::cast(self); 5121 auto func = i::Handle<i::JSFunction>::cast(self);
5122 if (!func->shared()->script()->IsScript()) { 5122 if (!func->shared()->script()->IsScript()) {
(...skipping 4661 matching lines...) Expand 10 before | Expand all | Expand 10 after
9784 Address callback_address = 9784 Address callback_address =
9785 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 9785 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
9786 VMState<EXTERNAL> state(isolate); 9786 VMState<EXTERNAL> state(isolate);
9787 ExternalCallbackScope call_scope(isolate, callback_address); 9787 ExternalCallbackScope call_scope(isolate, callback_address);
9788 callback(info); 9788 callback(info);
9789 } 9789 }
9790 9790
9791 9791
9792 } // namespace internal 9792 } // namespace internal
9793 } // namespace v8 9793 } // namespace v8
OLDNEW
« no previous file with comments | « src/accessors.cc ('k') | src/ast/prettyprinter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698