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

Side by Side Diff: src/objects-inl.h

Issue 1292283004: Do not use js builtins object to determine whether a function is a builtin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: remove redundant check Created 5 years, 4 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.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 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 // Review notes: 5 // Review notes:
6 // 6 //
7 // - The use of macros in these inline functions may seem superfluous 7 // - The use of macros in these inline functions may seem superfluous
8 // but it is absolutely needed to make sure gcc generates optimal 8 // but it is absolutely needed to make sure gcc generates optimal
9 // code. gcc is not happy when attempting to inline too deep. 9 // code. gcc is not happy when attempting to inline too deep.
10 // 10 //
(...skipping 5519 matching lines...) Expand 10 before | Expand all | Expand 10 after
5530 ACCESSORS(Script, source_mapping_url, Object, kSourceMappingUrlOffset) 5530 ACCESSORS(Script, source_mapping_url, Object, kSourceMappingUrlOffset)
5531 5531
5532 Script::CompilationType Script::compilation_type() { 5532 Script::CompilationType Script::compilation_type() {
5533 return BooleanBit::get(flags(), kCompilationTypeBit) ? 5533 return BooleanBit::get(flags(), kCompilationTypeBit) ?
5534 COMPILATION_TYPE_EVAL : COMPILATION_TYPE_HOST; 5534 COMPILATION_TYPE_EVAL : COMPILATION_TYPE_HOST;
5535 } 5535 }
5536 void Script::set_compilation_type(CompilationType type) { 5536 void Script::set_compilation_type(CompilationType type) {
5537 set_flags(BooleanBit::set(flags(), kCompilationTypeBit, 5537 set_flags(BooleanBit::set(flags(), kCompilationTypeBit,
5538 type == COMPILATION_TYPE_EVAL)); 5538 type == COMPILATION_TYPE_EVAL));
5539 } 5539 }
5540 bool Script::hide_source() { return BooleanBit::get(flags(), kHideSourceBit); }
5541 void Script::set_hide_source(bool value) {
5542 set_flags(BooleanBit::set(flags(), kHideSourceBit, value));
5543 }
5540 Script::CompilationState Script::compilation_state() { 5544 Script::CompilationState Script::compilation_state() {
5541 return BooleanBit::get(flags(), kCompilationStateBit) ? 5545 return BooleanBit::get(flags(), kCompilationStateBit) ?
5542 COMPILATION_STATE_COMPILED : COMPILATION_STATE_INITIAL; 5546 COMPILATION_STATE_COMPILED : COMPILATION_STATE_INITIAL;
5543 } 5547 }
5544 void Script::set_compilation_state(CompilationState state) { 5548 void Script::set_compilation_state(CompilationState state) {
5545 set_flags(BooleanBit::set(flags(), kCompilationStateBit, 5549 set_flags(BooleanBit::set(flags(), kCompilationStateBit,
5546 state == COMPILATION_STATE_COMPILED)); 5550 state == COMPILATION_STATE_COMPILED));
5547 } 5551 }
5548 ScriptOriginOptions Script::origin_options() { 5552 ScriptOriginOptions Script::origin_options() {
5549 return ScriptOriginOptions((flags()->value() & kOriginOptionsMask) >> 5553 return ScriptOriginOptions((flags()->value() & kOriginOptionsMask) >>
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
5995 } 5999 }
5996 } 6000 }
5997 6001
5998 6002
5999 void SharedFunctionInfo::set_disable_optimization_reason(BailoutReason reason) { 6003 void SharedFunctionInfo::set_disable_optimization_reason(BailoutReason reason) {
6000 set_opt_count_and_bailout_reason(DisabledOptimizationReasonBits::update( 6004 set_opt_count_and_bailout_reason(DisabledOptimizationReasonBits::update(
6001 opt_count_and_bailout_reason(), reason)); 6005 opt_count_and_bailout_reason(), reason));
6002 } 6006 }
6003 6007
6004 6008
6005 bool SharedFunctionInfo::IsSubjectToDebugging() { 6009 bool SharedFunctionInfo::IsBuiltin() {
6006 Object* script_obj = script(); 6010 Object* script_obj = script();
6007 if (script_obj->IsUndefined()) return false; 6011 if (script_obj->IsUndefined()) return true;
6008 Script* script = Script::cast(script_obj); 6012 Script* script = Script::cast(script_obj);
6009 Script::Type type = static_cast<Script::Type>(script->type()->value()); 6013 Script::Type type = static_cast<Script::Type>(script->type()->value());
6010 return type == Script::TYPE_NORMAL; 6014 return type != Script::TYPE_NORMAL;
6011 } 6015 }
6012 6016
6013 6017
6014 bool JSFunction::IsBuiltin() { 6018 bool SharedFunctionInfo::IsSubjectToDebugging() { return !IsBuiltin(); }
6015 return context()->global_object()->IsJSBuiltinsObject(); 6019
6016 } 6020
6021 bool JSFunction::IsBuiltin() { return shared()->IsBuiltin(); }
6017 6022
6018 6023
6019 bool JSFunction::IsSubjectToDebugging() { 6024 bool JSFunction::IsSubjectToDebugging() {
6020 return shared()->IsSubjectToDebugging(); 6025 return shared()->IsSubjectToDebugging();
6021 } 6026 }
6022 6027
6023 6028
6024 bool JSFunction::NeedsArgumentsAdaption() { 6029 bool JSFunction::NeedsArgumentsAdaption() {
6025 return shared()->internal_formal_parameter_count() != 6030 return shared()->internal_formal_parameter_count() !=
6026 SharedFunctionInfo::kDontAdaptArgumentsSentinel; 6031 SharedFunctionInfo::kDontAdaptArgumentsSentinel;
(...skipping 1800 matching lines...) Expand 10 before | Expand all | Expand 10 after
7827 #undef READ_INT64_FIELD 7832 #undef READ_INT64_FIELD
7828 #undef WRITE_INT64_FIELD 7833 #undef WRITE_INT64_FIELD
7829 #undef READ_BYTE_FIELD 7834 #undef READ_BYTE_FIELD
7830 #undef WRITE_BYTE_FIELD 7835 #undef WRITE_BYTE_FIELD
7831 #undef NOBARRIER_READ_BYTE_FIELD 7836 #undef NOBARRIER_READ_BYTE_FIELD
7832 #undef NOBARRIER_WRITE_BYTE_FIELD 7837 #undef NOBARRIER_WRITE_BYTE_FIELD
7833 7838
7834 } } // namespace v8::internal 7839 } } // namespace v8::internal
7835 7840
7836 #endif // V8_OBJECTS_INL_H_ 7841 #endif // V8_OBJECTS_INL_H_
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