Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1865)

Side by Side Diff: src/objects-inl.h

Issue 2674593003: [TypeFeedbackVector] Root feedback vectors at function literal site. (Closed)
Patch Set: REBASE+liveedit fix. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/objects.cc ('k') | src/objects-printer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 5636 matching lines...) Expand 10 before | Expand all | Expand 10 after
5647 map->unused_property_fields()); 5647 map->unused_property_fields());
5648 } 5648 }
5649 5649
5650 5650
5651 ACCESSORS(JSBoundFunction, bound_target_function, JSReceiver, 5651 ACCESSORS(JSBoundFunction, bound_target_function, JSReceiver,
5652 kBoundTargetFunctionOffset) 5652 kBoundTargetFunctionOffset)
5653 ACCESSORS(JSBoundFunction, bound_this, Object, kBoundThisOffset) 5653 ACCESSORS(JSBoundFunction, bound_this, Object, kBoundThisOffset)
5654 ACCESSORS(JSBoundFunction, bound_arguments, FixedArray, kBoundArgumentsOffset) 5654 ACCESSORS(JSBoundFunction, bound_arguments, FixedArray, kBoundArgumentsOffset)
5655 5655
5656 ACCESSORS(JSFunction, shared, SharedFunctionInfo, kSharedFunctionInfoOffset) 5656 ACCESSORS(JSFunction, shared, SharedFunctionInfo, kSharedFunctionInfoOffset)
5657 ACCESSORS(JSFunction, feedback_vector, TypeFeedbackVector, 5657 ACCESSORS(JSFunction, feedback_vector_cell, Cell, kFeedbackVectorOffset)
5658 kFeedbackVectorOffset)
5659 ACCESSORS(JSFunction, next_function_link, Object, kNextFunctionLinkOffset) 5658 ACCESSORS(JSFunction, next_function_link, Object, kNextFunctionLinkOffset)
5660 5659
5661 ACCESSORS(JSGlobalObject, native_context, Context, kNativeContextOffset) 5660 ACCESSORS(JSGlobalObject, native_context, Context, kNativeContextOffset)
5662 ACCESSORS(JSGlobalObject, global_proxy, JSObject, kGlobalProxyOffset) 5661 ACCESSORS(JSGlobalObject, global_proxy, JSObject, kGlobalProxyOffset)
5663 5662
5664 ACCESSORS(JSGlobalProxy, native_context, Object, kNativeContextOffset) 5663 ACCESSORS(JSGlobalProxy, native_context, Object, kNativeContextOffset)
5665 ACCESSORS(JSGlobalProxy, hash, Object, kHashOffset) 5664 ACCESSORS(JSGlobalProxy, hash, Object, kHashOffset)
5666 5665
5667 ACCESSORS(AccessorInfo, name, Object, kNameOffset) 5666 ACCESSORS(AccessorInfo, name, Object, kNameOffset)
5668 SMI_ACCESSORS(AccessorInfo, flag, kFlagOffset) 5667 SMI_ACCESSORS(AccessorInfo, flag, kFlagOffset)
(...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after
6473 } 6472 }
6474 6473
6475 bool SharedFunctionInfo::IsSubjectToDebugging() { 6474 bool SharedFunctionInfo::IsSubjectToDebugging() {
6476 return IsUserJavaScript() && !HasAsmWasmData(); 6475 return IsUserJavaScript() && !HasAsmWasmData();
6477 } 6476 }
6478 6477
6479 bool SharedFunctionInfo::OptimizedCodeMapIsCleared() const { 6478 bool SharedFunctionInfo::OptimizedCodeMapIsCleared() const {
6480 return optimized_code_map() == GetHeap()->empty_fixed_array(); 6479 return optimized_code_map() == GetHeap()->empty_fixed_array();
6481 } 6480 }
6482 6481
6482 TypeFeedbackVector* JSFunction::feedback_vector() const {
6483 DCHECK(feedback_vector_cell()->value()->IsTypeFeedbackVector());
6484 return TypeFeedbackVector::cast(feedback_vector_cell()->value());
6485 }
6483 6486
6484 bool JSFunction::IsOptimized() { 6487 bool JSFunction::IsOptimized() {
6485 return code()->kind() == Code::OPTIMIZED_FUNCTION; 6488 return code()->kind() == Code::OPTIMIZED_FUNCTION;
6486 } 6489 }
6487 6490
6488 bool JSFunction::IsInterpreted() { 6491 bool JSFunction::IsInterpreted() {
6489 return code()->is_interpreter_trampoline_builtin(); 6492 return code()->is_interpreter_trampoline_builtin();
6490 } 6493 }
6491 6494
6492 bool JSFunction::IsMarkedForBaseline() { 6495 bool JSFunction::IsMarkedForBaseline() {
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
6580 // context based on the state change. 6583 // context based on the state change.
6581 if (!was_optimized && is_optimized) { 6584 if (!was_optimized && is_optimized) {
6582 context()->native_context()->AddOptimizedFunction(this); 6585 context()->native_context()->AddOptimizedFunction(this);
6583 } 6586 }
6584 if (was_optimized && !is_optimized) { 6587 if (was_optimized && !is_optimized) {
6585 // TODO(titzer): linear in the number of optimized functions; fix! 6588 // TODO(titzer): linear in the number of optimized functions; fix!
6586 context()->native_context()->RemoveOptimizedFunction(this); 6589 context()->native_context()->RemoveOptimizedFunction(this);
6587 } 6590 }
6588 } 6591 }
6589 6592
6593 bool JSFunction::has_feedback_vector() const {
6594 SharedFunctionInfo* shared = this->shared();
6595
6596 return (feedback_vector_cell()->value() !=
6597 shared->GetIsolate()->heap()->empty_type_feedback_vector() ||
6598 (shared->feedback_metadata()->slot_count() == 0 &&
6599 shared->num_literals() == 0));
6600 }
6590 6601
6591 Context* JSFunction::context() { 6602 Context* JSFunction::context() {
6592 return Context::cast(READ_FIELD(this, kContextOffset)); 6603 return Context::cast(READ_FIELD(this, kContextOffset));
6593 } 6604 }
6594 6605
6595 6606
6596 JSObject* JSFunction::global_proxy() { 6607 JSObject* JSFunction::global_proxy() {
6597 return context()->global_proxy(); 6608 return context()->global_proxy();
6598 } 6609 }
6599 6610
(...skipping 1775 matching lines...) Expand 10 before | Expand all | Expand 10 after
8375 #undef WRITE_INT64_FIELD 8386 #undef WRITE_INT64_FIELD
8376 #undef READ_BYTE_FIELD 8387 #undef READ_BYTE_FIELD
8377 #undef WRITE_BYTE_FIELD 8388 #undef WRITE_BYTE_FIELD
8378 #undef NOBARRIER_READ_BYTE_FIELD 8389 #undef NOBARRIER_READ_BYTE_FIELD
8379 #undef NOBARRIER_WRITE_BYTE_FIELD 8390 #undef NOBARRIER_WRITE_BYTE_FIELD
8380 8391
8381 } // namespace internal 8392 } // namespace internal
8382 } // namespace v8 8393 } // namespace v8
8383 8394
8384 #endif // V8_OBJECTS_INL_H_ 8395 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/objects-printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698