OLD | NEW |
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 Loading... |
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 Loading... |
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 Loading... |
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_ |
OLD | NEW |