OLD | NEW |
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/ic/handler-compiler.h" | 5 #include "src/ic/handler-compiler.h" |
6 | 6 |
7 #include "src/field-type.h" | 7 #include "src/field-type.h" |
8 #include "src/ic/call-optimization.h" | 8 #include "src/ic/call-optimization.h" |
9 #include "src/ic/ic-inl.h" | 9 #include "src/ic/ic-inl.h" |
10 #include "src/ic/ic.h" | 10 #include "src/ic/ic.h" |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 if (inline_followup) { | 351 if (inline_followup) { |
352 // TODO(368): Compile in the whole chain: all the interceptors in | 352 // TODO(368): Compile in the whole chain: all the interceptors in |
353 // prototypes and ultimate answer. | 353 // prototypes and ultimate answer. |
354 GenerateLoadInterceptorWithFollowup(it, reg); | 354 GenerateLoadInterceptorWithFollowup(it, reg); |
355 } else { | 355 } else { |
356 GenerateLoadInterceptor(reg); | 356 GenerateLoadInterceptor(reg); |
357 } | 357 } |
358 return GetCode(kind(), it->name()); | 358 return GetCode(kind(), it->name()); |
359 } | 359 } |
360 | 360 |
361 void NamedLoadHandlerCompiler::GenerateLoadCallback( | |
362 Register reg, Handle<AccessorInfo> callback) { | |
363 DCHECK(receiver().is(ApiGetterDescriptor::ReceiverRegister())); | |
364 __ Move(ApiGetterDescriptor::HolderRegister(), reg); | |
365 // The callback is alive if this instruction is executed, | |
366 // so the weak cell is not cleared and points to data. | |
367 Handle<WeakCell> cell = isolate()->factory()->NewWeakCell(callback); | |
368 __ GetWeakValue(ApiGetterDescriptor::CallbackRegister(), cell); | |
369 | |
370 CallApiGetterStub stub(isolate()); | |
371 __ TailCallStub(&stub); | |
372 } | |
373 | 361 |
374 void NamedLoadHandlerCompiler::GenerateLoadPostInterceptor( | 362 void NamedLoadHandlerCompiler::GenerateLoadPostInterceptor( |
375 LookupIterator* it, Register interceptor_reg) { | 363 LookupIterator* it, Register interceptor_reg) { |
376 Handle<JSObject> real_named_property_holder(it->GetHolder<JSObject>()); | 364 Handle<JSObject> real_named_property_holder(it->GetHolder<JSObject>()); |
377 | 365 |
378 Handle<Map> holder_map(holder()->map()); | 366 Handle<Map> holder_map(holder()->map()); |
379 set_map(holder_map); | 367 set_map(holder_map); |
380 set_holder(real_named_property_holder); | 368 set_holder(real_named_property_holder); |
381 | 369 |
382 Label miss; | 370 Label miss; |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 LoadICState state = LoadICState(kNoExtraICState); | 594 LoadICState state = LoadICState(kNoExtraICState); |
607 cached_stub = LoadDictionaryElementStub(isolate(), state).GetCode(); | 595 cached_stub = LoadDictionaryElementStub(isolate(), state).GetCode(); |
608 } | 596 } |
609 } | 597 } |
610 | 598 |
611 handlers->Add(cached_stub); | 599 handlers->Add(cached_stub); |
612 } | 600 } |
613 } | 601 } |
614 } // namespace internal | 602 } // namespace internal |
615 } // namespace v8 | 603 } // namespace v8 |
OLD | NEW |