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

Side by Side Diff: src/lookup.h

Issue 1409123003: [runtime] Avoid @@isConcatSpreadable lookup for fast path Array.prototype.concat (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: merging with master Created 4 years, 7 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 | « src/isolate-inl.h ('k') | src/lookup.cc » ('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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 #ifndef V8_LOOKUP_H_ 5 #ifndef V8_LOOKUP_H_
6 #define V8_LOOKUP_H_ 6 #define V8_LOOKUP_H_
7 7
8 #include "src/factory.h" 8 #include "src/factory.h"
9 #include "src/isolate.h" 9 #include "src/isolate.h"
10 #include "src/objects.h" 10 #include "src/objects.h"
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 inline Handle<InterceptorInfo> GetInterceptor() const { 256 inline Handle<InterceptorInfo> GetInterceptor() const {
257 DCHECK_EQ(INTERCEPTOR, state_); 257 DCHECK_EQ(INTERCEPTOR, state_);
258 InterceptorInfo* result = 258 InterceptorInfo* result =
259 IsElement() ? GetInterceptor<true>(JSObject::cast(*holder_)) 259 IsElement() ? GetInterceptor<true>(JSObject::cast(*holder_))
260 : GetInterceptor<false>(JSObject::cast(*holder_)); 260 : GetInterceptor<false>(JSObject::cast(*holder_));
261 return handle(result, isolate_); 261 return handle(result, isolate_);
262 } 262 }
263 Handle<Object> GetDataValue() const; 263 Handle<Object> GetDataValue() const;
264 void WriteDataValue(Handle<Object> value); 264 void WriteDataValue(Handle<Object> value);
265 inline void UpdateProtector() { 265 inline void UpdateProtector() {
266 if (FLAG_harmony_species && !IsElement() && 266 if (IsElement()) return;
267 (*name_ == heap()->constructor_string() || 267 if (*name_ == heap()->is_concat_spreadable_symbol() ||
268 *name_ == heap()->species_symbol())) { 268 (FLAG_harmony_species && (*name_ == heap()->constructor_string() ||
269 *name_ == heap()->species_symbol()))) {
269 InternalUpdateProtector(); 270 InternalUpdateProtector();
270 } 271 }
271 } 272 }
272 273
273 private: 274 private:
274 void InternalUpdateProtector(); 275 void InternalUpdateProtector();
275 276
276 enum class InterceptorState { 277 enum class InterceptorState {
277 kUninitialized, 278 kUninitialized,
278 kSkipNonMasking, 279 kSkipNonMasking,
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 Isolate* isolate, Handle<Object> receiver, uint32_t index = kMaxUInt32); 347 Isolate* isolate, Handle<Object> receiver, uint32_t index = kMaxUInt32);
347 inline static Handle<JSReceiver> GetRoot(Isolate* isolate, 348 inline static Handle<JSReceiver> GetRoot(Isolate* isolate,
348 Handle<Object> receiver, 349 Handle<Object> receiver,
349 uint32_t index = kMaxUInt32) { 350 uint32_t index = kMaxUInt32) {
350 if (receiver->IsJSReceiver()) return Handle<JSReceiver>::cast(receiver); 351 if (receiver->IsJSReceiver()) return Handle<JSReceiver>::cast(receiver);
351 return GetRootForNonJSReceiver(isolate, receiver, index); 352 return GetRootForNonJSReceiver(isolate, receiver, index);
352 } 353 }
353 354
354 State NotFound(JSReceiver* const holder) const; 355 State NotFound(JSReceiver* const holder) const;
355 356
356 bool HolderIsInContextIndex(uint32_t index) const;
357
358 // If configuration_ becomes mutable, update 357 // If configuration_ becomes mutable, update
359 // HolderIsReceiverOrHiddenPrototype. 358 // HolderIsReceiverOrHiddenPrototype.
360 const Configuration configuration_; 359 const Configuration configuration_;
361 State state_; 360 State state_;
362 bool has_property_; 361 bool has_property_;
363 InterceptorState interceptor_state_; 362 InterceptorState interceptor_state_;
364 PropertyDetails property_details_; 363 PropertyDetails property_details_;
365 Isolate* const isolate_; 364 Isolate* const isolate_;
366 Handle<Name> name_; 365 Handle<Name> name_;
367 Handle<Object> transition_; 366 Handle<Object> transition_;
368 const Handle<Object> receiver_; 367 const Handle<Object> receiver_;
369 Handle<JSReceiver> holder_; 368 Handle<JSReceiver> holder_;
370 const Handle<JSReceiver> initial_holder_; 369 const Handle<JSReceiver> initial_holder_;
371 const uint32_t index_; 370 const uint32_t index_;
372 uint32_t number_; 371 uint32_t number_;
373 }; 372 };
374 373
375 374
376 } // namespace internal 375 } // namespace internal
377 } // namespace v8 376 } // namespace v8
378 377
379 #endif // V8_LOOKUP_H_ 378 #endif // V8_LOOKUP_H_
OLDNEW
« no previous file with comments | « src/isolate-inl.h ('k') | src/lookup.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698