Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(125)

Side by Side Diff: src/builtins/builtins-array.cc

Issue 2131383002: [builtins] take slow path in IsConcatSpreadable if proxy in prototype (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebased Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/isolate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | src/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698