OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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_S390 | 5 #if V8_TARGET_ARCH_S390 |
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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 global, name, PropertyCellType::kInvalidated); | 187 global, name, PropertyCellType::kInvalidated); |
188 Isolate* isolate = masm->isolate(); | 188 Isolate* isolate = masm->isolate(); |
189 DCHECK(cell->value()->IsTheHole(isolate)); | 189 DCHECK(cell->value()->IsTheHole(isolate)); |
190 Handle<WeakCell> weak_cell = isolate->factory()->NewWeakCell(cell); | 190 Handle<WeakCell> weak_cell = isolate->factory()->NewWeakCell(cell); |
191 __ LoadWeakValue(scratch, weak_cell, miss); | 191 __ LoadWeakValue(scratch, weak_cell, miss); |
192 __ LoadP(scratch, FieldMemOperand(scratch, PropertyCell::kValueOffset)); | 192 __ LoadP(scratch, FieldMemOperand(scratch, PropertyCell::kValueOffset)); |
193 __ CompareRoot(scratch, Heap::kTheHoleValueRootIndex); | 193 __ CompareRoot(scratch, Heap::kTheHoleValueRootIndex); |
194 __ bne(miss); | 194 __ bne(miss); |
195 } | 195 } |
196 | 196 |
197 static void PushInterceptorArguments(MacroAssembler* masm, Register receiver, | |
198 Register holder, Register name, | |
199 Handle<JSObject> holder_obj) { | |
200 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsNameIndex == 0); | |
201 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsThisIndex == 1); | |
202 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsHolderIndex == 2); | |
203 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsLength == 3); | |
204 __ Push(name); | |
205 __ Push(receiver); | |
206 __ Push(holder); | |
207 } | |
208 | |
209 static void CompileCallLoadPropertyWithInterceptor( | 197 static void CompileCallLoadPropertyWithInterceptor( |
210 MacroAssembler* masm, Register receiver, Register holder, Register name, | 198 MacroAssembler* masm, Register receiver, Register holder, Register name, |
211 Handle<JSObject> holder_obj, Runtime::FunctionId id) { | 199 Handle<JSObject> holder_obj, Runtime::FunctionId id) { |
212 DCHECK(NamedLoadHandlerCompiler::kInterceptorArgsLength == | 200 DCHECK(NamedLoadHandlerCompiler::kInterceptorArgsLength == |
213 Runtime::FunctionForId(id)->nargs); | 201 Runtime::FunctionForId(id)->nargs); |
214 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); | 202 |
| 203 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsNameIndex == 0); |
| 204 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsThisIndex == 1); |
| 205 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsHolderIndex == 2); |
| 206 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsLength == 3); |
| 207 __ Push(name, receiver, holder); |
| 208 |
215 __ CallRuntime(id); | 209 __ CallRuntime(id); |
216 } | 210 } |
217 | 211 |
218 // Generate call to api function. | 212 // Generate call to api function. |
219 void PropertyHandlerCompiler::GenerateApiAccessorCall( | 213 void PropertyHandlerCompiler::GenerateApiAccessorCall( |
220 MacroAssembler* masm, const CallOptimization& optimization, | 214 MacroAssembler* masm, const CallOptimization& optimization, |
221 Handle<Map> receiver_map, Register receiver, Register scratch_in, | 215 Handle<Map> receiver_map, Register receiver, Register scratch_in, |
222 bool is_store, Register store_parameter, Register accessor_holder, | 216 bool is_store, Register store_parameter, Register accessor_holder, |
223 int accessor_index) { | 217 int accessor_index) { |
224 DCHECK(!accessor_holder.is(scratch_in)); | 218 DCHECK(!accessor_holder.is(scratch_in)); |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 // Leave the internal frame. | 495 // Leave the internal frame. |
502 } | 496 } |
503 | 497 |
504 GenerateLoadPostInterceptor(it, holder_reg); | 498 GenerateLoadPostInterceptor(it, holder_reg); |
505 } | 499 } |
506 | 500 |
507 void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) { | 501 void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) { |
508 // Call the runtime system to load the interceptor. | 502 // Call the runtime system to load the interceptor. |
509 DCHECK(holder()->HasNamedInterceptor()); | 503 DCHECK(holder()->HasNamedInterceptor()); |
510 DCHECK(!holder()->GetNamedInterceptor()->getter()->IsUndefined(isolate())); | 504 DCHECK(!holder()->GetNamedInterceptor()->getter()->IsUndefined(isolate())); |
511 PushInterceptorArguments(masm(), receiver(), holder_reg, this->name(), | 505 |
512 holder()); | 506 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsNameIndex == 0); |
| 507 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsThisIndex == 1); |
| 508 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsHolderIndex == 2); |
| 509 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsLength == 3); |
| 510 __ Push(name(), receiver(), holder_reg); |
| 511 // See NamedLoadHandlerCompiler::InterceptorVectorSlotPop() for details. |
| 512 if (holder_reg.is(receiver())) { |
| 513 __ Push(slot(), vector()); |
| 514 } else { |
| 515 __ Push(scratch3(), scratch2()); // slot, vector |
| 516 } |
513 | 517 |
514 __ TailCallRuntime(Runtime::kLoadPropertyWithInterceptor); | 518 __ TailCallRuntime(Runtime::kLoadPropertyWithInterceptor); |
515 } | 519 } |
516 | 520 |
517 void NamedStoreHandlerCompiler::ZapStackArgumentsRegisterAliases() { | 521 void NamedStoreHandlerCompiler::ZapStackArgumentsRegisterAliases() { |
518 STATIC_ASSERT(!StoreWithVectorDescriptor::kPassLastArgsOnStack); | 522 STATIC_ASSERT(!StoreWithVectorDescriptor::kPassLastArgsOnStack); |
519 } | 523 } |
520 | 524 |
521 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( | 525 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( |
522 Handle<JSObject> object, Handle<Name> name, Handle<AccessorInfo> callback, | 526 Handle<JSObject> object, Handle<Name> name, Handle<AccessorInfo> callback, |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 | 584 |
581 // Return the generated code. | 585 // Return the generated code. |
582 return GetCode(kind(), name); | 586 return GetCode(kind(), name); |
583 } | 587 } |
584 | 588 |
585 #undef __ | 589 #undef __ |
586 } // namespace internal | 590 } // namespace internal |
587 } // namespace v8 | 591 } // namespace v8 |
588 | 592 |
589 #endif // V8_TARGET_ARCH_ARM | 593 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |