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

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

Issue 2672363002: Link type feedback vectors to the shared function info. (Closed)
Patch Set: rebase 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/profiler/heap-snapshot-generator.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 6573 matching lines...) Expand 10 before | Expand all | Expand 10 after
6584 if (!was_optimized && is_optimized) { 6584 if (!was_optimized && is_optimized) {
6585 context()->native_context()->AddOptimizedFunction(this); 6585 context()->native_context()->AddOptimizedFunction(this);
6586 } 6586 }
6587 if (was_optimized && !is_optimized) { 6587 if (was_optimized && !is_optimized) {
6588 // TODO(titzer): linear in the number of optimized functions; fix! 6588 // TODO(titzer): linear in the number of optimized functions; fix!
6589 context()->native_context()->RemoveOptimizedFunction(this); 6589 context()->native_context()->RemoveOptimizedFunction(this);
6590 } 6590 }
6591 } 6591 }
6592 6592
6593 bool JSFunction::has_feedback_vector() const { 6593 bool JSFunction::has_feedback_vector() const {
6594 SharedFunctionInfo* shared = this->shared(); 6594 return !feedback_vector_cell()->value()->IsUndefined(GetIsolate());
6595
6596 return (feedback_vector_cell()->value() !=
6597 shared->GetIsolate()->heap()->empty_feedback_vector() ||
6598 (shared->feedback_metadata()->slot_count() == 0 &&
6599 shared->num_literals() == 0));
6600 } 6595 }
6601 6596
6602 Context* JSFunction::context() { 6597 Context* JSFunction::context() {
6603 return Context::cast(READ_FIELD(this, kContextOffset)); 6598 return Context::cast(READ_FIELD(this, kContextOffset));
6604 } 6599 }
6605 6600
6606 6601
6607 JSObject* JSFunction::global_proxy() { 6602 JSObject* JSFunction::global_proxy() {
6608 return context()->global_proxy(); 6603 return context()->global_proxy();
6609 } 6604 }
(...skipping 1776 matching lines...) Expand 10 before | Expand all | Expand 10 after
8386 #undef WRITE_INT64_FIELD 8381 #undef WRITE_INT64_FIELD
8387 #undef READ_BYTE_FIELD 8382 #undef READ_BYTE_FIELD
8388 #undef WRITE_BYTE_FIELD 8383 #undef WRITE_BYTE_FIELD
8389 #undef NOBARRIER_READ_BYTE_FIELD 8384 #undef NOBARRIER_READ_BYTE_FIELD
8390 #undef NOBARRIER_WRITE_BYTE_FIELD 8385 #undef NOBARRIER_WRITE_BYTE_FIELD
8391 8386
8392 } // namespace internal 8387 } // namespace internal
8393 } // namespace v8 8388 } // namespace v8
8394 8389
8395 #endif // V8_OBJECTS_INL_H_ 8390 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/profiler/heap-snapshot-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698