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 } |
361 | 373 |
362 void NamedLoadHandlerCompiler::GenerateLoadPostInterceptor( | 374 void NamedLoadHandlerCompiler::GenerateLoadPostInterceptor( |
363 LookupIterator* it, Register interceptor_reg) { | 375 LookupIterator* it, Register interceptor_reg) { |
364 Handle<JSObject> real_named_property_holder(it->GetHolder<JSObject>()); | 376 Handle<JSObject> real_named_property_holder(it->GetHolder<JSObject>()); |
365 | 377 |
366 Handle<Map> holder_map(holder()->map()); | 378 Handle<Map> holder_map(holder()->map()); |
367 set_map(holder_map); | 379 set_map(holder_map); |
368 set_holder(real_named_property_holder); | 380 set_holder(real_named_property_holder); |
369 | 381 |
370 Label miss; | 382 Label miss; |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 LoadICState state = LoadICState(kNoExtraICState); | 606 LoadICState state = LoadICState(kNoExtraICState); |
595 cached_stub = LoadDictionaryElementStub(isolate(), state).GetCode(); | 607 cached_stub = LoadDictionaryElementStub(isolate(), state).GetCode(); |
596 } | 608 } |
597 } | 609 } |
598 | 610 |
599 handlers->Add(cached_stub); | 611 handlers->Add(cached_stub); |
600 } | 612 } |
601 } | 613 } |
602 } // namespace internal | 614 } // namespace internal |
603 } // namespace v8 | 615 } // namespace v8 |
OLD | NEW |