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 6247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6258 DCHECK(code()->gc_metadata() == NULL && value->gc_metadata() == NULL); | 6258 DCHECK(code()->gc_metadata() == NULL && value->gc_metadata() == NULL); |
6259 #ifdef DEBUG | 6259 #ifdef DEBUG |
6260 Code::VerifyRecompiledCode(code(), value); | 6260 Code::VerifyRecompiledCode(code(), value); |
6261 #endif // DEBUG | 6261 #endif // DEBUG |
6262 | 6262 |
6263 set_code(value); | 6263 set_code(value); |
6264 | 6264 |
6265 if (is_compiled()) set_never_compiled(false); | 6265 if (is_compiled()) set_never_compiled(false); |
6266 } | 6266 } |
6267 | 6267 |
| 6268 bool SharedFunctionInfo::IsInterpreted() const { |
| 6269 return code()->is_interpreter_trampoline_builtin(); |
| 6270 } |
| 6271 |
6268 bool SharedFunctionInfo::HasBaselineCode() const { | 6272 bool SharedFunctionInfo::HasBaselineCode() const { |
6269 return code()->kind() == Code::FUNCTION; | 6273 return code()->kind() == Code::FUNCTION; |
6270 } | 6274 } |
6271 | 6275 |
6272 ScopeInfo* SharedFunctionInfo::scope_info() const { | 6276 ScopeInfo* SharedFunctionInfo::scope_info() const { |
6273 return reinterpret_cast<ScopeInfo*>(READ_FIELD(this, kScopeInfoOffset)); | 6277 return reinterpret_cast<ScopeInfo*>(READ_FIELD(this, kScopeInfoOffset)); |
6274 } | 6278 } |
6275 | 6279 |
6276 | 6280 |
6277 void SharedFunctionInfo::set_scope_info(ScopeInfo* value, | 6281 void SharedFunctionInfo::set_scope_info(ScopeInfo* value, |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6499 | 6503 |
6500 bool SharedFunctionInfo::OptimizedCodeMapIsCleared() const { | 6504 bool SharedFunctionInfo::OptimizedCodeMapIsCleared() const { |
6501 return optimized_code_map() == GetHeap()->empty_fixed_array(); | 6505 return optimized_code_map() == GetHeap()->empty_fixed_array(); |
6502 } | 6506 } |
6503 | 6507 |
6504 | 6508 |
6505 bool JSFunction::IsOptimized() { | 6509 bool JSFunction::IsOptimized() { |
6506 return code()->kind() == Code::OPTIMIZED_FUNCTION; | 6510 return code()->kind() == Code::OPTIMIZED_FUNCTION; |
6507 } | 6511 } |
6508 | 6512 |
| 6513 bool JSFunction::IsInterpreted() { |
| 6514 return code()->is_interpreter_trampoline_builtin(); |
| 6515 } |
| 6516 |
6509 bool JSFunction::IsMarkedForBaseline() { | 6517 bool JSFunction::IsMarkedForBaseline() { |
6510 return code() == | 6518 return code() == |
6511 GetIsolate()->builtins()->builtin(Builtins::kCompileBaseline); | 6519 GetIsolate()->builtins()->builtin(Builtins::kCompileBaseline); |
6512 } | 6520 } |
6513 | 6521 |
6514 bool JSFunction::IsMarkedForOptimization() { | 6522 bool JSFunction::IsMarkedForOptimization() { |
6515 return code() == GetIsolate()->builtins()->builtin( | 6523 return code() == GetIsolate()->builtins()->builtin( |
6516 Builtins::kCompileOptimized); | 6524 Builtins::kCompileOptimized); |
6517 } | 6525 } |
6518 | 6526 |
(...skipping 25 matching lines...) Expand all Loading... |
6544 void Map::InobjectSlackTrackingStep() { | 6552 void Map::InobjectSlackTrackingStep() { |
6545 if (!IsInobjectSlackTrackingInProgress()) return; | 6553 if (!IsInobjectSlackTrackingInProgress()) return; |
6546 int counter = construction_counter(); | 6554 int counter = construction_counter(); |
6547 set_construction_counter(counter - 1); | 6555 set_construction_counter(counter - 1); |
6548 if (counter == kSlackTrackingCounterEnd) { | 6556 if (counter == kSlackTrackingCounterEnd) { |
6549 CompleteInobjectSlackTracking(); | 6557 CompleteInobjectSlackTracking(); |
6550 } | 6558 } |
6551 } | 6559 } |
6552 | 6560 |
6553 AbstractCode* JSFunction::abstract_code() { | 6561 AbstractCode* JSFunction::abstract_code() { |
6554 Code* code = this->code(); | 6562 if (IsInterpreted()) { |
6555 if (code->is_interpreter_trampoline_builtin()) { | |
6556 return AbstractCode::cast(shared()->bytecode_array()); | 6563 return AbstractCode::cast(shared()->bytecode_array()); |
6557 } else { | 6564 } else { |
6558 return AbstractCode::cast(code); | 6565 return AbstractCode::cast(code()); |
6559 } | 6566 } |
6560 } | 6567 } |
6561 | 6568 |
6562 Code* JSFunction::code() { | 6569 Code* JSFunction::code() { |
6563 return Code::cast( | 6570 return Code::cast( |
6564 Code::GetObjectFromEntryAddress(FIELD_ADDR(this, kCodeEntryOffset))); | 6571 Code::GetObjectFromEntryAddress(FIELD_ADDR(this, kCodeEntryOffset))); |
6565 } | 6572 } |
6566 | 6573 |
6567 | 6574 |
6568 void JSFunction::set_code(Code* value) { | 6575 void JSFunction::set_code(Code* value) { |
(...skipping 1855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8424 #undef WRITE_INT64_FIELD | 8431 #undef WRITE_INT64_FIELD |
8425 #undef READ_BYTE_FIELD | 8432 #undef READ_BYTE_FIELD |
8426 #undef WRITE_BYTE_FIELD | 8433 #undef WRITE_BYTE_FIELD |
8427 #undef NOBARRIER_READ_BYTE_FIELD | 8434 #undef NOBARRIER_READ_BYTE_FIELD |
8428 #undef NOBARRIER_WRITE_BYTE_FIELD | 8435 #undef NOBARRIER_WRITE_BYTE_FIELD |
8429 | 8436 |
8430 } // namespace internal | 8437 } // namespace internal |
8431 } // namespace v8 | 8438 } // namespace v8 |
8432 | 8439 |
8433 #endif // V8_OBJECTS_INL_H_ | 8440 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |