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

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

Issue 2481433002: [Interpreter] Add IsInterpreted() to JSFunction and use to fix test-heap tests. (Closed)
Patch Set: Fix always-opt Created 4 years, 1 month 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
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 6249 matching lines...) Expand 10 before | Expand all | Expand 10 after
6260 DCHECK(code()->gc_metadata() == NULL && value->gc_metadata() == NULL); 6260 DCHECK(code()->gc_metadata() == NULL && value->gc_metadata() == NULL);
6261 #ifdef DEBUG 6261 #ifdef DEBUG
6262 Code::VerifyRecompiledCode(code(), value); 6262 Code::VerifyRecompiledCode(code(), value);
6263 #endif // DEBUG 6263 #endif // DEBUG
6264 6264
6265 set_code(value); 6265 set_code(value);
6266 6266
6267 if (is_compiled()) set_never_compiled(false); 6267 if (is_compiled()) set_never_compiled(false);
6268 } 6268 }
6269 6269
6270 bool SharedFunctionInfo::IsInterpreted() const {
6271 return code()->is_interpreter_trampoline_builtin();
6272 }
6273
6270 bool SharedFunctionInfo::HasBaselineCode() const { 6274 bool SharedFunctionInfo::HasBaselineCode() const {
6271 return code()->kind() == Code::FUNCTION; 6275 return code()->kind() == Code::FUNCTION;
6272 } 6276 }
6273 6277
6274 ScopeInfo* SharedFunctionInfo::scope_info() const { 6278 ScopeInfo* SharedFunctionInfo::scope_info() const {
6275 return reinterpret_cast<ScopeInfo*>(READ_FIELD(this, kScopeInfoOffset)); 6279 return reinterpret_cast<ScopeInfo*>(READ_FIELD(this, kScopeInfoOffset));
6276 } 6280 }
6277 6281
6278 6282
6279 void SharedFunctionInfo::set_scope_info(ScopeInfo* value, 6283 void SharedFunctionInfo::set_scope_info(ScopeInfo* value,
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
6501 6505
6502 bool SharedFunctionInfo::OptimizedCodeMapIsCleared() const { 6506 bool SharedFunctionInfo::OptimizedCodeMapIsCleared() const {
6503 return optimized_code_map() == GetHeap()->empty_fixed_array(); 6507 return optimized_code_map() == GetHeap()->empty_fixed_array();
6504 } 6508 }
6505 6509
6506 6510
6507 bool JSFunction::IsOptimized() { 6511 bool JSFunction::IsOptimized() {
6508 return code()->kind() == Code::OPTIMIZED_FUNCTION; 6512 return code()->kind() == Code::OPTIMIZED_FUNCTION;
6509 } 6513 }
6510 6514
6515 bool JSFunction::IsInterpreted() {
6516 return code()->is_interpreter_trampoline_builtin();
6517 }
6518
6511 bool JSFunction::IsMarkedForBaseline() { 6519 bool JSFunction::IsMarkedForBaseline() {
6512 return code() == 6520 return code() ==
6513 GetIsolate()->builtins()->builtin(Builtins::kCompileBaseline); 6521 GetIsolate()->builtins()->builtin(Builtins::kCompileBaseline);
6514 } 6522 }
6515 6523
6516 bool JSFunction::IsMarkedForOptimization() { 6524 bool JSFunction::IsMarkedForOptimization() {
6517 return code() == GetIsolate()->builtins()->builtin( 6525 return code() == GetIsolate()->builtins()->builtin(
6518 Builtins::kCompileOptimized); 6526 Builtins::kCompileOptimized);
6519 } 6527 }
6520 6528
(...skipping 25 matching lines...) Expand all
6546 void Map::InobjectSlackTrackingStep() { 6554 void Map::InobjectSlackTrackingStep() {
6547 if (!IsInobjectSlackTrackingInProgress()) return; 6555 if (!IsInobjectSlackTrackingInProgress()) return;
6548 int counter = construction_counter(); 6556 int counter = construction_counter();
6549 set_construction_counter(counter - 1); 6557 set_construction_counter(counter - 1);
6550 if (counter == kSlackTrackingCounterEnd) { 6558 if (counter == kSlackTrackingCounterEnd) {
6551 CompleteInobjectSlackTracking(); 6559 CompleteInobjectSlackTracking();
6552 } 6560 }
6553 } 6561 }
6554 6562
6555 AbstractCode* JSFunction::abstract_code() { 6563 AbstractCode* JSFunction::abstract_code() {
6556 Code* code = this->code(); 6564 if (IsInterpreted()) {
6557 if (code->is_interpreter_trampoline_builtin()) {
6558 return AbstractCode::cast(shared()->bytecode_array()); 6565 return AbstractCode::cast(shared()->bytecode_array());
6559 } else { 6566 } else {
6560 return AbstractCode::cast(code); 6567 return AbstractCode::cast(code());
6561 } 6568 }
6562 } 6569 }
6563 6570
6564 Code* JSFunction::code() { 6571 Code* JSFunction::code() {
6565 return Code::cast( 6572 return Code::cast(
6566 Code::GetObjectFromEntryAddress(FIELD_ADDR(this, kCodeEntryOffset))); 6573 Code::GetObjectFromEntryAddress(FIELD_ADDR(this, kCodeEntryOffset)));
6567 } 6574 }
6568 6575
6569 6576
6570 void JSFunction::set_code(Code* value) { 6577 void JSFunction::set_code(Code* value) {
(...skipping 1860 matching lines...) Expand 10 before | Expand all | Expand 10 after
8431 #undef WRITE_INT64_FIELD 8438 #undef WRITE_INT64_FIELD
8432 #undef READ_BYTE_FIELD 8439 #undef READ_BYTE_FIELD
8433 #undef WRITE_BYTE_FIELD 8440 #undef WRITE_BYTE_FIELD
8434 #undef NOBARRIER_READ_BYTE_FIELD 8441 #undef NOBARRIER_READ_BYTE_FIELD
8435 #undef NOBARRIER_WRITE_BYTE_FIELD 8442 #undef NOBARRIER_WRITE_BYTE_FIELD
8436 8443
8437 } // namespace internal 8444 } // namespace internal
8438 } // namespace v8 8445 } // namespace v8
8439 8446
8440 #endif // V8_OBJECTS_INL_H_ 8447 #endif // V8_OBJECTS_INL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698