| OLD | NEW |
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 | 476 |
| 477 // Do tail-call to the runtime system. | 477 // Do tail-call to the runtime system. |
| 478 ExternalReference load_callback_property = | 478 ExternalReference load_callback_property = |
| 479 ExternalReference(IC_Utility(IC::kLoadCallbackProperty)); | 479 ExternalReference(IC_Utility(IC::kLoadCallbackProperty)); |
| 480 __ TailCallRuntime(load_callback_property, 5); | 480 __ TailCallRuntime(load_callback_property, 5); |
| 481 } | 481 } |
| 482 | 482 |
| 483 | 483 |
| 484 void StubCompiler::GenerateLoadInterceptor(JSObject* object, | 484 void StubCompiler::GenerateLoadInterceptor(JSObject* object, |
| 485 JSObject* holder, | 485 JSObject* holder, |
| 486 Smi* lookup_hint, | 486 LookupResult* lookup, |
| 487 Register receiver, | 487 Register receiver, |
| 488 Register name_reg, | 488 Register name_reg, |
| 489 Register scratch1, | 489 Register scratch1, |
| 490 Register scratch2, | 490 Register scratch2, |
| 491 String* name, | 491 String* name, |
| 492 Label* miss) { | 492 Label* miss) { |
| 493 // Check that the receiver isn't a smi. | 493 // Check that the receiver isn't a smi. |
| 494 __ tst(receiver, Operand(kSmiTagMask)); | 494 __ tst(receiver, Operand(kSmiTagMask)); |
| 495 __ b(eq, miss); | 495 __ b(eq, miss); |
| 496 | 496 |
| 497 // Check that the maps haven't changed. | 497 // Check that the maps haven't changed. |
| 498 Register reg = | 498 Register reg = |
| 499 CheckPrototypes(object, receiver, holder, scratch1, scratch2, name, miss); | 499 CheckPrototypes(object, receiver, holder, scratch1, scratch2, name, miss); |
| 500 | 500 |
| 501 // Push the arguments on the JS stack of the caller. | 501 // Push the arguments on the JS stack of the caller. |
| 502 __ push(receiver); // receiver | 502 __ push(receiver); // receiver |
| 503 __ push(reg); // holder | 503 __ push(reg); // holder |
| 504 __ push(name_reg); // name | 504 __ push(name_reg); // name |
| 505 __ mov(scratch1, Operand(lookup_hint)); | |
| 506 __ push(scratch1); | |
| 507 | 505 |
| 508 InterceptorInfo* interceptor = holder->GetNamedInterceptor(); | 506 InterceptorInfo* interceptor = holder->GetNamedInterceptor(); |
| 509 ASSERT(!Heap::InNewSpace(interceptor)); | 507 ASSERT(!Heap::InNewSpace(interceptor)); |
| 510 __ mov(scratch1, Operand(Handle<Object>(interceptor))); | 508 __ mov(scratch1, Operand(Handle<Object>(interceptor))); |
| 511 __ push(scratch1); | 509 __ push(scratch1); |
| 512 __ ldr(scratch2, FieldMemOperand(scratch1, InterceptorInfo::kDataOffset)); | 510 __ ldr(scratch2, FieldMemOperand(scratch1, InterceptorInfo::kDataOffset)); |
| 513 __ push(scratch2); | 511 __ push(scratch2); |
| 514 | 512 |
| 515 // Do tail-call to the runtime system. | 513 // Do tail-call to the runtime system. |
| 516 ExternalReference load_ic_property = | 514 ExternalReference load_ic_property = |
| 517 ExternalReference(IC_Utility(IC::kLoadInterceptorProperty)); | 515 ExternalReference(IC_Utility(IC::kLoadPropertyWithInterceptorForLoad)); |
| 518 __ TailCallRuntime(load_ic_property, 6); | 516 __ TailCallRuntime(load_ic_property, 5); |
| 519 } | 517 } |
| 520 | 518 |
| 521 | 519 |
| 522 Object* StubCompiler::CompileLazyCompile(Code::Flags flags) { | 520 Object* StubCompiler::CompileLazyCompile(Code::Flags flags) { |
| 523 // ----------- S t a t e ------------- | 521 // ----------- S t a t e ------------- |
| 524 // -- r1: function | 522 // -- r1: function |
| 525 // -- lr: return address | 523 // -- lr: return address |
| 526 // ----------------------------------- | 524 // ----------------------------------- |
| 527 | 525 |
| 528 // Enter an internal frame. | 526 // Enter an internal frame. |
| (...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1052 String* name) { | 1050 String* name) { |
| 1053 // ----------- S t a t e ------------- | 1051 // ----------- S t a t e ------------- |
| 1054 // -- r2 : name | 1052 // -- r2 : name |
| 1055 // -- lr : return address | 1053 // -- lr : return address |
| 1056 // -- [sp] : receiver | 1054 // -- [sp] : receiver |
| 1057 // ----------------------------------- | 1055 // ----------------------------------- |
| 1058 Label miss; | 1056 Label miss; |
| 1059 | 1057 |
| 1060 __ ldr(r0, MemOperand(sp, 0)); | 1058 __ ldr(r0, MemOperand(sp, 0)); |
| 1061 | 1059 |
| 1060 LookupResult lookup; |
| 1061 holder->LocalLookupRealNamedProperty(name, &lookup); |
| 1062 GenerateLoadInterceptor(object, | 1062 GenerateLoadInterceptor(object, |
| 1063 holder, | 1063 holder, |
| 1064 holder->InterceptorPropertyLookupHint(name), | 1064 &lookup, |
| 1065 r0, | 1065 r0, |
| 1066 r2, | 1066 r2, |
| 1067 r3, | 1067 r3, |
| 1068 r1, | 1068 r1, |
| 1069 name, | 1069 name, |
| 1070 &miss); | 1070 &miss); |
| 1071 __ bind(&miss); | 1071 __ bind(&miss); |
| 1072 GenerateLoadMiss(masm(), Code::LOAD_IC); | 1072 GenerateLoadMiss(masm(), Code::LOAD_IC); |
| 1073 | 1073 |
| 1074 // Return the generated code. | 1074 // Return the generated code. |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1211 // ----------------------------------- | 1211 // ----------------------------------- |
| 1212 Label miss; | 1212 Label miss; |
| 1213 | 1213 |
| 1214 // Check the key is the cached one | 1214 // Check the key is the cached one |
| 1215 __ ldr(r2, MemOperand(sp, 0)); | 1215 __ ldr(r2, MemOperand(sp, 0)); |
| 1216 __ ldr(r0, MemOperand(sp, kPointerSize)); | 1216 __ ldr(r0, MemOperand(sp, kPointerSize)); |
| 1217 | 1217 |
| 1218 __ cmp(r2, Operand(Handle<String>(name))); | 1218 __ cmp(r2, Operand(Handle<String>(name))); |
| 1219 __ b(ne, &miss); | 1219 __ b(ne, &miss); |
| 1220 | 1220 |
| 1221 LookupResult lookup; |
| 1222 holder->LocalLookupRealNamedProperty(name, &lookup); |
| 1221 GenerateLoadInterceptor(receiver, | 1223 GenerateLoadInterceptor(receiver, |
| 1222 holder, | 1224 holder, |
| 1223 Smi::FromInt(JSObject::kLookupInHolder), | 1225 &lookup, |
| 1224 r0, | 1226 r0, |
| 1225 r2, | 1227 r2, |
| 1226 r3, | 1228 r3, |
| 1227 r1, | 1229 r1, |
| 1228 name, | 1230 name, |
| 1229 &miss); | 1231 &miss); |
| 1230 __ bind(&miss); | 1232 __ bind(&miss); |
| 1231 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); | 1233 GenerateLoadMiss(masm(), Code::KEYED_LOAD_IC); |
| 1232 | 1234 |
| 1233 return GetCode(INTERCEPTOR, name); | 1235 return GetCode(INTERCEPTOR, name); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1331 __ Jump(ic, RelocInfo::CODE_TARGET); | 1333 __ Jump(ic, RelocInfo::CODE_TARGET); |
| 1332 | 1334 |
| 1333 // Return the generated code. | 1335 // Return the generated code. |
| 1334 return GetCode(transition == NULL ? FIELD : MAP_TRANSITION, name); | 1336 return GetCode(transition == NULL ? FIELD : MAP_TRANSITION, name); |
| 1335 } | 1337 } |
| 1336 | 1338 |
| 1337 | 1339 |
| 1338 #undef __ | 1340 #undef __ |
| 1339 | 1341 |
| 1340 } } // namespace v8::internal | 1342 } } // namespace v8::internal |
| OLD | NEW |