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 #if V8_TARGET_ARCH_ARM | 5 #if V8_TARGET_ARCH_ARM |
6 | 6 |
7 #include "src/ic/handler-compiler.h" | 7 #include "src/ic/handler-compiler.h" |
8 | 8 |
9 #include "src/api-arguments.h" | 9 #include "src/api-arguments.h" |
10 #include "src/field-type.h" | 10 #include "src/field-type.h" |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 Isolate* isolate = masm->isolate(); | 201 Isolate* isolate = masm->isolate(); |
202 DCHECK(cell->value()->IsTheHole(isolate)); | 202 DCHECK(cell->value()->IsTheHole(isolate)); |
203 Handle<WeakCell> weak_cell = isolate->factory()->NewWeakCell(cell); | 203 Handle<WeakCell> weak_cell = isolate->factory()->NewWeakCell(cell); |
204 __ LoadWeakValue(scratch, weak_cell, miss); | 204 __ LoadWeakValue(scratch, weak_cell, miss); |
205 __ ldr(scratch, FieldMemOperand(scratch, PropertyCell::kValueOffset)); | 205 __ ldr(scratch, FieldMemOperand(scratch, PropertyCell::kValueOffset)); |
206 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); | 206 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); |
207 __ cmp(scratch, ip); | 207 __ cmp(scratch, ip); |
208 __ b(ne, miss); | 208 __ b(ne, miss); |
209 } | 209 } |
210 | 210 |
| 211 static void CompileCallLoadPropertyWithInterceptor( |
| 212 MacroAssembler* masm, Register receiver, Register holder, Register name, |
| 213 Handle<JSObject> holder_obj, Runtime::FunctionId id) { |
| 214 DCHECK(NamedLoadHandlerCompiler::kInterceptorArgsLength == |
| 215 Runtime::FunctionForId(id)->nargs); |
211 | 216 |
212 static void PushInterceptorArguments(MacroAssembler* masm, Register receiver, | |
213 Register holder, Register name, | |
214 Handle<JSObject> holder_obj) { | |
215 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsNameIndex == 0); | 217 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsNameIndex == 0); |
216 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsThisIndex == 1); | 218 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsThisIndex == 1); |
217 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsHolderIndex == 2); | 219 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsHolderIndex == 2); |
218 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsLength == 3); | 220 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsLength == 3); |
219 __ push(name); | 221 __ push(name); |
220 __ push(receiver); | 222 __ push(receiver); |
221 __ push(holder); | 223 __ push(holder); |
222 } | |
223 | 224 |
224 | |
225 static void CompileCallLoadPropertyWithInterceptor( | |
226 MacroAssembler* masm, Register receiver, Register holder, Register name, | |
227 Handle<JSObject> holder_obj, Runtime::FunctionId id) { | |
228 DCHECK(NamedLoadHandlerCompiler::kInterceptorArgsLength == | |
229 Runtime::FunctionForId(id)->nargs); | |
230 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); | |
231 __ CallRuntime(id); | 225 __ CallRuntime(id); |
232 } | 226 } |
233 | 227 |
234 | 228 |
235 // Generate call to api function. | 229 // Generate call to api function. |
236 void PropertyHandlerCompiler::GenerateApiAccessorCall( | 230 void PropertyHandlerCompiler::GenerateApiAccessorCall( |
237 MacroAssembler* masm, const CallOptimization& optimization, | 231 MacroAssembler* masm, const CallOptimization& optimization, |
238 Handle<Map> receiver_map, Register receiver, Register scratch_in, | 232 Handle<Map> receiver_map, Register receiver, Register scratch_in, |
239 bool is_store, Register store_parameter, Register accessor_holder, | 233 bool is_store, Register store_parameter, Register accessor_holder, |
240 int accessor_index) { | 234 int accessor_index) { |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 } | 517 } |
524 | 518 |
525 GenerateLoadPostInterceptor(it, holder_reg); | 519 GenerateLoadPostInterceptor(it, holder_reg); |
526 } | 520 } |
527 | 521 |
528 | 522 |
529 void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) { | 523 void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) { |
530 // Call the runtime system to load the interceptor. | 524 // Call the runtime system to load the interceptor. |
531 DCHECK(holder()->HasNamedInterceptor()); | 525 DCHECK(holder()->HasNamedInterceptor()); |
532 DCHECK(!holder()->GetNamedInterceptor()->getter()->IsUndefined(isolate())); | 526 DCHECK(!holder()->GetNamedInterceptor()->getter()->IsUndefined(isolate())); |
533 PushInterceptorArguments(masm(), receiver(), holder_reg, this->name(), | 527 |
534 holder()); | 528 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsNameIndex == 0); |
| 529 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsThisIndex == 1); |
| 530 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsHolderIndex == 2); |
| 531 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsLength == 3); |
| 532 __ Push(name(), receiver(), holder_reg); |
| 533 // See NamedLoadHandlerCompiler::InterceptorVectorSlotPop() for details. |
| 534 if (holder_reg.is(receiver())) { |
| 535 __ Push(slot(), vector()); |
| 536 } else { |
| 537 __ Push(scratch3(), scratch2()); // slot, vector |
| 538 } |
535 | 539 |
536 __ TailCallRuntime(Runtime::kLoadPropertyWithInterceptor); | 540 __ TailCallRuntime(Runtime::kLoadPropertyWithInterceptor); |
537 } | 541 } |
538 | 542 |
539 void NamedStoreHandlerCompiler::ZapStackArgumentsRegisterAliases() { | 543 void NamedStoreHandlerCompiler::ZapStackArgumentsRegisterAliases() { |
540 STATIC_ASSERT(!StoreWithVectorDescriptor::kPassLastArgsOnStack); | 544 STATIC_ASSERT(!StoreWithVectorDescriptor::kPassLastArgsOnStack); |
541 } | 545 } |
542 | 546 |
543 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( | 547 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( |
544 Handle<JSObject> object, Handle<Name> name, Handle<AccessorInfo> callback, | 548 Handle<JSObject> object, Handle<Name> name, Handle<AccessorInfo> callback, |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 // Return the generated code. | 611 // Return the generated code. |
608 return GetCode(kind(), name); | 612 return GetCode(kind(), name); |
609 } | 613 } |
610 | 614 |
611 | 615 |
612 #undef __ | 616 #undef __ |
613 } // namespace internal | 617 } // namespace internal |
614 } // namespace v8 | 618 } // namespace v8 |
615 | 619 |
616 #endif // V8_TARGET_ARCH_ARM | 620 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |