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