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

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

Issue 2681773004: [FeedbackVector] Clarify the way the feedback vector is installed. (Closed)
Patch Set: Code comments+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/runtime/runtime-interpreter.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 6578 matching lines...) Expand 10 before | Expand all | Expand 10 after
6589 if (was_optimized && !is_optimized) { 6589 if (was_optimized && !is_optimized) {
6590 // TODO(titzer): linear in the number of optimized functions; fix! 6590 // TODO(titzer): linear in the number of optimized functions; fix!
6591 context()->native_context()->RemoveOptimizedFunction(this); 6591 context()->native_context()->RemoveOptimizedFunction(this);
6592 } 6592 }
6593 } 6593 }
6594 6594
6595 bool JSFunction::has_feedback_vector() const { 6595 bool JSFunction::has_feedback_vector() const {
6596 return !feedback_vector_cell()->value()->IsUndefined(GetIsolate()); 6596 return !feedback_vector_cell()->value()->IsUndefined(GetIsolate());
6597 } 6597 }
6598 6598
6599 JSFunction::FeedbackVectorState JSFunction::GetFeedbackVectorState(
6600 Isolate* isolate) const {
6601 Cell* cell = feedback_vector_cell();
6602 if (cell == isolate->heap()->undefined_cell()) {
6603 return TOP_LEVEL_SCRIPT_NEEDS_VECTOR;
6604 } else if (cell->value() == isolate->heap()->undefined_value() ||
6605 !has_feedback_vector()) {
6606 return NEEDS_VECTOR;
6607 }
6608 return HAS_VECTOR;
6609 }
6610
6599 Context* JSFunction::context() { 6611 Context* JSFunction::context() {
6600 return Context::cast(READ_FIELD(this, kContextOffset)); 6612 return Context::cast(READ_FIELD(this, kContextOffset));
6601 } 6613 }
6602 6614
6603 6615
6604 JSObject* JSFunction::global_proxy() { 6616 JSObject* JSFunction::global_proxy() {
6605 return context()->global_proxy(); 6617 return context()->global_proxy();
6606 } 6618 }
6607 6619
6608 6620
(...skipping 1774 matching lines...) Expand 10 before | Expand all | Expand 10 after
8383 #undef WRITE_INT64_FIELD 8395 #undef WRITE_INT64_FIELD
8384 #undef READ_BYTE_FIELD 8396 #undef READ_BYTE_FIELD
8385 #undef WRITE_BYTE_FIELD 8397 #undef WRITE_BYTE_FIELD
8386 #undef NOBARRIER_READ_BYTE_FIELD 8398 #undef NOBARRIER_READ_BYTE_FIELD
8387 #undef NOBARRIER_WRITE_BYTE_FIELD 8399 #undef NOBARRIER_WRITE_BYTE_FIELD
8388 8400
8389 } // namespace internal 8401 } // namespace internal
8390 } // namespace v8 8402 } // namespace v8
8391 8403
8392 #endif // V8_OBJECTS_INL_H_ 8404 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/runtime/runtime-interpreter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698