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_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 global, name, PropertyCellType::kInvalidated); | 192 global, name, PropertyCellType::kInvalidated); |
193 Isolate* isolate = masm->isolate(); | 193 Isolate* isolate = masm->isolate(); |
194 DCHECK(cell->value()->IsTheHole(isolate)); | 194 DCHECK(cell->value()->IsTheHole(isolate)); |
195 Handle<WeakCell> weak_cell = isolate->factory()->NewWeakCell(cell); | 195 Handle<WeakCell> weak_cell = isolate->factory()->NewWeakCell(cell); |
196 __ LoadWeakValue(scratch, weak_cell, miss); | 196 __ LoadWeakValue(scratch, weak_cell, miss); |
197 __ lw(scratch, FieldMemOperand(scratch, PropertyCell::kValueOffset)); | 197 __ lw(scratch, FieldMemOperand(scratch, PropertyCell::kValueOffset)); |
198 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); | 198 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); |
199 __ Branch(miss, ne, scratch, Operand(at)); | 199 __ Branch(miss, ne, scratch, Operand(at)); |
200 } | 200 } |
201 | 201 |
202 | |
203 static void PushInterceptorArguments(MacroAssembler* masm, Register receiver, | |
204 Register holder, Register name, | |
205 Handle<JSObject> holder_obj) { | |
206 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsNameIndex == 0); | |
207 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsThisIndex == 1); | |
208 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsHolderIndex == 2); | |
209 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsLength == 3); | |
210 __ Push(name, receiver, holder); | |
211 } | |
212 | |
213 | |
214 static void CompileCallLoadPropertyWithInterceptor( | 202 static void CompileCallLoadPropertyWithInterceptor( |
215 MacroAssembler* masm, Register receiver, Register holder, Register name, | 203 MacroAssembler* masm, Register receiver, Register holder, Register name, |
216 Handle<JSObject> holder_obj, Runtime::FunctionId id) { | 204 Handle<JSObject> holder_obj, Runtime::FunctionId id) { |
217 DCHECK(NamedLoadHandlerCompiler::kInterceptorArgsLength == | 205 DCHECK(NamedLoadHandlerCompiler::kInterceptorArgsLength == |
218 Runtime::FunctionForId(id)->nargs); | 206 Runtime::FunctionForId(id)->nargs); |
219 PushInterceptorArguments(masm, receiver, holder, name, holder_obj); | 207 |
| 208 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsNameIndex == 0); |
| 209 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsThisIndex == 1); |
| 210 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsHolderIndex == 2); |
| 211 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsLength == 3); |
| 212 __ Push(name, receiver, holder); |
| 213 |
220 __ CallRuntime(id); | 214 __ CallRuntime(id); |
221 } | 215 } |
222 | 216 |
223 | 217 |
224 // Generate call to api function. | 218 // Generate call to api function. |
225 void PropertyHandlerCompiler::GenerateApiAccessorCall( | 219 void PropertyHandlerCompiler::GenerateApiAccessorCall( |
226 MacroAssembler* masm, const CallOptimization& optimization, | 220 MacroAssembler* masm, const CallOptimization& optimization, |
227 Handle<Map> receiver_map, Register receiver, Register scratch_in, | 221 Handle<Map> receiver_map, Register receiver, Register scratch_in, |
228 bool is_store, Register store_parameter, Register accessor_holder, | 222 bool is_store, Register store_parameter, Register accessor_holder, |
229 int accessor_index) { | 223 int accessor_index) { |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 } | 499 } |
506 | 500 |
507 GenerateLoadPostInterceptor(it, holder_reg); | 501 GenerateLoadPostInterceptor(it, holder_reg); |
508 } | 502 } |
509 | 503 |
510 | 504 |
511 void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) { | 505 void NamedLoadHandlerCompiler::GenerateLoadInterceptor(Register holder_reg) { |
512 // Call the runtime system to load the interceptor. | 506 // Call the runtime system to load the interceptor. |
513 DCHECK(holder()->HasNamedInterceptor()); | 507 DCHECK(holder()->HasNamedInterceptor()); |
514 DCHECK(!holder()->GetNamedInterceptor()->getter()->IsUndefined(isolate())); | 508 DCHECK(!holder()->GetNamedInterceptor()->getter()->IsUndefined(isolate())); |
515 PushInterceptorArguments(masm(), receiver(), holder_reg, this->name(), | 509 |
516 holder()); | 510 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsNameIndex == 0); |
| 511 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsThisIndex == 1); |
| 512 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsHolderIndex == 2); |
| 513 STATIC_ASSERT(NamedLoadHandlerCompiler::kInterceptorArgsLength == 3); |
| 514 __ Push(name(), receiver(), holder_reg); |
| 515 // See NamedLoadHandlerCompiler::InterceptorVectorSlotPop() for details. |
| 516 if (holder_reg.is(receiver())) { |
| 517 __ Push(slot(), vector()); |
| 518 } else { |
| 519 __ Push(scratch3(), scratch2()); // slot, vector |
| 520 } |
517 | 521 |
518 __ TailCallRuntime(Runtime::kLoadPropertyWithInterceptor); | 522 __ TailCallRuntime(Runtime::kLoadPropertyWithInterceptor); |
519 } | 523 } |
520 | 524 |
521 void NamedStoreHandlerCompiler::ZapStackArgumentsRegisterAliases() { | 525 void NamedStoreHandlerCompiler::ZapStackArgumentsRegisterAliases() { |
522 STATIC_ASSERT(!StoreWithVectorDescriptor::kPassLastArgsOnStack); | 526 STATIC_ASSERT(!StoreWithVectorDescriptor::kPassLastArgsOnStack); |
523 } | 527 } |
524 | 528 |
525 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( | 529 Handle<Code> NamedStoreHandlerCompiler::CompileStoreCallback( |
526 Handle<JSObject> object, Handle<Name> name, Handle<AccessorInfo> callback, | 530 Handle<JSObject> object, Handle<Name> name, Handle<AccessorInfo> callback, |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 // Return the generated code. | 592 // Return the generated code. |
589 return GetCode(kind(), name); | 593 return GetCode(kind(), name); |
590 } | 594 } |
591 | 595 |
592 | 596 |
593 #undef __ | 597 #undef __ |
594 } // namespace internal | 598 } // namespace internal |
595 } // namespace v8 | 599 } // namespace v8 |
596 | 600 |
597 #endif // V8_TARGET_ARCH_MIPS | 601 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |