| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 #include "src/builtins/builtins.h" | 5 #include "src/builtins/builtins.h" |
| 6 #include "src/builtins/builtins-utils.h" | 6 #include "src/builtins/builtins-utils.h" |
| 7 #include "src/elements.h" | 7 #include "src/elements.h" |
| 8 | 8 |
| 9 namespace v8 { | 9 namespace v8 { |
| 10 namespace internal { | 10 namespace internal { |
| (...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 931 UNREACHABLE(); | 931 UNREACHABLE(); |
| 932 break; | 932 break; |
| 933 } | 933 } |
| 934 visitor->increase_index_offset(length); | 934 visitor->increase_index_offset(length); |
| 935 return true; | 935 return true; |
| 936 } | 936 } |
| 937 | 937 |
| 938 static Maybe<bool> IsConcatSpreadable(Isolate* isolate, Handle<Object> obj) { | 938 static Maybe<bool> IsConcatSpreadable(Isolate* isolate, Handle<Object> obj) { |
| 939 HandleScope handle_scope(isolate); | 939 HandleScope handle_scope(isolate); |
| 940 if (!obj->IsJSReceiver()) return Just(false); | 940 if (!obj->IsJSReceiver()) return Just(false); |
| 941 if (!isolate->IsIsConcatSpreadableLookupChainIntact()) { | 941 if (!isolate->IsIsConcatSpreadableLookupChainIntact(JSReceiver::cast(*obj))) { |
| 942 // Slow path if @@isConcatSpreadable has been used. | 942 // Slow path if @@isConcatSpreadable has been used. |
| 943 Handle<Symbol> key(isolate->factory()->is_concat_spreadable_symbol()); | 943 Handle<Symbol> key(isolate->factory()->is_concat_spreadable_symbol()); |
| 944 Handle<Object> value; | 944 Handle<Object> value; |
| 945 MaybeHandle<Object> maybeValue = | 945 MaybeHandle<Object> maybeValue = |
| 946 i::Runtime::GetObjectProperty(isolate, obj, key); | 946 i::Runtime::GetObjectProperty(isolate, obj, key); |
| 947 if (!maybeValue.ToHandle(&value)) return Nothing<bool>(); | 947 if (!maybeValue.ToHandle(&value)) return Nothing<bool>(); |
| 948 if (!value->IsUndefined(isolate)) return Just(value->BooleanValue()); | 948 if (!value->IsUndefined(isolate)) return Just(value->BooleanValue()); |
| 949 } | 949 } |
| 950 return Object::IsArray(obj); | 950 return Object::IsArray(obj); |
| 951 } | 951 } |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1266 assembler->Bind(&return_false); | 1266 assembler->Bind(&return_false); |
| 1267 assembler->Return(assembler->BooleanConstant(false)); | 1267 assembler->Return(assembler->BooleanConstant(false)); |
| 1268 | 1268 |
| 1269 assembler->Bind(&call_runtime); | 1269 assembler->Bind(&call_runtime); |
| 1270 assembler->Return( | 1270 assembler->Return( |
| 1271 assembler->CallRuntime(Runtime::kArrayIsArray, context, object)); | 1271 assembler->CallRuntime(Runtime::kArrayIsArray, context, object)); |
| 1272 } | 1272 } |
| 1273 | 1273 |
| 1274 } // namespace internal | 1274 } // namespace internal |
| 1275 } // namespace v8 | 1275 } // namespace v8 |
| OLD | NEW |