| 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 5637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5648 map->unused_property_fields()); | 5648 map->unused_property_fields()); |
| 5649 } | 5649 } |
| 5650 | 5650 |
| 5651 | 5651 |
| 5652 ACCESSORS(JSBoundFunction, bound_target_function, JSReceiver, | 5652 ACCESSORS(JSBoundFunction, bound_target_function, JSReceiver, |
| 5653 kBoundTargetFunctionOffset) | 5653 kBoundTargetFunctionOffset) |
| 5654 ACCESSORS(JSBoundFunction, bound_this, Object, kBoundThisOffset) | 5654 ACCESSORS(JSBoundFunction, bound_this, Object, kBoundThisOffset) |
| 5655 ACCESSORS(JSBoundFunction, bound_arguments, FixedArray, kBoundArgumentsOffset) | 5655 ACCESSORS(JSBoundFunction, bound_arguments, FixedArray, kBoundArgumentsOffset) |
| 5656 | 5656 |
| 5657 ACCESSORS(JSFunction, shared, SharedFunctionInfo, kSharedFunctionInfoOffset) | 5657 ACCESSORS(JSFunction, shared, SharedFunctionInfo, kSharedFunctionInfoOffset) |
| 5658 ACCESSORS(JSFunction, feedback_vector, TypeFeedbackVector, | 5658 ACCESSORS(JSFunction, feedback_vector_cell, Cell, kFeedbackVectorOffset) |
| 5659 kFeedbackVectorOffset) | |
| 5660 ACCESSORS(JSFunction, next_function_link, Object, kNextFunctionLinkOffset) | 5659 ACCESSORS(JSFunction, next_function_link, Object, kNextFunctionLinkOffset) |
| 5661 | 5660 |
| 5662 ACCESSORS(JSGlobalObject, native_context, Context, kNativeContextOffset) | 5661 ACCESSORS(JSGlobalObject, native_context, Context, kNativeContextOffset) |
| 5663 ACCESSORS(JSGlobalObject, global_proxy, JSObject, kGlobalProxyOffset) | 5662 ACCESSORS(JSGlobalObject, global_proxy, JSObject, kGlobalProxyOffset) |
| 5664 | 5663 |
| 5665 ACCESSORS(JSGlobalProxy, native_context, Object, kNativeContextOffset) | 5664 ACCESSORS(JSGlobalProxy, native_context, Object, kNativeContextOffset) |
| 5666 ACCESSORS(JSGlobalProxy, hash, Object, kHashOffset) | 5665 ACCESSORS(JSGlobalProxy, hash, Object, kHashOffset) |
| 5667 | 5666 |
| 5668 ACCESSORS(AccessorInfo, name, Object, kNameOffset) | 5667 ACCESSORS(AccessorInfo, name, Object, kNameOffset) |
| 5669 SMI_ACCESSORS(AccessorInfo, flag, kFlagOffset) | 5668 SMI_ACCESSORS(AccessorInfo, flag, kFlagOffset) |
| (...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6474 } | 6473 } |
| 6475 | 6474 |
| 6476 bool SharedFunctionInfo::IsSubjectToDebugging() { | 6475 bool SharedFunctionInfo::IsSubjectToDebugging() { |
| 6477 return IsUserJavaScript() && !HasAsmWasmData(); | 6476 return IsUserJavaScript() && !HasAsmWasmData(); |
| 6478 } | 6477 } |
| 6479 | 6478 |
| 6480 bool SharedFunctionInfo::OptimizedCodeMapIsCleared() const { | 6479 bool SharedFunctionInfo::OptimizedCodeMapIsCleared() const { |
| 6481 return optimized_code_map() == GetHeap()->empty_fixed_array(); | 6480 return optimized_code_map() == GetHeap()->empty_fixed_array(); |
| 6482 } | 6481 } |
| 6483 | 6482 |
| 6483 TypeFeedbackVector* JSFunction::feedback_vector() const { |
| 6484 DCHECK(feedback_vector_cell()->value()->IsTypeFeedbackVector()); |
| 6485 return TypeFeedbackVector::cast(feedback_vector_cell()->value()); |
| 6486 } |
| 6484 | 6487 |
| 6485 bool JSFunction::IsOptimized() { | 6488 bool JSFunction::IsOptimized() { |
| 6486 return code()->kind() == Code::OPTIMIZED_FUNCTION; | 6489 return code()->kind() == Code::OPTIMIZED_FUNCTION; |
| 6487 } | 6490 } |
| 6488 | 6491 |
| 6489 bool JSFunction::IsInterpreted() { | 6492 bool JSFunction::IsInterpreted() { |
| 6490 return code()->is_interpreter_trampoline_builtin(); | 6493 return code()->is_interpreter_trampoline_builtin(); |
| 6491 } | 6494 } |
| 6492 | 6495 |
| 6493 bool JSFunction::IsMarkedForBaseline() { | 6496 bool JSFunction::IsMarkedForBaseline() { |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6581 // context based on the state change. | 6584 // context based on the state change. |
| 6582 if (!was_optimized && is_optimized) { | 6585 if (!was_optimized && is_optimized) { |
| 6583 context()->native_context()->AddOptimizedFunction(this); | 6586 context()->native_context()->AddOptimizedFunction(this); |
| 6584 } | 6587 } |
| 6585 if (was_optimized && !is_optimized) { | 6588 if (was_optimized && !is_optimized) { |
| 6586 // TODO(titzer): linear in the number of optimized functions; fix! | 6589 // TODO(titzer): linear in the number of optimized functions; fix! |
| 6587 context()->native_context()->RemoveOptimizedFunction(this); | 6590 context()->native_context()->RemoveOptimizedFunction(this); |
| 6588 } | 6591 } |
| 6589 } | 6592 } |
| 6590 | 6593 |
| 6594 bool JSFunction::has_feedback_vector() const { |
| 6595 SharedFunctionInfo* shared = this->shared(); |
| 6596 |
| 6597 return (feedback_vector_cell()->value() != |
| 6598 shared->GetIsolate()->heap()->empty_type_feedback_vector() || |
| 6599 (shared->feedback_metadata()->slot_count() == 0 && |
| 6600 shared->num_literals() == 0)); |
| 6601 } |
| 6591 | 6602 |
| 6592 Context* JSFunction::context() { | 6603 Context* JSFunction::context() { |
| 6593 return Context::cast(READ_FIELD(this, kContextOffset)); | 6604 return Context::cast(READ_FIELD(this, kContextOffset)); |
| 6594 } | 6605 } |
| 6595 | 6606 |
| 6596 | 6607 |
| 6597 JSObject* JSFunction::global_proxy() { | 6608 JSObject* JSFunction::global_proxy() { |
| 6598 return context()->global_proxy(); | 6609 return context()->global_proxy(); |
| 6599 } | 6610 } |
| 6600 | 6611 |
| (...skipping 1775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8376 #undef WRITE_INT64_FIELD | 8387 #undef WRITE_INT64_FIELD |
| 8377 #undef READ_BYTE_FIELD | 8388 #undef READ_BYTE_FIELD |
| 8378 #undef WRITE_BYTE_FIELD | 8389 #undef WRITE_BYTE_FIELD |
| 8379 #undef NOBARRIER_READ_BYTE_FIELD | 8390 #undef NOBARRIER_READ_BYTE_FIELD |
| 8380 #undef NOBARRIER_WRITE_BYTE_FIELD | 8391 #undef NOBARRIER_WRITE_BYTE_FIELD |
| 8381 | 8392 |
| 8382 } // namespace internal | 8393 } // namespace internal |
| 8383 } // namespace v8 | 8394 } // namespace v8 |
| 8384 | 8395 |
| 8385 #endif // V8_OBJECTS_INL_H_ | 8396 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |