| 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 6203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6214 if (script_obj->IsUndefined()) return true; | 6214 if (script_obj->IsUndefined()) return true; |
| 6215 Script* script = Script::cast(script_obj); | 6215 Script* script = Script::cast(script_obj); |
| 6216 Script::Type type = static_cast<Script::Type>(script->type()); | 6216 Script::Type type = static_cast<Script::Type>(script->type()); |
| 6217 return type != Script::TYPE_NORMAL; | 6217 return type != Script::TYPE_NORMAL; |
| 6218 } | 6218 } |
| 6219 | 6219 |
| 6220 | 6220 |
| 6221 bool SharedFunctionInfo::IsSubjectToDebugging() { return !IsBuiltin(); } | 6221 bool SharedFunctionInfo::IsSubjectToDebugging() { return !IsBuiltin(); } |
| 6222 | 6222 |
| 6223 | 6223 |
| 6224 bool JSFunction::IsBuiltin() { return shared()->IsBuiltin(); } | |
| 6225 | |
| 6226 | |
| 6227 bool JSFunction::IsSubjectToDebugging() { | |
| 6228 return shared()->IsSubjectToDebugging(); | |
| 6229 } | |
| 6230 | |
| 6231 | |
| 6232 bool JSFunction::NeedsArgumentsAdaption() { | |
| 6233 return shared()->internal_formal_parameter_count() != | |
| 6234 SharedFunctionInfo::kDontAdaptArgumentsSentinel; | |
| 6235 } | |
| 6236 | |
| 6237 | |
| 6238 bool JSFunction::IsOptimized() { | 6224 bool JSFunction::IsOptimized() { |
| 6239 return code()->kind() == Code::OPTIMIZED_FUNCTION; | 6225 return code()->kind() == Code::OPTIMIZED_FUNCTION; |
| 6240 } | 6226 } |
| 6241 | 6227 |
| 6242 | 6228 |
| 6243 bool JSFunction::IsMarkedForOptimization() { | 6229 bool JSFunction::IsMarkedForOptimization() { |
| 6244 return code() == GetIsolate()->builtins()->builtin( | 6230 return code() == GetIsolate()->builtins()->builtin( |
| 6245 Builtins::kCompileOptimized); | 6231 Builtins::kCompileOptimized); |
| 6246 } | 6232 } |
| 6247 | 6233 |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6375 | 6361 |
| 6376 | 6362 |
| 6377 bool JSFunction::is_compiled() { | 6363 bool JSFunction::is_compiled() { |
| 6378 Builtins* builtins = GetIsolate()->builtins(); | 6364 Builtins* builtins = GetIsolate()->builtins(); |
| 6379 return code() != builtins->builtin(Builtins::kCompileLazy) && | 6365 return code() != builtins->builtin(Builtins::kCompileLazy) && |
| 6380 code() != builtins->builtin(Builtins::kCompileOptimized) && | 6366 code() != builtins->builtin(Builtins::kCompileOptimized) && |
| 6381 code() != builtins->builtin(Builtins::kCompileOptimizedConcurrent); | 6367 code() != builtins->builtin(Builtins::kCompileOptimizedConcurrent); |
| 6382 } | 6368 } |
| 6383 | 6369 |
| 6384 | 6370 |
| 6385 bool JSFunction::has_simple_parameters() { | |
| 6386 return shared()->has_simple_parameters(); | |
| 6387 } | |
| 6388 | |
| 6389 | |
| 6390 LiteralsArray* JSFunction::literals() { | 6371 LiteralsArray* JSFunction::literals() { |
| 6391 DCHECK(!shared()->bound()); | 6372 DCHECK(!shared()->bound()); |
| 6392 return LiteralsArray::cast(literals_or_bindings()); | 6373 return LiteralsArray::cast(literals_or_bindings()); |
| 6393 } | 6374 } |
| 6394 | 6375 |
| 6395 | 6376 |
| 6396 void JSFunction::set_literals(LiteralsArray* literals) { | 6377 void JSFunction::set_literals(LiteralsArray* literals) { |
| 6397 DCHECK(!shared()->bound()); | 6378 DCHECK(!shared()->bound()); |
| 6398 set_literals_or_bindings(literals); | 6379 set_literals_or_bindings(literals); |
| 6399 } | 6380 } |
| (...skipping 1705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8105 #undef WRITE_INT64_FIELD | 8086 #undef WRITE_INT64_FIELD |
| 8106 #undef READ_BYTE_FIELD | 8087 #undef READ_BYTE_FIELD |
| 8107 #undef WRITE_BYTE_FIELD | 8088 #undef WRITE_BYTE_FIELD |
| 8108 #undef NOBARRIER_READ_BYTE_FIELD | 8089 #undef NOBARRIER_READ_BYTE_FIELD |
| 8109 #undef NOBARRIER_WRITE_BYTE_FIELD | 8090 #undef NOBARRIER_WRITE_BYTE_FIELD |
| 8110 | 8091 |
| 8111 } // namespace internal | 8092 } // namespace internal |
| 8112 } // namespace v8 | 8093 } // namespace v8 |
| 8113 | 8094 |
| 8114 #endif // V8_OBJECTS_INL_H_ | 8095 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |