| 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 5533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5544 ACCESSORS_TO_SMI(Script, line_offset, kLineOffsetOffset) | 5544 ACCESSORS_TO_SMI(Script, line_offset, kLineOffsetOffset) |
| 5545 ACCESSORS_TO_SMI(Script, column_offset, kColumnOffsetOffset) | 5545 ACCESSORS_TO_SMI(Script, column_offset, kColumnOffsetOffset) |
| 5546 ACCESSORS(Script, context_data, Object, kContextOffset) | 5546 ACCESSORS(Script, context_data, Object, kContextOffset) |
| 5547 ACCESSORS(Script, wrapper, HeapObject, kWrapperOffset) | 5547 ACCESSORS(Script, wrapper, HeapObject, kWrapperOffset) |
| 5548 ACCESSORS_TO_SMI(Script, type, kTypeOffset) | 5548 ACCESSORS_TO_SMI(Script, type, kTypeOffset) |
| 5549 ACCESSORS(Script, line_ends, Object, kLineEndsOffset) | 5549 ACCESSORS(Script, line_ends, Object, kLineEndsOffset) |
| 5550 ACCESSORS(Script, eval_from_shared, Object, kEvalFromSharedOffset) | 5550 ACCESSORS(Script, eval_from_shared, Object, kEvalFromSharedOffset) |
| 5551 ACCESSORS_TO_SMI(Script, eval_from_instructions_offset, | 5551 ACCESSORS_TO_SMI(Script, eval_from_instructions_offset, |
| 5552 kEvalFrominstructionsOffsetOffset) | 5552 kEvalFrominstructionsOffsetOffset) |
| 5553 ACCESSORS_TO_SMI(Script, flags, kFlagsOffset) | 5553 ACCESSORS_TO_SMI(Script, flags, kFlagsOffset) |
| 5554 BOOL_ACCESSORS(Script, flags, is_embedder_debug_script, |
| 5555 kIsEmbedderDebugScriptBit) |
| 5556 BOOL_ACCESSORS(Script, flags, is_shared_cross_origin, kIsSharedCrossOriginBit) |
| 5554 ACCESSORS(Script, source_url, Object, kSourceUrlOffset) | 5557 ACCESSORS(Script, source_url, Object, kSourceUrlOffset) |
| 5555 ACCESSORS(Script, source_mapping_url, Object, kSourceMappingUrlOffset) | 5558 ACCESSORS(Script, source_mapping_url, Object, kSourceMappingUrlOffset) |
| 5556 | 5559 |
| 5557 Script::CompilationType Script::compilation_type() { | 5560 Script::CompilationType Script::compilation_type() { |
| 5558 return BooleanBit::get(flags(), kCompilationTypeBit) ? | 5561 return BooleanBit::get(flags(), kCompilationTypeBit) ? |
| 5559 COMPILATION_TYPE_EVAL : COMPILATION_TYPE_HOST; | 5562 COMPILATION_TYPE_EVAL : COMPILATION_TYPE_HOST; |
| 5560 } | 5563 } |
| 5561 void Script::set_compilation_type(CompilationType type) { | 5564 void Script::set_compilation_type(CompilationType type) { |
| 5562 set_flags(BooleanBit::set(flags(), kCompilationTypeBit, | 5565 set_flags(BooleanBit::set(flags(), kCompilationTypeBit, |
| 5563 type == COMPILATION_TYPE_EVAL)); | 5566 type == COMPILATION_TYPE_EVAL)); |
| 5564 } | 5567 } |
| 5565 Script::CompilationState Script::compilation_state() { | 5568 Script::CompilationState Script::compilation_state() { |
| 5566 return BooleanBit::get(flags(), kCompilationStateBit) ? | 5569 return BooleanBit::get(flags(), kCompilationStateBit) ? |
| 5567 COMPILATION_STATE_COMPILED : COMPILATION_STATE_INITIAL; | 5570 COMPILATION_STATE_COMPILED : COMPILATION_STATE_INITIAL; |
| 5568 } | 5571 } |
| 5569 void Script::set_compilation_state(CompilationState state) { | 5572 void Script::set_compilation_state(CompilationState state) { |
| 5570 set_flags(BooleanBit::set(flags(), kCompilationStateBit, | 5573 set_flags(BooleanBit::set(flags(), kCompilationStateBit, |
| 5571 state == COMPILATION_STATE_COMPILED)); | 5574 state == COMPILATION_STATE_COMPILED)); |
| 5572 } | 5575 } |
| 5573 ScriptOriginOptions Script::origin_options() { | |
| 5574 return ScriptOriginOptions((flags()->value() & kOriginOptionsMask) >> | |
| 5575 kOriginOptionsShift); | |
| 5576 } | |
| 5577 void Script::set_origin_options(ScriptOriginOptions origin_options) { | |
| 5578 DCHECK(!(origin_options.Flags() & ~((1 << kOriginOptionsSize) - 1))); | |
| 5579 set_flags(Smi::FromInt((flags()->value() & ~kOriginOptionsMask) | | |
| 5580 (origin_options.Flags() << kOriginOptionsShift))); | |
| 5581 } | |
| 5582 | 5576 |
| 5583 | 5577 |
| 5584 ACCESSORS(DebugInfo, shared, SharedFunctionInfo, kSharedFunctionInfoIndex) | 5578 ACCESSORS(DebugInfo, shared, SharedFunctionInfo, kSharedFunctionInfoIndex) |
| 5585 ACCESSORS(DebugInfo, original_code, Code, kOriginalCodeIndex) | 5579 ACCESSORS(DebugInfo, original_code, Code, kOriginalCodeIndex) |
| 5586 ACCESSORS(DebugInfo, code, Code, kPatchedCodeIndex) | 5580 ACCESSORS(DebugInfo, code, Code, kPatchedCodeIndex) |
| 5587 ACCESSORS(DebugInfo, break_points, FixedArray, kBreakPointsStateIndex) | 5581 ACCESSORS(DebugInfo, break_points, FixedArray, kBreakPointsStateIndex) |
| 5588 | 5582 |
| 5589 ACCESSORS_TO_SMI(BreakPointInfo, code_position, kCodePositionIndex) | 5583 ACCESSORS_TO_SMI(BreakPointInfo, code_position, kCodePositionIndex) |
| 5590 ACCESSORS_TO_SMI(BreakPointInfo, source_position, kSourcePositionIndex) | 5584 ACCESSORS_TO_SMI(BreakPointInfo, source_position, kSourcePositionIndex) |
| 5591 ACCESSORS_TO_SMI(BreakPointInfo, statement_position, kStatementPositionIndex) | 5585 ACCESSORS_TO_SMI(BreakPointInfo, statement_position, kStatementPositionIndex) |
| (...skipping 2031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7623 #undef READ_SHORT_FIELD | 7617 #undef READ_SHORT_FIELD |
| 7624 #undef WRITE_SHORT_FIELD | 7618 #undef WRITE_SHORT_FIELD |
| 7625 #undef READ_BYTE_FIELD | 7619 #undef READ_BYTE_FIELD |
| 7626 #undef WRITE_BYTE_FIELD | 7620 #undef WRITE_BYTE_FIELD |
| 7627 #undef NOBARRIER_READ_BYTE_FIELD | 7621 #undef NOBARRIER_READ_BYTE_FIELD |
| 7628 #undef NOBARRIER_WRITE_BYTE_FIELD | 7622 #undef NOBARRIER_WRITE_BYTE_FIELD |
| 7629 | 7623 |
| 7630 } } // namespace v8::internal | 7624 } } // namespace v8::internal |
| 7631 | 7625 |
| 7632 #endif // V8_OBJECTS_INL_H_ | 7626 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |