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 5400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5411 code()->set_optimizable(true); | 5411 code()->set_optimizable(true); |
5412 } | 5412 } |
5413 } | 5413 } |
5414 | 5414 |
5415 | 5415 |
5416 bool JSFunction::IsBuiltin() { | 5416 bool JSFunction::IsBuiltin() { |
5417 return context()->global_object()->IsJSBuiltinsObject(); | 5417 return context()->global_object()->IsJSBuiltinsObject(); |
5418 } | 5418 } |
5419 | 5419 |
5420 | 5420 |
| 5421 bool JSFunction::IsNative() { |
| 5422 Object* script = shared()->script(); |
| 5423 bool native = script->IsScript() && |
| 5424 Script::cast(script)->type()->value() == Script::TYPE_NATIVE; |
| 5425 ASSERT(!IsBuiltin() || native); // All builtins are also native. |
| 5426 return native; |
| 5427 } |
| 5428 |
| 5429 |
5421 bool JSFunction::NeedsArgumentsAdaption() { | 5430 bool JSFunction::NeedsArgumentsAdaption() { |
5422 return shared()->formal_parameter_count() != | 5431 return shared()->formal_parameter_count() != |
5423 SharedFunctionInfo::kDontAdaptArgumentsSentinel; | 5432 SharedFunctionInfo::kDontAdaptArgumentsSentinel; |
5424 } | 5433 } |
5425 | 5434 |
5426 | 5435 |
5427 bool JSFunction::IsOptimized() { | 5436 bool JSFunction::IsOptimized() { |
5428 return code()->kind() == Code::OPTIMIZED_FUNCTION; | 5437 return code()->kind() == Code::OPTIMIZED_FUNCTION; |
5429 } | 5438 } |
5430 | 5439 |
(...skipping 1414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6845 #undef READ_SHORT_FIELD | 6854 #undef READ_SHORT_FIELD |
6846 #undef WRITE_SHORT_FIELD | 6855 #undef WRITE_SHORT_FIELD |
6847 #undef READ_BYTE_FIELD | 6856 #undef READ_BYTE_FIELD |
6848 #undef WRITE_BYTE_FIELD | 6857 #undef WRITE_BYTE_FIELD |
6849 #undef NOBARRIER_READ_BYTE_FIELD | 6858 #undef NOBARRIER_READ_BYTE_FIELD |
6850 #undef NOBARRIER_WRITE_BYTE_FIELD | 6859 #undef NOBARRIER_WRITE_BYTE_FIELD |
6851 | 6860 |
6852 } } // namespace v8::internal | 6861 } } // namespace v8::internal |
6853 | 6862 |
6854 #endif // V8_OBJECTS_INL_H_ | 6863 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |