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

Side by Side Diff: src/ic/handler-compiler.cc

Issue 962613002: add interceptors which do not mask existing properties (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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/api.cc ('k') | src/ic/ic.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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/cpu-profiler.h" 7 #include "src/cpu-profiler.h"
8 #include "src/ic/call-optimization.h" 8 #include "src/ic/call-optimization.h"
9 #include "src/ic/handler-compiler.h" 9 #include "src/ic/handler-compiler.h"
10 #include "src/ic/ic.h" 10 #include "src/ic/ic.h"
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 Handle<Map> receiver_map = map(); 305 Handle<Map> receiver_map = map();
306 inline_followup = call_optimization.is_simple_api_call() && 306 inline_followup = call_optimization.is_simple_api_call() &&
307 call_optimization.IsCompatibleReceiverMap( 307 call_optimization.IsCompatibleReceiverMap(
308 receiver_map, property_holder); 308 receiver_map, property_holder);
309 } 309 }
310 } 310 }
311 } 311 }
312 312
313 Label miss; 313 Label miss;
314 InterceptorVectorSlotPush(receiver()); 314 InterceptorVectorSlotPush(receiver());
315 bool lost_holder_register = false;
316 auto holder_orig = holder();
317 // non masking interceptors must check the entire chain, so temporarily reset
318 // the holder to be that last element for the FrontendHeader call.
319 if (holder()->GetNamedInterceptor()->non_masking()) {
320 DCHECK(!inline_followup);
321 JSObject* last = *holder();
322 PrototypeIterator iter(isolate(), last);
323 while (!iter.IsAtEnd()) {
324 lost_holder_register = true;
325 last = JSObject::cast(iter.GetCurrent());
326 iter.Advance();
327 }
328 auto last_handle = handle(last);
329 set_holder(last_handle);
330 }
315 Register reg = FrontendHeader(receiver(), it->name(), &miss); 331 Register reg = FrontendHeader(receiver(), it->name(), &miss);
332 // Reset the holder so further calculations are correct.
333 set_holder(holder_orig);
334 if (lost_holder_register) {
335 // Reload lost holder register.
336 auto cell = isolate()->factory()->NewWeakCell(holder());
337 __ LoadWeakValue(reg, cell, &miss);
338 }
316 FrontendFooter(it->name(), &miss); 339 FrontendFooter(it->name(), &miss);
317 InterceptorVectorSlotPop(reg); 340 InterceptorVectorSlotPop(reg);
318
319 if (inline_followup) { 341 if (inline_followup) {
320 // TODO(368): Compile in the whole chain: all the interceptors in 342 // TODO(368): Compile in the whole chain: all the interceptors in
321 // prototypes and ultimate answer. 343 // prototypes and ultimate answer.
322 GenerateLoadInterceptorWithFollowup(it, reg); 344 GenerateLoadInterceptorWithFollowup(it, reg);
323 } else { 345 } else {
324 GenerateLoadInterceptor(reg); 346 GenerateLoadInterceptor(reg);
325 } 347 }
326 return GetCode(kind(), Code::FAST, it->name()); 348 return GetCode(kind(), Code::FAST, it->name());
327 } 349 }
328 350
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 DCHECK(elements_kind == DICTIONARY_ELEMENTS); 537 DCHECK(elements_kind == DICTIONARY_ELEMENTS);
516 cached_stub = LoadDictionaryElementStub(isolate()).GetCode(); 538 cached_stub = LoadDictionaryElementStub(isolate()).GetCode();
517 } 539 }
518 } 540 }
519 541
520 handlers->Add(cached_stub); 542 handlers->Add(cached_stub);
521 } 543 }
522 } 544 }
523 } 545 }
524 } // namespace v8::internal 546 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/ic/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698