Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/mips/stub-cache-mips.cc

Issue 141363005: A64: Synchronize with r15204. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/mips/simulator-mips.cc ('k') | src/mksnapshot.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 413
414 414
415 // Generate code to check that a global property cell is empty. Create 415 // Generate code to check that a global property cell is empty. Create
416 // the property cell at compilation time if no cell exists for the 416 // the property cell at compilation time if no cell exists for the
417 // property. 417 // property.
418 static void GenerateCheckPropertyCell(MacroAssembler* masm, 418 static void GenerateCheckPropertyCell(MacroAssembler* masm,
419 Handle<GlobalObject> global, 419 Handle<GlobalObject> global,
420 Handle<Name> name, 420 Handle<Name> name,
421 Register scratch, 421 Register scratch,
422 Label* miss) { 422 Label* miss) {
423 Handle<JSGlobalPropertyCell> cell = 423 Handle<Cell> cell = GlobalObject::EnsurePropertyCell(global, name);
424 GlobalObject::EnsurePropertyCell(global, name);
425 ASSERT(cell->value()->IsTheHole()); 424 ASSERT(cell->value()->IsTheHole());
426 __ li(scratch, Operand(cell)); 425 __ li(scratch, Operand(cell));
427 __ lw(scratch, 426 __ lw(scratch, FieldMemOperand(scratch, Cell::kValueOffset));
428 FieldMemOperand(scratch, JSGlobalPropertyCell::kValueOffset));
429 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); 427 __ LoadRoot(at, Heap::kTheHoleValueRootIndex);
430 __ Branch(miss, ne, scratch, Operand(at)); 428 __ Branch(miss, ne, scratch, Operand(at));
431 } 429 }
432 430
433 431
434 // Generate StoreTransition code, value is passed in a0 register. 432 // Generate StoreTransition code, value is passed in a0 register.
435 // After executing generated code, the receiver_reg and name_reg 433 // After executing generated code, the receiver_reg and name_reg
436 // may be clobbered. 434 // may be clobbered.
437 void StubCompiler::GenerateStoreTransition(MacroAssembler* masm, 435 void StubCompiler::GenerateStoreTransition(MacroAssembler* masm,
438 Handle<JSObject> object, 436 Handle<JSObject> object,
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 miss_restore_name); 496 miss_restore_name);
499 } else if (!holder->HasFastProperties() && !holder->IsJSGlobalProxy()) { 497 } else if (!holder->HasFastProperties() && !holder->IsJSGlobalProxy()) {
500 GenerateDictionaryNegativeLookup( 498 GenerateDictionaryNegativeLookup(
501 masm, miss_restore_name, holder_reg, name, scratch1, scratch2); 499 masm, miss_restore_name, holder_reg, name, scratch1, scratch2);
502 } 500 }
503 } 501 }
504 } 502 }
505 503
506 Register storage_reg = name_reg; 504 Register storage_reg = name_reg;
507 505
508 if (FLAG_track_fields && representation.IsSmi()) { 506 if (details.type() == CONSTANT_FUNCTION) {
507 Handle<HeapObject> constant(
508 HeapObject::cast(descriptors->GetValue(descriptor)));
509 __ LoadHeapObject(scratch1, constant);
510 __ Branch(miss_restore_name, ne, value_reg, Operand(scratch1));
511 } else if (FLAG_track_fields && representation.IsSmi()) {
509 __ JumpIfNotSmi(value_reg, miss_restore_name); 512 __ JumpIfNotSmi(value_reg, miss_restore_name);
510 } else if (FLAG_track_heap_object_fields && representation.IsHeapObject()) { 513 } else if (FLAG_track_heap_object_fields && representation.IsHeapObject()) {
511 __ JumpIfSmi(value_reg, miss_restore_name); 514 __ JumpIfSmi(value_reg, miss_restore_name);
512 } else if (FLAG_track_double_fields && representation.IsDouble()) { 515 } else if (FLAG_track_double_fields && representation.IsDouble()) {
513 Label do_store, heap_number; 516 Label do_store, heap_number;
514 __ LoadRoot(scratch3, Heap::kHeapNumberMapRootIndex); 517 __ LoadRoot(scratch3, Heap::kHeapNumberMapRootIndex);
515 __ AllocateHeapNumber(storage_reg, scratch1, scratch2, scratch3, slow); 518 __ AllocateHeapNumber(storage_reg, scratch1, scratch2, scratch3, slow);
516 519
517 __ JumpIfNotSmi(value_reg, &heap_number); 520 __ JumpIfNotSmi(value_reg, &heap_number);
518 __ SmiUntag(scratch1, value_reg); 521 __ SmiUntag(scratch1, value_reg);
519 __ mtc1(scratch1, f6); 522 __ mtc1(scratch1, f6);
520 __ cvt_d_w(f4, f6); 523 __ cvt_d_w(f4, f6);
521 __ jmp(&do_store); 524 __ jmp(&do_store);
522 525
523 __ bind(&heap_number); 526 __ bind(&heap_number);
524 __ CheckMap(value_reg, scratch1, Heap::kHeapNumberMapRootIndex, 527 __ CheckMap(value_reg, scratch1, Heap::kHeapNumberMapRootIndex,
525 miss_restore_name, DONT_DO_SMI_CHECK); 528 miss_restore_name, DONT_DO_SMI_CHECK);
526 __ ldc1(f4, FieldMemOperand(value_reg, HeapNumber::kValueOffset)); 529 __ ldc1(f4, FieldMemOperand(value_reg, HeapNumber::kValueOffset));
527 530
528 __ bind(&do_store); 531 __ bind(&do_store);
529 __ sdc1(f4, FieldMemOperand(storage_reg, HeapNumber::kValueOffset)); 532 __ sdc1(f4, FieldMemOperand(storage_reg, HeapNumber::kValueOffset));
530 } 533 }
531 534
532 // Stub never generated for non-global objects that require access 535 // Stub never generated for non-global objects that require access
533 // checks. 536 // checks.
534 ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded()); 537 ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded());
535 538
536 // Perform map transition for the receiver if necessary. 539 // Perform map transition for the receiver if necessary.
537 if (object->map()->unused_property_fields() == 0) { 540 if (details.type() == FIELD &&
541 object->map()->unused_property_fields() == 0) {
538 // The properties must be extended before we can store the value. 542 // The properties must be extended before we can store the value.
539 // We jump to a runtime call that extends the properties array. 543 // We jump to a runtime call that extends the properties array.
540 __ push(receiver_reg); 544 __ push(receiver_reg);
541 __ li(a2, Operand(transition)); 545 __ li(a2, Operand(transition));
542 __ Push(a2, a0); 546 __ Push(a2, a0);
543 __ TailCallExternalReference( 547 __ TailCallExternalReference(
544 ExternalReference(IC_Utility(IC::kSharedStoreIC_ExtendStorage), 548 ExternalReference(IC_Utility(IC::kSharedStoreIC_ExtendStorage),
545 masm->isolate()), 549 masm->isolate()),
546 3, 1); 550 3, 1);
547 return; 551 return;
548 } 552 }
549 553
550 // Update the map of the object. 554 // Update the map of the object.
551 __ li(scratch1, Operand(transition)); 555 __ li(scratch1, Operand(transition));
552 __ sw(scratch1, FieldMemOperand(receiver_reg, HeapObject::kMapOffset)); 556 __ sw(scratch1, FieldMemOperand(receiver_reg, HeapObject::kMapOffset));
553 557
554 // Update the write barrier for the map field and pass the now unused 558 // Update the write barrier for the map field and pass the now unused
555 // name_reg as scratch register. 559 // name_reg as scratch register.
556 __ RecordWriteField(receiver_reg, 560 __ RecordWriteField(receiver_reg,
557 HeapObject::kMapOffset, 561 HeapObject::kMapOffset,
558 scratch1, 562 scratch1,
559 scratch2, 563 scratch2,
560 kRAHasNotBeenSaved, 564 kRAHasNotBeenSaved,
561 kDontSaveFPRegs, 565 kDontSaveFPRegs,
562 OMIT_REMEMBERED_SET, 566 OMIT_REMEMBERED_SET,
563 OMIT_SMI_CHECK); 567 OMIT_SMI_CHECK);
564 568
569 if (details.type() == CONSTANT_FUNCTION) {
570 ASSERT(value_reg.is(a0));
571 __ Ret(USE_DELAY_SLOT);
572 __ mov(v0, a0);
573 return;
574 }
575
565 int index = transition->instance_descriptors()->GetFieldIndex( 576 int index = transition->instance_descriptors()->GetFieldIndex(
566 transition->LastAdded()); 577 transition->LastAdded());
567 578
568 // Adjust for the number of properties stored in the object. Even in the 579 // Adjust for the number of properties stored in the object. Even in the
569 // face of a transition we can use the old map here because the size of the 580 // face of a transition we can use the old map here because the size of the
570 // object and the number of in-object properties is not going to change. 581 // object and the number of in-object properties is not going to change.
571 index -= object->map()->inobject_properties(); 582 index -= object->map()->inobject_properties();
572 583
573 // TODO(verwaest): Share this code as a code stub. 584 // TODO(verwaest): Share this code as a code stub.
574 SmiCheck smi_check = representation.IsTagged() 585 SmiCheck smi_check = representation.IsTagged()
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
927 // NOTE: the O32 abi requires a0 to hold a special pointer when returning a 938 // NOTE: the O32 abi requires a0 to hold a special pointer when returning a
928 // struct from the function (which is currently the case). This means we pass 939 // struct from the function (which is currently the case). This means we pass
929 // the first argument in a1 instead of a0, if returns_handle is true. 940 // the first argument in a1 instead of a0, if returns_handle is true.
930 // CallApiFunctionAndReturn will set up a0. 941 // CallApiFunctionAndReturn will set up a0.
931 942
932 Address function_address = v8::ToCData<Address>(api_call_info->callback()); 943 Address function_address = v8::ToCData<Address>(api_call_info->callback());
933 bool returns_handle = 944 bool returns_handle =
934 !CallbackTable::ReturnsVoid(masm->isolate(), function_address); 945 !CallbackTable::ReturnsVoid(masm->isolate(), function_address);
935 946
936 Register first_arg = returns_handle ? a1 : a0; 947 Register first_arg = returns_handle ? a1 : a0;
948 Register second_arg = returns_handle ? a2 : a1;
937 949
938 // first_arg = v8::Arguments& 950 // first_arg = v8::Arguments&
939 // Arguments is built at sp + 1 (sp is a reserved spot for ra). 951 // Arguments is built at sp + 1 (sp is a reserved spot for ra).
940 __ Addu(first_arg, sp, kPointerSize); 952 __ Addu(first_arg, sp, kPointerSize);
941 953
942 // v8::Arguments::implicit_args_ 954 // v8::Arguments::implicit_args_
943 __ sw(a2, MemOperand(first_arg, 0 * kPointerSize)); 955 __ sw(a2, MemOperand(first_arg, 0 * kPointerSize));
944 // v8::Arguments::values_ 956 // v8::Arguments::values_
945 __ Addu(t0, a2, Operand(argc * kPointerSize)); 957 __ Addu(t0, a2, Operand(argc * kPointerSize));
946 __ sw(t0, MemOperand(first_arg, 1 * kPointerSize)); 958 __ sw(t0, MemOperand(first_arg, 1 * kPointerSize));
947 // v8::Arguments::length_ = argc 959 // v8::Arguments::length_ = argc
948 __ li(t0, Operand(argc)); 960 __ li(t0, Operand(argc));
949 __ sw(t0, MemOperand(first_arg, 2 * kPointerSize)); 961 __ sw(t0, MemOperand(first_arg, 2 * kPointerSize));
950 // v8::Arguments::is_construct_call = 0 962 // v8::Arguments::is_construct_call = 0
951 __ sw(zero_reg, MemOperand(first_arg, 3 * kPointerSize)); 963 __ sw(zero_reg, MemOperand(first_arg, 3 * kPointerSize));
952 964
953 const int kStackUnwindSpace = argc + kFastApiCallArguments + 1; 965 const int kStackUnwindSpace = argc + kFastApiCallArguments + 1;
954 ApiFunction fun(function_address); 966 ApiFunction fun(function_address);
955 ExternalReference::Type type = 967 ExternalReference::Type type =
956 returns_handle ? 968 returns_handle ?
957 ExternalReference::DIRECT_API_CALL : 969 ExternalReference::DIRECT_API_CALL :
958 ExternalReference::DIRECT_API_CALL_NEW; 970 ExternalReference::DIRECT_API_CALL_NEW;
959 ExternalReference ref = 971 ExternalReference ref =
960 ExternalReference(&fun, 972 ExternalReference(&fun,
961 type, 973 type,
962 masm->isolate()); 974 masm->isolate());
975
976 Address thunk_address = returns_handle
977 ? FUNCTION_ADDR(&InvokeInvocationCallback)
978 : FUNCTION_ADDR(&InvokeFunctionCallback);
979 ExternalReference::Type thunk_type =
980 returns_handle ?
981 ExternalReference::PROFILING_API_CALL :
982 ExternalReference::PROFILING_API_CALL_NEW;
983 ApiFunction thunk_fun(thunk_address);
984 ExternalReference thunk_ref = ExternalReference(&thunk_fun, thunk_type,
985 masm->isolate());
986
963 AllowExternalCallThatCantCauseGC scope(masm); 987 AllowExternalCallThatCantCauseGC scope(masm);
964 __ CallApiFunctionAndReturn(ref, 988 __ CallApiFunctionAndReturn(ref,
989 function_address,
990 thunk_ref,
991 second_arg,
965 kStackUnwindSpace, 992 kStackUnwindSpace,
966 returns_handle, 993 returns_handle,
967 kFastApiCallArguments + 1); 994 kFastApiCallArguments + 1);
968 } 995 }
969 996
970 class CallInterceptorCompiler BASE_EMBEDDED { 997 class CallInterceptorCompiler BASE_EMBEDDED {
971 public: 998 public:
972 CallInterceptorCompiler(StubCompiler* stub_compiler, 999 CallInterceptorCompiler(StubCompiler* stub_compiler,
973 const ParameterCount& arguments, 1000 const ParameterCount& arguments,
974 Register name, 1001 Register name,
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
1447 Operand(ExternalReference::isolate_address(isolate()))); 1474 Operand(ExternalReference::isolate_address(isolate())));
1448 __ sw(scratch4(), MemOperand(sp, 1 * kPointerSize)); 1475 __ sw(scratch4(), MemOperand(sp, 1 * kPointerSize));
1449 __ sw(name(), MemOperand(sp, 0 * kPointerSize)); 1476 __ sw(name(), MemOperand(sp, 0 * kPointerSize));
1450 1477
1451 Address getter_address = v8::ToCData<Address>(callback->getter()); 1478 Address getter_address = v8::ToCData<Address>(callback->getter());
1452 bool returns_handle = 1479 bool returns_handle =
1453 !CallbackTable::ReturnsVoid(isolate(), getter_address); 1480 !CallbackTable::ReturnsVoid(isolate(), getter_address);
1454 1481
1455 Register first_arg = returns_handle ? a1 : a0; 1482 Register first_arg = returns_handle ? a1 : a0;
1456 Register second_arg = returns_handle ? a2 : a1; 1483 Register second_arg = returns_handle ? a2 : a1;
1484 Register third_arg = returns_handle ? a3 : a2;
1457 1485
1458 __ mov(a2, scratch2()); // Saved in case scratch2 == a1. 1486 __ mov(a2, scratch2()); // Saved in case scratch2 == a1.
1459 __ mov(first_arg, sp); // (first argument - see note below) = Handle<Name> 1487 __ mov(first_arg, sp); // (first argument - see note below) = Handle<Name>
1460 1488
1461 // NOTE: the O32 abi requires a0 to hold a special pointer when returning a 1489 // NOTE: the O32 abi requires a0 to hold a special pointer when returning a
1462 // struct from the function (which is currently the case). This means we pass 1490 // struct from the function (which is currently the case). This means we pass
1463 // the arguments in a1-a2 instead of a0-a1, if returns_handle is true. 1491 // the arguments in a1-a2 instead of a0-a1, if returns_handle is true.
1464 // CallApiFunctionAndReturn will set up a0. 1492 // CallApiFunctionAndReturn will set up a0.
1465 1493
1466 const int kApiStackSpace = 1; 1494 const int kApiStackSpace = 1;
1467 FrameScope frame_scope(masm(), StackFrame::MANUAL); 1495 FrameScope frame_scope(masm(), StackFrame::MANUAL);
1468 __ EnterExitFrame(false, kApiStackSpace); 1496 __ EnterExitFrame(false, kApiStackSpace);
1469 1497
1470 // Create AccessorInfo instance on the stack above the exit frame with 1498 // Create AccessorInfo instance on the stack above the exit frame with
1471 // scratch2 (internal::Object** args_) as the data. 1499 // scratch2 (internal::Object** args_) as the data.
1472 __ sw(a2, MemOperand(sp, kPointerSize)); 1500 __ sw(a2, MemOperand(sp, kPointerSize));
1473 // (second argument - see note above) = AccessorInfo& 1501 // (second argument - see note above) = AccessorInfo&
1474 __ Addu(second_arg, sp, kPointerSize); 1502 __ Addu(second_arg, sp, kPointerSize);
1475 1503
1476 const int kStackUnwindSpace = kFastApiCallArguments + 1; 1504 const int kStackUnwindSpace = kFastApiCallArguments + 1;
1505
1477 ApiFunction fun(getter_address); 1506 ApiFunction fun(getter_address);
1478 ExternalReference::Type type = 1507 ExternalReference::Type type =
1479 returns_handle ? 1508 returns_handle ?
1480 ExternalReference::DIRECT_GETTER_CALL : 1509 ExternalReference::DIRECT_GETTER_CALL :
1481 ExternalReference::DIRECT_GETTER_CALL_NEW; 1510 ExternalReference::DIRECT_GETTER_CALL_NEW;
1511 ExternalReference ref = ExternalReference(&fun, type, isolate());
1482 1512
1483 ExternalReference ref = ExternalReference(&fun, type, isolate()); 1513 Address thunk_address = returns_handle
1514 ? FUNCTION_ADDR(&InvokeAccessorGetter)
1515 : FUNCTION_ADDR(&InvokeAccessorGetterCallback);
1516 ExternalReference::Type thunk_type =
1517 returns_handle ?
1518 ExternalReference::PROFILING_GETTER_CALL :
1519 ExternalReference::PROFILING_GETTER_CALL_NEW;
1520 ApiFunction thunk_fun(thunk_address);
1521 ExternalReference thunk_ref = ExternalReference(&thunk_fun, thunk_type,
1522 isolate());
1484 __ CallApiFunctionAndReturn(ref, 1523 __ CallApiFunctionAndReturn(ref,
1524 getter_address,
1525 thunk_ref,
1526 third_arg,
1485 kStackUnwindSpace, 1527 kStackUnwindSpace,
1486 returns_handle, 1528 returns_handle,
1487 5); 1529 5);
1488 } 1530 }
1489 1531
1490 1532
1491 void BaseLoadStubCompiler::GenerateLoadInterceptor( 1533 void BaseLoadStubCompiler::GenerateLoadInterceptor(
1492 Register holder_reg, 1534 Register holder_reg,
1493 Handle<JSObject> object, 1535 Handle<JSObject> object,
1494 Handle<JSObject> interceptor_holder, 1536 Handle<JSObject> interceptor_holder,
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
1593 // Get the receiver from the stack. 1635 // Get the receiver from the stack.
1594 __ lw(a0, MemOperand(sp, argc * kPointerSize)); 1636 __ lw(a0, MemOperand(sp, argc * kPointerSize));
1595 1637
1596 // Check that the maps haven't changed. 1638 // Check that the maps haven't changed.
1597 __ JumpIfSmi(a0, miss); 1639 __ JumpIfSmi(a0, miss);
1598 CheckPrototypes(object, a0, holder, a3, a1, t0, name, miss); 1640 CheckPrototypes(object, a0, holder, a3, a1, t0, name, miss);
1599 } 1641 }
1600 1642
1601 1643
1602 void CallStubCompiler::GenerateLoadFunctionFromCell( 1644 void CallStubCompiler::GenerateLoadFunctionFromCell(
1603 Handle<JSGlobalPropertyCell> cell, 1645 Handle<Cell> cell,
1604 Handle<JSFunction> function, 1646 Handle<JSFunction> function,
1605 Label* miss) { 1647 Label* miss) {
1606 // Get the value from the cell. 1648 // Get the value from the cell.
1607 __ li(a3, Operand(cell)); 1649 __ li(a3, Operand(cell));
1608 __ lw(a1, FieldMemOperand(a3, JSGlobalPropertyCell::kValueOffset)); 1650 __ lw(a1, FieldMemOperand(a3, Cell::kValueOffset));
1609 1651
1610 // Check that the cell contains the same function. 1652 // Check that the cell contains the same function.
1611 if (heap()->InNewSpace(*function)) { 1653 if (heap()->InNewSpace(*function)) {
1612 // We can't embed a pointer to a function in new space so we have 1654 // We can't embed a pointer to a function in new space so we have
1613 // to verify that the shared function info is unchanged. This has 1655 // to verify that the shared function info is unchanged. This has
1614 // the nice side effect that multiple closures based on the same 1656 // the nice side effect that multiple closures based on the same
1615 // function can all use this call IC. Before we load through the 1657 // function can all use this call IC. Before we load through the
1616 // function, we have to verify that it still is a function. 1658 // function, we have to verify that it still is a function.
1617 __ JumpIfSmi(a1, miss); 1659 __ JumpIfSmi(a1, miss);
1618 __ GetObjectType(a1, a3, a3); 1660 __ GetObjectType(a1, a3, a3);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
1668 GenerateMissBranch(); 1710 GenerateMissBranch();
1669 1711
1670 // Return the generated code. 1712 // Return the generated code.
1671 return GetCode(Code::FIELD, name); 1713 return GetCode(Code::FIELD, name);
1672 } 1714 }
1673 1715
1674 1716
1675 Handle<Code> CallStubCompiler::CompileArrayPushCall( 1717 Handle<Code> CallStubCompiler::CompileArrayPushCall(
1676 Handle<Object> object, 1718 Handle<Object> object,
1677 Handle<JSObject> holder, 1719 Handle<JSObject> holder,
1678 Handle<JSGlobalPropertyCell> cell, 1720 Handle<Cell> cell,
1679 Handle<JSFunction> function, 1721 Handle<JSFunction> function,
1680 Handle<String> name) { 1722 Handle<String> name) {
1681 // ----------- S t a t e ------------- 1723 // ----------- S t a t e -------------
1682 // -- a2 : name 1724 // -- a2 : name
1683 // -- ra : return address 1725 // -- ra : return address
1684 // -- sp[(argc - n - 1) * 4] : arg[n] (zero-based) 1726 // -- sp[(argc - n - 1) * 4] : arg[n] (zero-based)
1685 // -- ... 1727 // -- ...
1686 // -- sp[argc * 4] : receiver 1728 // -- sp[argc * 4] : receiver
1687 // ----------------------------------- 1729 // -----------------------------------
1688 1730
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
1922 GenerateMissBranch(); 1964 GenerateMissBranch();
1923 1965
1924 // Return the generated code. 1966 // Return the generated code.
1925 return GetCode(function); 1967 return GetCode(function);
1926 } 1968 }
1927 1969
1928 1970
1929 Handle<Code> CallStubCompiler::CompileArrayPopCall( 1971 Handle<Code> CallStubCompiler::CompileArrayPopCall(
1930 Handle<Object> object, 1972 Handle<Object> object,
1931 Handle<JSObject> holder, 1973 Handle<JSObject> holder,
1932 Handle<JSGlobalPropertyCell> cell, 1974 Handle<Cell> cell,
1933 Handle<JSFunction> function, 1975 Handle<JSFunction> function,
1934 Handle<String> name) { 1976 Handle<String> name) {
1935 // ----------- S t a t e ------------- 1977 // ----------- S t a t e -------------
1936 // -- a2 : name 1978 // -- a2 : name
1937 // -- ra : return address 1979 // -- ra : return address
1938 // -- sp[(argc - n - 1) * 4] : arg[n] (zero-based) 1980 // -- sp[(argc - n - 1) * 4] : arg[n] (zero-based)
1939 // -- ... 1981 // -- ...
1940 // -- sp[argc * 4] : receiver 1982 // -- sp[argc * 4] : receiver
1941 // ----------------------------------- 1983 // -----------------------------------
1942 1984
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
2004 GenerateMissBranch(); 2046 GenerateMissBranch();
2005 2047
2006 // Return the generated code. 2048 // Return the generated code.
2007 return GetCode(function); 2049 return GetCode(function);
2008 } 2050 }
2009 2051
2010 2052
2011 Handle<Code> CallStubCompiler::CompileStringCharCodeAtCall( 2053 Handle<Code> CallStubCompiler::CompileStringCharCodeAtCall(
2012 Handle<Object> object, 2054 Handle<Object> object,
2013 Handle<JSObject> holder, 2055 Handle<JSObject> holder,
2014 Handle<JSGlobalPropertyCell> cell, 2056 Handle<Cell> cell,
2015 Handle<JSFunction> function, 2057 Handle<JSFunction> function,
2016 Handle<String> name) { 2058 Handle<String> name) {
2017 // ----------- S t a t e ------------- 2059 // ----------- S t a t e -------------
2018 // -- a2 : function name 2060 // -- a2 : function name
2019 // -- ra : return address 2061 // -- ra : return address
2020 // -- sp[(argc - n - 1) * 4] : arg[n] (zero-based) 2062 // -- sp[(argc - n - 1) * 4] : arg[n] (zero-based)
2021 // -- ... 2063 // -- ...
2022 // -- sp[argc * 4] : receiver 2064 // -- sp[argc * 4] : receiver
2023 // ----------------------------------- 2065 // -----------------------------------
2024 2066
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
2086 GenerateMissBranch(); 2128 GenerateMissBranch();
2087 2129
2088 // Return the generated code. 2130 // Return the generated code.
2089 return GetCode(function); 2131 return GetCode(function);
2090 } 2132 }
2091 2133
2092 2134
2093 Handle<Code> CallStubCompiler::CompileStringCharAtCall( 2135 Handle<Code> CallStubCompiler::CompileStringCharAtCall(
2094 Handle<Object> object, 2136 Handle<Object> object,
2095 Handle<JSObject> holder, 2137 Handle<JSObject> holder,
2096 Handle<JSGlobalPropertyCell> cell, 2138 Handle<Cell> cell,
2097 Handle<JSFunction> function, 2139 Handle<JSFunction> function,
2098 Handle<String> name) { 2140 Handle<String> name) {
2099 // ----------- S t a t e ------------- 2141 // ----------- S t a t e -------------
2100 // -- a2 : function name 2142 // -- a2 : function name
2101 // -- ra : return address 2143 // -- ra : return address
2102 // -- sp[(argc - n - 1) * 4] : arg[n] (zero-based) 2144 // -- sp[(argc - n - 1) * 4] : arg[n] (zero-based)
2103 // -- ... 2145 // -- ...
2104 // -- sp[argc * 4] : receiver 2146 // -- sp[argc * 4] : receiver
2105 // ----------------------------------- 2147 // -----------------------------------
2106 2148
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
2167 GenerateMissBranch(); 2209 GenerateMissBranch();
2168 2210
2169 // Return the generated code. 2211 // Return the generated code.
2170 return GetCode(function); 2212 return GetCode(function);
2171 } 2213 }
2172 2214
2173 2215
2174 Handle<Code> CallStubCompiler::CompileStringFromCharCodeCall( 2216 Handle<Code> CallStubCompiler::CompileStringFromCharCodeCall(
2175 Handle<Object> object, 2217 Handle<Object> object,
2176 Handle<JSObject> holder, 2218 Handle<JSObject> holder,
2177 Handle<JSGlobalPropertyCell> cell, 2219 Handle<Cell> cell,
2178 Handle<JSFunction> function, 2220 Handle<JSFunction> function,
2179 Handle<String> name) { 2221 Handle<String> name) {
2180 // ----------- S t a t e ------------- 2222 // ----------- S t a t e -------------
2181 // -- a2 : function name 2223 // -- a2 : function name
2182 // -- ra : return address 2224 // -- ra : return address
2183 // -- sp[(argc - n - 1) * 4] : arg[n] (zero-based) 2225 // -- sp[(argc - n - 1) * 4] : arg[n] (zero-based)
2184 // -- ... 2226 // -- ...
2185 // -- sp[argc * 4] : receiver 2227 // -- sp[argc * 4] : receiver
2186 // ----------------------------------- 2228 // -----------------------------------
2187 2229
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
2240 GenerateMissBranch(); 2282 GenerateMissBranch();
2241 2283
2242 // Return the generated code. 2284 // Return the generated code.
2243 return cell.is_null() ? GetCode(function) : GetCode(Code::NORMAL, name); 2285 return cell.is_null() ? GetCode(function) : GetCode(Code::NORMAL, name);
2244 } 2286 }
2245 2287
2246 2288
2247 Handle<Code> CallStubCompiler::CompileMathFloorCall( 2289 Handle<Code> CallStubCompiler::CompileMathFloorCall(
2248 Handle<Object> object, 2290 Handle<Object> object,
2249 Handle<JSObject> holder, 2291 Handle<JSObject> holder,
2250 Handle<JSGlobalPropertyCell> cell, 2292 Handle<Cell> cell,
2251 Handle<JSFunction> function, 2293 Handle<JSFunction> function,
2252 Handle<String> name) { 2294 Handle<String> name) {
2253 // ----------- S t a t e ------------- 2295 // ----------- S t a t e -------------
2254 // -- a2 : function name 2296 // -- a2 : function name
2255 // -- ra : return address 2297 // -- ra : return address
2256 // -- sp[(argc - n - 1) * 4] : arg[n] (zero-based) 2298 // -- sp[(argc - n - 1) * 4] : arg[n] (zero-based)
2257 // -- ... 2299 // -- ...
2258 // -- sp[argc * 4] : receiver 2300 // -- sp[argc * 4] : receiver
2259 // ----------------------------------- 2301 // -----------------------------------
2260 2302
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
2369 GenerateMissBranch(); 2411 GenerateMissBranch();
2370 2412
2371 // Return the generated code. 2413 // Return the generated code.
2372 return cell.is_null() ? GetCode(function) : GetCode(Code::NORMAL, name); 2414 return cell.is_null() ? GetCode(function) : GetCode(Code::NORMAL, name);
2373 } 2415 }
2374 2416
2375 2417
2376 Handle<Code> CallStubCompiler::CompileMathAbsCall( 2418 Handle<Code> CallStubCompiler::CompileMathAbsCall(
2377 Handle<Object> object, 2419 Handle<Object> object,
2378 Handle<JSObject> holder, 2420 Handle<JSObject> holder,
2379 Handle<JSGlobalPropertyCell> cell, 2421 Handle<Cell> cell,
2380 Handle<JSFunction> function, 2422 Handle<JSFunction> function,
2381 Handle<String> name) { 2423 Handle<String> name) {
2382 // ----------- S t a t e ------------- 2424 // ----------- S t a t e -------------
2383 // -- a2 : function name 2425 // -- a2 : function name
2384 // -- ra : return address 2426 // -- ra : return address
2385 // -- sp[(argc - n - 1) * 4] : arg[n] (zero-based) 2427 // -- sp[(argc - n - 1) * 4] : arg[n] (zero-based)
2386 // -- ... 2428 // -- ...
2387 // -- sp[argc * 4] : receiver 2429 // -- sp[argc * 4] : receiver
2388 // ----------------------------------- 2430 // -----------------------------------
2389 2431
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
2469 2511
2470 // Return the generated code. 2512 // Return the generated code.
2471 return cell.is_null() ? GetCode(function) : GetCode(Code::NORMAL, name); 2513 return cell.is_null() ? GetCode(function) : GetCode(Code::NORMAL, name);
2472 } 2514 }
2473 2515
2474 2516
2475 Handle<Code> CallStubCompiler::CompileFastApiCall( 2517 Handle<Code> CallStubCompiler::CompileFastApiCall(
2476 const CallOptimization& optimization, 2518 const CallOptimization& optimization,
2477 Handle<Object> object, 2519 Handle<Object> object,
2478 Handle<JSObject> holder, 2520 Handle<JSObject> holder,
2479 Handle<JSGlobalPropertyCell> cell, 2521 Handle<Cell> cell,
2480 Handle<JSFunction> function, 2522 Handle<JSFunction> function,
2481 Handle<String> name) { 2523 Handle<String> name) {
2482 2524
2483 Counters* counters = isolate()->counters(); 2525 Counters* counters = isolate()->counters();
2484 2526
2485 ASSERT(optimization.is_simple_api_call()); 2527 ASSERT(optimization.is_simple_api_call());
2486 // Bail out if object is a global object as we don't want to 2528 // Bail out if object is a global object as we don't want to
2487 // repatch it to global receiver. 2529 // repatch it to global receiver.
2488 if (object->IsGlobalObject()) return Handle<Code>::null(); 2530 if (object->IsGlobalObject()) return Handle<Code>::null();
2489 if (!cell.is_null()) return Handle<Code>::null(); 2531 if (!cell.is_null()) return Handle<Code>::null();
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
2642 2684
2643 2685
2644 Handle<Code> CallStubCompiler::CompileCallConstant( 2686 Handle<Code> CallStubCompiler::CompileCallConstant(
2645 Handle<Object> object, 2687 Handle<Object> object,
2646 Handle<JSObject> holder, 2688 Handle<JSObject> holder,
2647 Handle<Name> name, 2689 Handle<Name> name,
2648 CheckType check, 2690 CheckType check,
2649 Handle<JSFunction> function) { 2691 Handle<JSFunction> function) {
2650 if (HasCustomCallGenerator(function)) { 2692 if (HasCustomCallGenerator(function)) {
2651 Handle<Code> code = CompileCustomCall(object, holder, 2693 Handle<Code> code = CompileCustomCall(object, holder,
2652 Handle<JSGlobalPropertyCell>::null(), 2694 Handle<Cell>::null(),
2653 function, Handle<String>::cast(name)); 2695 function, Handle<String>::cast(name));
2654 // A null handle means bail out to the regular compiler code below. 2696 // A null handle means bail out to the regular compiler code below.
2655 if (!code.is_null()) return code; 2697 if (!code.is_null()) return code;
2656 } 2698 }
2657 2699
2658 Label success; 2700 Label success;
2659 2701
2660 CompileHandlerFrontend(object, holder, name, check, &success); 2702 CompileHandlerFrontend(object, holder, name, check, &success);
2661 __ bind(&success); 2703 __ bind(&success);
2662 CompileHandlerBackend(function); 2704 CompileHandlerBackend(function);
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
2702 GenerateMissBranch(); 2744 GenerateMissBranch();
2703 2745
2704 // Return the generated code. 2746 // Return the generated code.
2705 return GetCode(Code::INTERCEPTOR, name); 2747 return GetCode(Code::INTERCEPTOR, name);
2706 } 2748 }
2707 2749
2708 2750
2709 Handle<Code> CallStubCompiler::CompileCallGlobal( 2751 Handle<Code> CallStubCompiler::CompileCallGlobal(
2710 Handle<JSObject> object, 2752 Handle<JSObject> object,
2711 Handle<GlobalObject> holder, 2753 Handle<GlobalObject> holder,
2712 Handle<JSGlobalPropertyCell> cell, 2754 Handle<PropertyCell> cell,
2713 Handle<JSFunction> function, 2755 Handle<JSFunction> function,
2714 Handle<Name> name) { 2756 Handle<Name> name) {
2715 // ----------- S t a t e ------------- 2757 // ----------- S t a t e -------------
2716 // -- a2 : name 2758 // -- a2 : name
2717 // -- ra : return address 2759 // -- ra : return address
2718 // ----------------------------------- 2760 // -----------------------------------
2719 2761
2720 if (HasCustomCallGenerator(function)) { 2762 if (HasCustomCallGenerator(function)) {
2721 Handle<Code> code = CompileCustomCall( 2763 Handle<Code> code = CompileCustomCall(
2722 object, holder, cell, function, Handle<String>::cast(name)); 2764 object, holder, cell, function, Handle<String>::cast(name));
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
2878 __ bind(&miss); 2920 __ bind(&miss);
2879 TailCallBuiltin(masm(), MissBuiltin(kind())); 2921 TailCallBuiltin(masm(), MissBuiltin(kind()));
2880 2922
2881 // Return the generated code. 2923 // Return the generated code.
2882 return GetICCode(kind(), Code::INTERCEPTOR, name); 2924 return GetICCode(kind(), Code::INTERCEPTOR, name);
2883 } 2925 }
2884 2926
2885 2927
2886 Handle<Code> StoreStubCompiler::CompileStoreGlobal( 2928 Handle<Code> StoreStubCompiler::CompileStoreGlobal(
2887 Handle<GlobalObject> object, 2929 Handle<GlobalObject> object,
2888 Handle<JSGlobalPropertyCell> cell, 2930 Handle<PropertyCell> cell,
2889 Handle<Name> name) { 2931 Handle<Name> name) {
2890 Label miss; 2932 Label miss;
2891 2933
2892 // Check that the map of the global has not changed. 2934 // Check that the map of the global has not changed.
2893 __ lw(scratch1(), FieldMemOperand(receiver(), HeapObject::kMapOffset)); 2935 __ lw(scratch1(), FieldMemOperand(receiver(), HeapObject::kMapOffset));
2894 __ Branch(&miss, ne, scratch1(), Operand(Handle<Map>(object->map()))); 2936 __ Branch(&miss, ne, scratch1(), Operand(Handle<Map>(object->map())));
2895 2937
2896 // Check that the value in the cell is not the hole. If it is, this 2938 // Check that the value in the cell is not the hole. If it is, this
2897 // cell could have been deleted and reintroducing the global needs 2939 // cell could have been deleted and reintroducing the global needs
2898 // to update the property details in the property dictionary of the 2940 // to update the property details in the property dictionary of the
2899 // global object. We bail out to the runtime system to do that. 2941 // global object. We bail out to the runtime system to do that.
2900 __ li(scratch1(), Operand(cell)); 2942 __ li(scratch1(), Operand(cell));
2901 __ LoadRoot(scratch2(), Heap::kTheHoleValueRootIndex); 2943 __ LoadRoot(scratch2(), Heap::kTheHoleValueRootIndex);
2902 __ lw(scratch3(), 2944 __ lw(scratch3(), FieldMemOperand(scratch1(), Cell::kValueOffset));
2903 FieldMemOperand(scratch1(), JSGlobalPropertyCell::kValueOffset));
2904 __ Branch(&miss, eq, scratch3(), Operand(scratch2())); 2945 __ Branch(&miss, eq, scratch3(), Operand(scratch2()));
2905 2946
2906 // Store the value in the cell. 2947 // Store the value in the cell.
2907 __ sw(value(), 2948 __ sw(value(), FieldMemOperand(scratch1(), Cell::kValueOffset));
2908 FieldMemOperand(scratch1(), JSGlobalPropertyCell::kValueOffset));
2909 __ mov(v0, a0); // Stored value must be returned in v0. 2949 __ mov(v0, a0); // Stored value must be returned in v0.
2910 // Cells are always rescanned, so no write barrier here. 2950 // Cells are always rescanned, so no write barrier here.
2911 2951
2912 Counters* counters = isolate()->counters(); 2952 Counters* counters = isolate()->counters();
2913 __ IncrementCounter( 2953 __ IncrementCounter(
2914 counters->named_store_global_inline(), 1, scratch1(), scratch2()); 2954 counters->named_store_global_inline(), 1, scratch1(), scratch2());
2915 __ Ret(); 2955 __ Ret();
2916 2956
2917 // Handle store cache miss. 2957 // Handle store cache miss.
2918 __ bind(&miss); 2958 __ bind(&miss);
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
3020 } 3060 }
3021 3061
3022 3062
3023 #undef __ 3063 #undef __
3024 #define __ ACCESS_MASM(masm()) 3064 #define __ ACCESS_MASM(masm())
3025 3065
3026 3066
3027 Handle<Code> LoadStubCompiler::CompileLoadGlobal( 3067 Handle<Code> LoadStubCompiler::CompileLoadGlobal(
3028 Handle<JSObject> object, 3068 Handle<JSObject> object,
3029 Handle<GlobalObject> global, 3069 Handle<GlobalObject> global,
3030 Handle<JSGlobalPropertyCell> cell, 3070 Handle<PropertyCell> cell,
3031 Handle<Name> name, 3071 Handle<Name> name,
3032 bool is_dont_delete) { 3072 bool is_dont_delete) {
3033 Label success, miss; 3073 Label success, miss;
3034 3074
3035 __ CheckMap( 3075 __ CheckMap(
3036 receiver(), scratch1(), Handle<Map>(object->map()), &miss, DO_SMI_CHECK); 3076 receiver(), scratch1(), Handle<Map>(object->map()), &miss, DO_SMI_CHECK);
3037 HandlerFrontendHeader( 3077 HandlerFrontendHeader(
3038 object, receiver(), Handle<JSObject>::cast(global), name, &miss); 3078 object, receiver(), Handle<JSObject>::cast(global), name, &miss);
3039 3079
3040 // Get the value from the cell. 3080 // Get the value from the cell.
3041 __ li(a3, Operand(cell)); 3081 __ li(a3, Operand(cell));
3042 __ lw(t0, FieldMemOperand(a3, JSGlobalPropertyCell::kValueOffset)); 3082 __ lw(t0, FieldMemOperand(a3, Cell::kValueOffset));
3043 3083
3044 // Check for deleted property if property can actually be deleted. 3084 // Check for deleted property if property can actually be deleted.
3045 if (!is_dont_delete) { 3085 if (!is_dont_delete) {
3046 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); 3086 __ LoadRoot(at, Heap::kTheHoleValueRootIndex);
3047 __ Branch(&miss, eq, t0, Operand(at)); 3087 __ Branch(&miss, eq, t0, Operand(at));
3048 } 3088 }
3049 3089
3050 HandlerFrontendFooter(&success, &miss); 3090 HandlerFrontendFooter(&success, &miss);
3051 __ bind(&success); 3091 __ bind(&success);
3052 3092
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after
3738 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Slow); 3778 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Slow);
3739 } 3779 }
3740 } 3780 }
3741 3781
3742 3782
3743 #undef __ 3783 #undef __
3744 3784
3745 } } // namespace v8::internal 3785 } } // namespace v8::internal
3746 3786
3747 #endif // V8_TARGET_ARCH_MIPS 3787 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/simulator-mips.cc ('k') | src/mksnapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698