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 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1136 } else if (FLAG_track_heap_object_fields && representation.IsHeapObject()) { | 1136 } else if (FLAG_track_heap_object_fields && representation.IsHeapObject()) { |
1137 return IsHeapObject(); | 1137 return IsHeapObject(); |
1138 } | 1138 } |
1139 return true; | 1139 return true; |
1140 } | 1140 } |
1141 | 1141 |
1142 | 1142 |
1143 // static | 1143 // static |
1144 MaybeHandle<JSReceiver> Object::ToObject(Isolate* isolate, | 1144 MaybeHandle<JSReceiver> Object::ToObject(Isolate* isolate, |
1145 Handle<Object> object) { | 1145 Handle<Object> object) { |
1146 return ToObject( | 1146 if (object->IsJSReceiver()) return Handle<JSReceiver>::cast(object); |
1147 isolate, object, handle(isolate->context()->native_context(), isolate)); | 1147 return ToObject(isolate, object, isolate->native_context()); |
1148 } | 1148 } |
1149 | 1149 |
1150 | 1150 |
1151 // static | 1151 // static |
1152 MaybeHandle<Object> Object::ToPrimitive(Handle<Object> input, | 1152 MaybeHandle<Object> Object::ToPrimitive(Handle<Object> input, |
1153 ToPrimitiveHint hint) { | 1153 ToPrimitiveHint hint) { |
1154 if (input->IsPrimitive()) return input; | 1154 if (input->IsPrimitive()) return input; |
1155 return JSReceiver::ToPrimitive(Handle<JSReceiver>::cast(input), hint); | 1155 return JSReceiver::ToPrimitive(Handle<JSReceiver>::cast(input), hint); |
1156 } | 1156 } |
1157 | 1157 |
(...skipping 6686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7844 #undef WRITE_INT64_FIELD | 7844 #undef WRITE_INT64_FIELD |
7845 #undef READ_BYTE_FIELD | 7845 #undef READ_BYTE_FIELD |
7846 #undef WRITE_BYTE_FIELD | 7846 #undef WRITE_BYTE_FIELD |
7847 #undef NOBARRIER_READ_BYTE_FIELD | 7847 #undef NOBARRIER_READ_BYTE_FIELD |
7848 #undef NOBARRIER_WRITE_BYTE_FIELD | 7848 #undef NOBARRIER_WRITE_BYTE_FIELD |
7849 | 7849 |
7850 } // namespace internal | 7850 } // namespace internal |
7851 } // namespace v8 | 7851 } // namespace v8 |
7852 | 7852 |
7853 #endif // V8_OBJECTS_INL_H_ | 7853 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |