| 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 5222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5233 #if TRACE_MAPS | 5233 #if TRACE_MAPS |
| 5234 SMI_ACCESSORS(SharedFunctionInfo, unique_id, kUniqueIdOffset) | 5234 SMI_ACCESSORS(SharedFunctionInfo, unique_id, kUniqueIdOffset) |
| 5235 #endif | 5235 #endif |
| 5236 ACCESSORS(SharedFunctionInfo, instance_class_name, Object, | 5236 ACCESSORS(SharedFunctionInfo, instance_class_name, Object, |
| 5237 kInstanceClassNameOffset) | 5237 kInstanceClassNameOffset) |
| 5238 ACCESSORS(SharedFunctionInfo, function_data, Object, kFunctionDataOffset) | 5238 ACCESSORS(SharedFunctionInfo, function_data, Object, kFunctionDataOffset) |
| 5239 ACCESSORS(SharedFunctionInfo, script, Object, kScriptOffset) | 5239 ACCESSORS(SharedFunctionInfo, script, Object, kScriptOffset) |
| 5240 ACCESSORS(SharedFunctionInfo, debug_info, Object, kDebugInfoOffset) | 5240 ACCESSORS(SharedFunctionInfo, debug_info, Object, kDebugInfoOffset) |
| 5241 ACCESSORS(SharedFunctionInfo, inferred_name, String, kInferredNameOffset) | 5241 ACCESSORS(SharedFunctionInfo, inferred_name, String, kInferredNameOffset) |
| 5242 | 5242 |
| 5243 ACCESSORS(SharedFunctionInfo, asm_code, Code, kAsmCodeOffset) |
| 5244 |
| 5243 | 5245 |
| 5244 SMI_ACCESSORS(FunctionTemplateInfo, length, kLengthOffset) | 5246 SMI_ACCESSORS(FunctionTemplateInfo, length, kLengthOffset) |
| 5245 BOOL_ACCESSORS(FunctionTemplateInfo, flag, hidden_prototype, | 5247 BOOL_ACCESSORS(FunctionTemplateInfo, flag, hidden_prototype, |
| 5246 kHiddenPrototypeBit) | 5248 kHiddenPrototypeBit) |
| 5247 BOOL_ACCESSORS(FunctionTemplateInfo, flag, undetectable, kUndetectableBit) | 5249 BOOL_ACCESSORS(FunctionTemplateInfo, flag, undetectable, kUndetectableBit) |
| 5248 BOOL_ACCESSORS(FunctionTemplateInfo, flag, needs_access_check, | 5250 BOOL_ACCESSORS(FunctionTemplateInfo, flag, needs_access_check, |
| 5249 kNeedsAccessCheckBit) | 5251 kNeedsAccessCheckBit) |
| 5250 BOOL_ACCESSORS(FunctionTemplateInfo, flag, read_only_prototype, | 5252 BOOL_ACCESSORS(FunctionTemplateInfo, flag, read_only_prototype, |
| 5251 kReadOnlyPrototypeBit) | 5253 kReadOnlyPrototypeBit) |
| 5252 BOOL_ACCESSORS(FunctionTemplateInfo, flag, remove_prototype, | 5254 BOOL_ACCESSORS(FunctionTemplateInfo, flag, remove_prototype, |
| (...skipping 16 matching lines...) Expand all Loading... |
| 5269 kAllowLazyCompilationWithoutContext) | 5271 kAllowLazyCompilationWithoutContext) |
| 5270 BOOL_ACCESSORS(SharedFunctionInfo, | 5272 BOOL_ACCESSORS(SharedFunctionInfo, |
| 5271 compiler_hints, | 5273 compiler_hints, |
| 5272 uses_arguments, | 5274 uses_arguments, |
| 5273 kUsesArguments) | 5275 kUsesArguments) |
| 5274 BOOL_ACCESSORS(SharedFunctionInfo, | 5276 BOOL_ACCESSORS(SharedFunctionInfo, |
| 5275 compiler_hints, | 5277 compiler_hints, |
| 5276 has_duplicate_parameters, | 5278 has_duplicate_parameters, |
| 5277 kHasDuplicateParameters) | 5279 kHasDuplicateParameters) |
| 5278 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, asm_function, kIsAsmFunction) | 5280 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, asm_function, kIsAsmFunction) |
| 5281 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, asm_module, kIsAsmModule) |
| 5279 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, deserialized, kDeserialized) | 5282 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, deserialized, kDeserialized) |
| 5280 | 5283 |
| 5281 | 5284 |
| 5282 #if V8_HOST_ARCH_32_BIT | 5285 #if V8_HOST_ARCH_32_BIT |
| 5283 SMI_ACCESSORS(SharedFunctionInfo, length, kLengthOffset) | 5286 SMI_ACCESSORS(SharedFunctionInfo, length, kLengthOffset) |
| 5284 SMI_ACCESSORS(SharedFunctionInfo, internal_formal_parameter_count, | 5287 SMI_ACCESSORS(SharedFunctionInfo, internal_formal_parameter_count, |
| 5285 kFormalParameterCountOffset) | 5288 kFormalParameterCountOffset) |
| 5286 SMI_ACCESSORS(SharedFunctionInfo, expected_nof_properties, | 5289 SMI_ACCESSORS(SharedFunctionInfo, expected_nof_properties, |
| 5287 kExpectedNofPropertiesOffset) | 5290 kExpectedNofPropertiesOffset) |
| 5288 SMI_ACCESSORS(SharedFunctionInfo, num_literals, kNumLiteralsOffset) | 5291 SMI_ACCESSORS(SharedFunctionInfo, num_literals, kNumLiteralsOffset) |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5378 | 5381 |
| 5379 | 5382 |
| 5380 LanguageMode SharedFunctionInfo::language_mode() { | 5383 LanguageMode SharedFunctionInfo::language_mode() { |
| 5381 STATIC_ASSERT(LANGUAGE_END == 3); | 5384 STATIC_ASSERT(LANGUAGE_END == 3); |
| 5382 return construct_language_mode( | 5385 return construct_language_mode( |
| 5383 BooleanBit::get(compiler_hints(), kStrictModeFunction), | 5386 BooleanBit::get(compiler_hints(), kStrictModeFunction), |
| 5384 BooleanBit::get(compiler_hints(), kStrongModeFunction)); | 5387 BooleanBit::get(compiler_hints(), kStrongModeFunction)); |
| 5385 } | 5388 } |
| 5386 | 5389 |
| 5387 | 5390 |
| 5391 AsmMode SharedFunctionInfo::asm_mode() { |
| 5392 int hints = compiler_hints(); |
| 5393 if (BooleanBit::get(hints, kIsAsmModule)) { |
| 5394 DCHECK(!BooleanBit::get(hints, kIsAsmFunction)); |
| 5395 return ASM_MODULE; |
| 5396 } else if (BooleanBit::get(hints, kIsAsmFunction)) { |
| 5397 return ASM_FUNCTION; |
| 5398 } |
| 5399 return ASM_NO; |
| 5400 } |
| 5401 |
| 5402 |
| 5388 void SharedFunctionInfo::set_language_mode(LanguageMode language_mode) { | 5403 void SharedFunctionInfo::set_language_mode(LanguageMode language_mode) { |
| 5389 STATIC_ASSERT(LANGUAGE_END == 3); | 5404 STATIC_ASSERT(LANGUAGE_END == 3); |
| 5390 // We only allow language mode transitions that set the same language mode | 5405 // We only allow language mode transitions that set the same language mode |
| 5391 // again or go up in the chain: | 5406 // again or go up in the chain: |
| 5392 DCHECK(is_sloppy(this->language_mode()) || is_strict(language_mode)); | 5407 DCHECK(is_sloppy(this->language_mode()) || is_strict(language_mode)); |
| 5393 int hints = compiler_hints(); | 5408 int hints = compiler_hints(); |
| 5394 hints = BooleanBit::set(hints, kStrictModeFunction, is_strict(language_mode)); | 5409 hints = BooleanBit::set(hints, kStrictModeFunction, is_strict(language_mode)); |
| 5395 hints = BooleanBit::set(hints, kStrongModeFunction, is_strong(language_mode)); | 5410 hints = BooleanBit::set(hints, kStrongModeFunction, is_strong(language_mode)); |
| 5396 set_compiler_hints(hints); | 5411 set_compiler_hints(hints); |
| 5397 } | 5412 } |
| 5398 | 5413 |
| 5399 | 5414 |
| 5400 FunctionKind SharedFunctionInfo::kind() { | 5415 FunctionKind SharedFunctionInfo::kind() { |
| 5401 return FunctionKindBits::decode(compiler_hints()); | 5416 return FunctionKindBits::decode(compiler_hints()); |
| 5402 } | 5417 } |
| 5403 | 5418 |
| 5404 | 5419 |
| 5420 void SharedFunctionInfo::set_asm_mode(AsmMode asm_mode) { |
| 5421 DCHECK(FLAG_asm || asm_mode == ASM_NO); |
| 5422 DCHECK(this->asm_mode() == ASM_NO || |
| 5423 this->asm_mode() == asm_mode || |
| 5424 asm_mode == ASM_FUNCTION); |
| 5425 int hints = compiler_hints(); |
| 5426 hints = BooleanBit::set(hints, kIsAsmModule, asm_mode == ASM_MODULE); |
| 5427 hints = BooleanBit::set(hints, kIsAsmFunction, asm_mode == ASM_FUNCTION); |
| 5428 set_compiler_hints(hints); |
| 5429 } |
| 5430 |
| 5431 |
| 5405 void SharedFunctionInfo::set_kind(FunctionKind kind) { | 5432 void SharedFunctionInfo::set_kind(FunctionKind kind) { |
| 5406 DCHECK(IsValidFunctionKind(kind)); | 5433 DCHECK(IsValidFunctionKind(kind)); |
| 5407 int hints = compiler_hints(); | 5434 int hints = compiler_hints(); |
| 5408 hints = FunctionKindBits::update(hints, kind); | 5435 hints = FunctionKindBits::update(hints, kind); |
| 5409 set_compiler_hints(hints); | 5436 set_compiler_hints(hints); |
| 5410 } | 5437 } |
| 5411 | 5438 |
| 5412 | 5439 |
| 5413 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, needs_home_object, | 5440 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, needs_home_object, |
| 5414 kNeedsHomeObject) | 5441 kNeedsHomeObject) |
| (...skipping 1944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7359 #undef READ_SHORT_FIELD | 7386 #undef READ_SHORT_FIELD |
| 7360 #undef WRITE_SHORT_FIELD | 7387 #undef WRITE_SHORT_FIELD |
| 7361 #undef READ_BYTE_FIELD | 7388 #undef READ_BYTE_FIELD |
| 7362 #undef WRITE_BYTE_FIELD | 7389 #undef WRITE_BYTE_FIELD |
| 7363 #undef NOBARRIER_READ_BYTE_FIELD | 7390 #undef NOBARRIER_READ_BYTE_FIELD |
| 7364 #undef NOBARRIER_WRITE_BYTE_FIELD | 7391 #undef NOBARRIER_WRITE_BYTE_FIELD |
| 7365 | 7392 |
| 7366 } } // namespace v8::internal | 7393 } } // namespace v8::internal |
| 7367 | 7394 |
| 7368 #endif // V8_OBJECTS_INL_H_ | 7395 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |