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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 // Stub never generated for non-global objects that require access | 289 // Stub never generated for non-global objects that require access |
290 // checks. | 290 // checks. |
291 ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded()); | 291 ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded()); |
292 | 292 |
293 // Perform map transition for the receiver if necessary. | 293 // Perform map transition for the receiver if necessary. |
294 if ((transition != NULL) && (object->map()->unused_property_fields() == 0)) { | 294 if ((transition != NULL) && (object->map()->unused_property_fields() == 0)) { |
295 // The properties must be extended before we can store the value. | 295 // The properties must be extended before we can store the value. |
296 // We jump to a runtime call that extends the properties array. | 296 // We jump to a runtime call that extends the properties array. |
297 __ push(receiver_reg); | 297 __ push(receiver_reg); |
298 __ mov(r2, Operand(Handle<Map>(transition))); | 298 __ mov(r2, Operand(Handle<Map>(transition))); |
299 __ stm(db_w, sp, r2.bit() | r0.bit()); | 299 __ Push(r2, r0); |
300 __ TailCallExternalReference( | 300 __ TailCallExternalReference( |
301 ExternalReference(IC_Utility(IC::kSharedStoreIC_ExtendStorage)), | 301 ExternalReference(IC_Utility(IC::kSharedStoreIC_ExtendStorage)), |
302 3, 1); | 302 3, 1); |
303 return; | 303 return; |
304 } | 304 } |
305 | 305 |
306 if (transition != NULL) { | 306 if (transition != NULL) { |
307 // Update the map of the object; no write barrier updating is | 307 // Update the map of the object; no write barrier updating is |
308 // needed because the map is never in new space. | 308 // needed because the map is never in new space. |
309 __ mov(ip, Operand(Handle<Map>(transition))); | 309 __ mov(ip, Operand(Handle<Map>(transition))); |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 | 457 |
458 if (!optimize) { | 458 if (!optimize) { |
459 CompileRegular(masm, receiver, holder, scratch2, holder_obj, miss_label); | 459 CompileRegular(masm, receiver, holder, scratch2, holder_obj, miss_label); |
460 return; | 460 return; |
461 } | 461 } |
462 | 462 |
463 // Note: starting a frame here makes GC aware of pointers pushed below. | 463 // Note: starting a frame here makes GC aware of pointers pushed below. |
464 __ EnterInternalFrame(); | 464 __ EnterInternalFrame(); |
465 | 465 |
466 __ push(receiver); | 466 __ push(receiver); |
467 __ push(holder); | 467 __ Push(holder, name_); |
468 __ push(name_); | |
469 | 468 |
470 CompileCallLoadPropertyWithInterceptor(masm, | 469 CompileCallLoadPropertyWithInterceptor(masm, |
471 receiver, | 470 receiver, |
472 holder, | 471 holder, |
473 name_, | 472 name_, |
474 holder_obj); | 473 holder_obj); |
475 | 474 |
476 Label interceptor_failed; | 475 Label interceptor_failed; |
477 // Compare with no_interceptor_result_sentinel. | 476 // Compare with no_interceptor_result_sentinel. |
478 __ LoadRoot(scratch1, Heap::kNoInterceptorResultSentinelRootIndex); | 477 __ LoadRoot(scratch1, Heap::kNoInterceptorResultSentinelRootIndex); |
(...skipping 24 matching lines...) Expand all Loading... |
503 lookup->GetFieldIndex()); | 502 lookup->GetFieldIndex()); |
504 __ Ret(); | 503 __ Ret(); |
505 } else { | 504 } else { |
506 ASSERT(lookup->type() == CALLBACKS); | 505 ASSERT(lookup->type() == CALLBACKS); |
507 ASSERT(lookup->GetCallbackObject()->IsAccessorInfo()); | 506 ASSERT(lookup->GetCallbackObject()->IsAccessorInfo()); |
508 ASSERT(callback != NULL); | 507 ASSERT(callback != NULL); |
509 ASSERT(callback->getter() != NULL); | 508 ASSERT(callback->getter() != NULL); |
510 | 509 |
511 Label cleanup; | 510 Label cleanup; |
512 __ pop(scratch2); | 511 __ pop(scratch2); |
513 __ push(receiver); | 512 __ Push(receiver, scratch2); |
514 __ push(scratch2); | |
515 | 513 |
516 holder = stub_compiler->CheckPrototypes(holder_obj, holder, | 514 holder = stub_compiler->CheckPrototypes(holder_obj, holder, |
517 lookup->holder(), scratch1, | 515 lookup->holder(), scratch1, |
518 scratch2, | 516 scratch2, |
519 name, | 517 name, |
520 &cleanup); | 518 &cleanup); |
521 | 519 |
522 __ push(holder); | 520 __ push(holder); |
523 __ Move(holder, Handle<AccessorInfo>(callback)); | 521 __ Move(holder, Handle<AccessorInfo>(callback)); |
524 __ push(holder); | 522 __ push(holder); |
525 __ ldr(scratch1, FieldMemOperand(holder, AccessorInfo::kDataOffset)); | 523 __ ldr(scratch1, FieldMemOperand(holder, AccessorInfo::kDataOffset)); |
526 __ push(scratch1); | 524 __ Push(scratch1, name_); |
527 __ push(name_); | |
528 | 525 |
529 ExternalReference ref = | 526 ExternalReference ref = |
530 ExternalReference(IC_Utility(IC::kLoadCallbackProperty)); | 527 ExternalReference(IC_Utility(IC::kLoadCallbackProperty)); |
531 __ TailCallExternalReference(ref, 5, 1); | 528 __ TailCallExternalReference(ref, 5, 1); |
532 | 529 |
533 __ bind(&cleanup); | 530 __ bind(&cleanup); |
534 __ pop(scratch1); | 531 __ pop(scratch1); |
535 __ pop(scratch2); | 532 __ pop(scratch2); |
536 __ push(scratch1); | 533 __ push(scratch1); |
537 } | 534 } |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 Failure** failure) { | 715 Failure** failure) { |
719 // Check that the receiver isn't a smi. | 716 // Check that the receiver isn't a smi. |
720 __ tst(receiver, Operand(kSmiTagMask)); | 717 __ tst(receiver, Operand(kSmiTagMask)); |
721 __ b(eq, miss); | 718 __ b(eq, miss); |
722 | 719 |
723 // Check that the maps haven't changed. | 720 // Check that the maps haven't changed. |
724 Register reg = | 721 Register reg = |
725 CheckPrototypes(object, receiver, holder, scratch1, scratch2, name, miss); | 722 CheckPrototypes(object, receiver, holder, scratch1, scratch2, name, miss); |
726 | 723 |
727 // Push the arguments on the JS stack of the caller. | 724 // Push the arguments on the JS stack of the caller. |
728 __ push(receiver); // receiver | 725 __ push(receiver); // Receiver. |
729 __ push(reg); // holder | 726 __ push(reg); // Holder. |
730 __ mov(ip, Operand(Handle<AccessorInfo>(callback))); // callback data | 727 __ mov(ip, Operand(Handle<AccessorInfo>(callback))); // callback data |
731 __ push(ip); | |
732 __ ldr(reg, FieldMemOperand(ip, AccessorInfo::kDataOffset)); | 728 __ ldr(reg, FieldMemOperand(ip, AccessorInfo::kDataOffset)); |
733 __ push(reg); | 729 __ Push(ip, reg, name_reg); |
734 __ push(name_reg); // name | |
735 | 730 |
736 // Do tail-call to the runtime system. | 731 // Do tail-call to the runtime system. |
737 ExternalReference load_callback_property = | 732 ExternalReference load_callback_property = |
738 ExternalReference(IC_Utility(IC::kLoadCallbackProperty)); | 733 ExternalReference(IC_Utility(IC::kLoadCallbackProperty)); |
739 __ TailCallExternalReference(load_callback_property, 5, 1); | 734 __ TailCallExternalReference(load_callback_property, 5, 1); |
740 | 735 |
741 return true; | 736 return true; |
742 } | 737 } |
743 | 738 |
744 | 739 |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1098 if (lookup.IsProperty() && | 1093 if (lookup.IsProperty() && |
1099 lookup.IsCacheable() && | 1094 lookup.IsCacheable() && |
1100 lookup.type() == CONSTANT_FUNCTION && | 1095 lookup.type() == CONSTANT_FUNCTION && |
1101 lookup.GetConstantFunction()->is_compiled() && | 1096 lookup.GetConstantFunction()->is_compiled() && |
1102 !holder->IsJSArray()) { | 1097 !holder->IsJSArray()) { |
1103 // Constant functions cannot sit on global object. | 1098 // Constant functions cannot sit on global object. |
1104 ASSERT(!lookup.holder()->IsGlobalObject()); | 1099 ASSERT(!lookup.holder()->IsGlobalObject()); |
1105 | 1100 |
1106 // Call the interceptor. | 1101 // Call the interceptor. |
1107 __ EnterInternalFrame(); | 1102 __ EnterInternalFrame(); |
1108 __ push(holder_reg); | 1103 __ Push(holder_reg, name_reg); |
1109 __ push(name_reg); | |
1110 CompileCallLoadPropertyWithInterceptor(masm(), | 1104 CompileCallLoadPropertyWithInterceptor(masm(), |
1111 receiver, | 1105 receiver, |
1112 holder_reg, | 1106 holder_reg, |
1113 name_reg, | 1107 name_reg, |
1114 holder); | 1108 holder); |
1115 __ pop(name_reg); | 1109 __ pop(name_reg); |
1116 __ pop(holder_reg); | 1110 __ pop(holder_reg); |
1117 __ LeaveInternalFrame(); | 1111 __ LeaveInternalFrame(); |
1118 // r0 no longer contains the receiver. | 1112 // r0 no longer contains the receiver. |
1119 | 1113 |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1302 if (object->IsJSGlobalProxy()) { | 1296 if (object->IsJSGlobalProxy()) { |
1303 __ CheckAccessGlobalProxy(r1, r3, &miss); | 1297 __ CheckAccessGlobalProxy(r1, r3, &miss); |
1304 } | 1298 } |
1305 | 1299 |
1306 // Stub never generated for non-global objects that require access | 1300 // Stub never generated for non-global objects that require access |
1307 // checks. | 1301 // checks. |
1308 ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded()); | 1302 ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded()); |
1309 | 1303 |
1310 __ push(r1); // receiver | 1304 __ push(r1); // receiver |
1311 __ mov(ip, Operand(Handle<AccessorInfo>(callback))); // callback info | 1305 __ mov(ip, Operand(Handle<AccessorInfo>(callback))); // callback info |
1312 __ stm(db_w, sp, ip.bit() | r2.bit() | r0.bit()); | 1306 __ Push(ip, r2, r0); |
1313 | 1307 |
1314 // Do tail-call to the runtime system. | 1308 // Do tail-call to the runtime system. |
1315 ExternalReference store_callback_property = | 1309 ExternalReference store_callback_property = |
1316 ExternalReference(IC_Utility(IC::kStoreCallbackProperty)); | 1310 ExternalReference(IC_Utility(IC::kStoreCallbackProperty)); |
1317 __ TailCallExternalReference(store_callback_property, 4, 1); | 1311 __ TailCallExternalReference(store_callback_property, 4, 1); |
1318 | 1312 |
1319 // Handle store cache miss. | 1313 // Handle store cache miss. |
1320 __ bind(&miss); | 1314 __ bind(&miss); |
1321 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); | 1315 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); |
1322 __ Jump(ic, RelocInfo::CODE_TARGET); | 1316 __ Jump(ic, RelocInfo::CODE_TARGET); |
(...skipping 24 matching lines...) Expand all Loading... |
1347 | 1341 |
1348 // Perform global security token check if needed. | 1342 // Perform global security token check if needed. |
1349 if (receiver->IsJSGlobalProxy()) { | 1343 if (receiver->IsJSGlobalProxy()) { |
1350 __ CheckAccessGlobalProxy(r1, r3, &miss); | 1344 __ CheckAccessGlobalProxy(r1, r3, &miss); |
1351 } | 1345 } |
1352 | 1346 |
1353 // Stub is never generated for non-global objects that require access | 1347 // Stub is never generated for non-global objects that require access |
1354 // checks. | 1348 // checks. |
1355 ASSERT(receiver->IsJSGlobalProxy() || !receiver->IsAccessCheckNeeded()); | 1349 ASSERT(receiver->IsJSGlobalProxy() || !receiver->IsAccessCheckNeeded()); |
1356 | 1350 |
1357 __ push(r1); // receiver. | 1351 __ Push(r1, r2, r0); // Receiver, name, value. |
1358 __ push(r2); // name. | |
1359 __ push(r0); // value. | |
1360 | 1352 |
1361 // Do tail-call to the runtime system. | 1353 // Do tail-call to the runtime system. |
1362 ExternalReference store_ic_property = | 1354 ExternalReference store_ic_property = |
1363 ExternalReference(IC_Utility(IC::kStoreInterceptorProperty)); | 1355 ExternalReference(IC_Utility(IC::kStoreInterceptorProperty)); |
1364 __ TailCallExternalReference(store_ic_property, 3, 1); | 1356 __ TailCallExternalReference(store_ic_property, 3, 1); |
1365 | 1357 |
1366 // Handle store cache miss. | 1358 // Handle store cache miss. |
1367 __ bind(&miss); | 1359 __ bind(&miss); |
1368 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); | 1360 Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Miss)); |
1369 __ Jump(ic, RelocInfo::CODE_TARGET); | 1361 __ Jump(ic, RelocInfo::CODE_TARGET); |
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1955 __ Jump(generic_construct_stub, RelocInfo::CODE_TARGET); | 1947 __ Jump(generic_construct_stub, RelocInfo::CODE_TARGET); |
1956 | 1948 |
1957 // Return the generated code. | 1949 // Return the generated code. |
1958 return GetCode(); | 1950 return GetCode(); |
1959 } | 1951 } |
1960 | 1952 |
1961 | 1953 |
1962 #undef __ | 1954 #undef __ |
1963 | 1955 |
1964 } } // namespace v8::internal | 1956 } } // namespace v8::internal |
OLD | NEW |