OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
638 | 638 |
639 | 639 |
640 bool Object::IsHashTable() { | 640 bool Object::IsHashTable() { |
641 return Object::IsHeapObject() && | 641 return Object::IsHeapObject() && |
642 HeapObject::cast(this)->map() == | 642 HeapObject::cast(this)->map() == |
643 HeapObject::cast(this)->GetHeap()->hash_table_map(); | 643 HeapObject::cast(this)->GetHeap()->hash_table_map(); |
644 } | 644 } |
645 | 645 |
646 | 646 |
647 bool Object::IsDictionary() { | 647 bool Object::IsDictionary() { |
648 return IsHashTable() && | 648 return IsHashTable() && this != |
649 this != HeapObject::cast(this)->GetHeap()->symbol_table(); | 649 HeapObject::cast(this)->GetHeap()->symbol_table(); |
650 } | 650 } |
651 | 651 |
652 | 652 |
653 bool Object::IsSymbolTable() { | 653 bool Object::IsSymbolTable() { |
654 return IsHashTable() && this == | 654 return IsHashTable() && this == |
655 HeapObject::cast(this)->GetHeap()->raw_unchecked_symbol_table(); | 655 HeapObject::cast(this)->GetHeap()->raw_unchecked_symbol_table(); |
656 } | 656 } |
657 | 657 |
658 | 658 |
659 bool Object::IsJSFunctionResultCache() { | 659 bool Object::IsJSFunctionResultCache() { |
(...skipping 2621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3281 | 3281 |
3282 BOOL_ACCESSORS(FunctionTemplateInfo, flag, hidden_prototype, | 3282 BOOL_ACCESSORS(FunctionTemplateInfo, flag, hidden_prototype, |
3283 kHiddenPrototypeBit) | 3283 kHiddenPrototypeBit) |
3284 BOOL_ACCESSORS(FunctionTemplateInfo, flag, undetectable, kUndetectableBit) | 3284 BOOL_ACCESSORS(FunctionTemplateInfo, flag, undetectable, kUndetectableBit) |
3285 BOOL_ACCESSORS(FunctionTemplateInfo, flag, needs_access_check, | 3285 BOOL_ACCESSORS(FunctionTemplateInfo, flag, needs_access_check, |
3286 kNeedsAccessCheckBit) | 3286 kNeedsAccessCheckBit) |
3287 BOOL_ACCESSORS(SharedFunctionInfo, start_position_and_type, is_expression, | 3287 BOOL_ACCESSORS(SharedFunctionInfo, start_position_and_type, is_expression, |
3288 kIsExpressionBit) | 3288 kIsExpressionBit) |
3289 BOOL_ACCESSORS(SharedFunctionInfo, start_position_and_type, is_toplevel, | 3289 BOOL_ACCESSORS(SharedFunctionInfo, start_position_and_type, is_toplevel, |
3290 kIsTopLevelBit) | 3290 kIsTopLevelBit) |
3291 BOOL_GETTER(SharedFunctionInfo, | 3291 BOOL_GETTER(SharedFunctionInfo, compiler_hints, |
3292 compiler_hints, | |
3293 has_only_simple_this_property_assignments, | 3292 has_only_simple_this_property_assignments, |
3294 kHasOnlySimpleThisPropertyAssignments) | 3293 kHasOnlySimpleThisPropertyAssignments) |
3295 BOOL_ACCESSORS(SharedFunctionInfo, | 3294 BOOL_ACCESSORS(SharedFunctionInfo, |
3296 compiler_hints, | 3295 compiler_hints, |
3297 allows_lazy_compilation, | 3296 allows_lazy_compilation, |
3298 kAllowLazyCompilation) | 3297 kAllowLazyCompilation) |
3299 BOOL_ACCESSORS(SharedFunctionInfo, | |
3300 compiler_hints, | |
3301 uses_arguments, | |
3302 kUsesArguments) | |
3303 BOOL_ACCESSORS(SharedFunctionInfo, | |
3304 compiler_hints, | |
3305 has_duplicate_parameters, | |
3306 kHasDuplicateParameters) | |
3307 | 3298 |
3308 | 3299 |
3309 #if V8_HOST_ARCH_32_BIT | 3300 #if V8_HOST_ARCH_32_BIT |
3310 SMI_ACCESSORS(SharedFunctionInfo, length, kLengthOffset) | 3301 SMI_ACCESSORS(SharedFunctionInfo, length, kLengthOffset) |
3311 SMI_ACCESSORS(SharedFunctionInfo, formal_parameter_count, | 3302 SMI_ACCESSORS(SharedFunctionInfo, formal_parameter_count, |
3312 kFormalParameterCountOffset) | 3303 kFormalParameterCountOffset) |
3313 SMI_ACCESSORS(SharedFunctionInfo, expected_nof_properties, | 3304 SMI_ACCESSORS(SharedFunctionInfo, expected_nof_properties, |
3314 kExpectedNofPropertiesOffset) | 3305 kExpectedNofPropertiesOffset) |
3315 SMI_ACCESSORS(SharedFunctionInfo, num_literals, kNumLiteralsOffset) | 3306 SMI_ACCESSORS(SharedFunctionInfo, num_literals, kNumLiteralsOffset) |
3316 SMI_ACCESSORS(SharedFunctionInfo, start_position_and_type, | 3307 SMI_ACCESSORS(SharedFunctionInfo, start_position_and_type, |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3380 return READ_BYTE_FIELD(this, kConstructionCountOffset); | 3371 return READ_BYTE_FIELD(this, kConstructionCountOffset); |
3381 } | 3372 } |
3382 | 3373 |
3383 | 3374 |
3384 void SharedFunctionInfo::set_construction_count(int value) { | 3375 void SharedFunctionInfo::set_construction_count(int value) { |
3385 ASSERT(0 <= value && value < 256); | 3376 ASSERT(0 <= value && value < 256); |
3386 WRITE_BYTE_FIELD(this, kConstructionCountOffset, static_cast<byte>(value)); | 3377 WRITE_BYTE_FIELD(this, kConstructionCountOffset, static_cast<byte>(value)); |
3387 } | 3378 } |
3388 | 3379 |
3389 | 3380 |
3390 BOOL_ACCESSORS(SharedFunctionInfo, | 3381 bool SharedFunctionInfo::live_objects_may_exist() { |
3391 compiler_hints, | 3382 return (compiler_hints() & (1 << kLiveObjectsMayExist)) != 0; |
3392 live_objects_may_exist, | 3383 } |
3393 kLiveObjectsMayExist) | 3384 |
| 3385 |
| 3386 void SharedFunctionInfo::set_live_objects_may_exist(bool value) { |
| 3387 if (value) { |
| 3388 set_compiler_hints(compiler_hints() | (1 << kLiveObjectsMayExist)); |
| 3389 } else { |
| 3390 set_compiler_hints(compiler_hints() & ~(1 << kLiveObjectsMayExist)); |
| 3391 } |
| 3392 } |
3394 | 3393 |
3395 | 3394 |
3396 bool SharedFunctionInfo::IsInobjectSlackTrackingInProgress() { | 3395 bool SharedFunctionInfo::IsInobjectSlackTrackingInProgress() { |
3397 return initial_map() != HEAP->undefined_value(); | 3396 return initial_map() != HEAP->undefined_value(); |
3398 } | 3397 } |
3399 | 3398 |
3400 | 3399 |
3401 BOOL_GETTER(SharedFunctionInfo, | 3400 bool SharedFunctionInfo::optimization_disabled() { |
3402 compiler_hints, | 3401 return BooleanBit::get(compiler_hints(), kOptimizationDisabled); |
3403 optimization_disabled, | 3402 } |
3404 kOptimizationDisabled) | |
3405 | 3403 |
3406 | 3404 |
3407 void SharedFunctionInfo::set_optimization_disabled(bool disable) { | 3405 void SharedFunctionInfo::set_optimization_disabled(bool disable) { |
3408 set_compiler_hints(BooleanBit::set(compiler_hints(), | 3406 set_compiler_hints(BooleanBit::set(compiler_hints(), |
3409 kOptimizationDisabled, | 3407 kOptimizationDisabled, |
3410 disable)); | 3408 disable)); |
3411 // If disabling optimizations we reflect that in the code object so | 3409 // If disabling optimizations we reflect that in the code object so |
3412 // it will not be counted as optimizable code. | 3410 // it will not be counted as optimizable code. |
3413 if ((code()->kind() == Code::FUNCTION) && disable) { | 3411 if ((code()->kind() == Code::FUNCTION) && disable) { |
3414 code()->set_optimizable(false); | 3412 code()->set_optimizable(false); |
3415 } | 3413 } |
3416 } | 3414 } |
3417 | 3415 |
3418 | 3416 |
3419 BOOL_ACCESSORS(SharedFunctionInfo, | 3417 bool SharedFunctionInfo::strict_mode() { |
3420 compiler_hints, | 3418 return BooleanBit::get(compiler_hints(), kStrictModeFunction); |
3421 strict_mode, | 3419 } |
3422 kStrictModeFunction) | 3420 |
| 3421 |
| 3422 void SharedFunctionInfo::set_strict_mode(bool value) { |
| 3423 set_compiler_hints(BooleanBit::set(compiler_hints(), |
| 3424 kStrictModeFunction, |
| 3425 value)); |
| 3426 } |
3423 | 3427 |
3424 | 3428 |
3425 bool SharedFunctionInfo::native() { | 3429 bool SharedFunctionInfo::native() { |
3426 return BooleanBit::get(compiler_hints(), kNative); | 3430 return BooleanBit::get(compiler_hints(), kNative); |
3427 } | 3431 } |
3428 | 3432 |
3429 | 3433 |
3430 void SharedFunctionInfo::set_native(bool value) { | 3434 void SharedFunctionInfo::set_native(bool value) { |
3431 set_compiler_hints(BooleanBit::set(compiler_hints(), | 3435 set_compiler_hints(BooleanBit::set(compiler_hints(), |
3432 kNative, | 3436 kNative, |
(...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4418 #undef WRITE_INT_FIELD | 4422 #undef WRITE_INT_FIELD |
4419 #undef READ_SHORT_FIELD | 4423 #undef READ_SHORT_FIELD |
4420 #undef WRITE_SHORT_FIELD | 4424 #undef WRITE_SHORT_FIELD |
4421 #undef READ_BYTE_FIELD | 4425 #undef READ_BYTE_FIELD |
4422 #undef WRITE_BYTE_FIELD | 4426 #undef WRITE_BYTE_FIELD |
4423 | 4427 |
4424 | 4428 |
4425 } } // namespace v8::internal | 4429 } } // namespace v8::internal |
4426 | 4430 |
4427 #endif // V8_OBJECTS_INL_H_ | 4431 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |