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

Side by Side Diff: src/builtins.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: Refactor 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') | test/mjsunit/es6/array-concat.js » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "src/builtins.h" 5 #include "src/builtins.h"
6 6
7 #include "src/api-arguments.h" 7 #include "src/api-arguments.h"
8 #include "src/api-natives.h" 8 #include "src/api-natives.h"
9 #include "src/api.h" 9 #include "src/api.h"
10 #include "src/base/ieee754.h" 10 #include "src/base/ieee754.h"
(...skipping 1165 matching lines...) Expand 10 before | Expand all | Expand 10 after
1176 UNREACHABLE(); 1176 UNREACHABLE();
1177 break; 1177 break;
1178 } 1178 }
1179 visitor->increase_index_offset(length); 1179 visitor->increase_index_offset(length);
1180 return true; 1180 return true;
1181 } 1181 }
1182 1182
1183 static Maybe<bool> IsConcatSpreadable(Isolate* isolate, Handle<Object> obj) { 1183 static Maybe<bool> IsConcatSpreadable(Isolate* isolate, Handle<Object> obj) {
1184 HandleScope handle_scope(isolate); 1184 HandleScope handle_scope(isolate);
1185 if (!obj->IsJSReceiver()) return Just(false); 1185 if (!obj->IsJSReceiver()) return Just(false);
1186 if (!isolate->IsIsConcatSpreadableLookupChainIntact()) { 1186 if (!isolate->IsIsConcatSpreadableLookupChainIntact(JSReceiver::cast(*obj))) {
1187 // Slow path if @@isConcatSpreadable has been used. 1187 // Slow path if @@isConcatSpreadable has been used.
1188 Handle<Symbol> key(isolate->factory()->is_concat_spreadable_symbol()); 1188 Handle<Symbol> key(isolate->factory()->is_concat_spreadable_symbol());
1189 Handle<Object> value; 1189 Handle<Object> value;
1190 MaybeHandle<Object> maybeValue = 1190 MaybeHandle<Object> maybeValue =
1191 i::Runtime::GetObjectProperty(isolate, obj, key); 1191 i::Runtime::GetObjectProperty(isolate, obj, key);
1192 if (!maybeValue.ToHandle(&value)) return Nothing<bool>(); 1192 if (!maybeValue.ToHandle(&value)) return Nothing<bool>();
1193 if (!value->IsUndefined(isolate)) return Just(value->BooleanValue()); 1193 if (!value->IsUndefined(isolate)) return Just(value->BooleanValue());
1194 } 1194 }
1195 return Object::IsArray(obj); 1195 return Object::IsArray(obj);
1196 } 1196 }
(...skipping 5540 matching lines...) Expand 10 before | Expand all | Expand 10 after
6737 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) 6737 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H)
6738 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) 6738 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A)
6739 #undef DEFINE_BUILTIN_ACCESSOR_C 6739 #undef DEFINE_BUILTIN_ACCESSOR_C
6740 #undef DEFINE_BUILTIN_ACCESSOR_A 6740 #undef DEFINE_BUILTIN_ACCESSOR_A
6741 #undef DEFINE_BUILTIN_ACCESSOR_T 6741 #undef DEFINE_BUILTIN_ACCESSOR_T
6742 #undef DEFINE_BUILTIN_ACCESSOR_S 6742 #undef DEFINE_BUILTIN_ACCESSOR_S
6743 #undef DEFINE_BUILTIN_ACCESSOR_H 6743 #undef DEFINE_BUILTIN_ACCESSOR_H
6744 6744
6745 } // namespace internal 6745 } // namespace internal
6746 } // namespace v8 6746 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/isolate.h » ('j') | test/mjsunit/es6/array-concat.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698