| 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 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 } | 548 } |
| 549 | 549 |
| 550 | 550 |
| 551 static void PushInterceptorArguments(MacroAssembler* masm, | 551 static void PushInterceptorArguments(MacroAssembler* masm, |
| 552 Register receiver, | 552 Register receiver, |
| 553 Register holder, | 553 Register holder, |
| 554 Register name, | 554 Register name, |
| 555 JSObject* holder_obj) { | 555 JSObject* holder_obj) { |
| 556 __ push(name); | 556 __ push(name); |
| 557 InterceptorInfo* interceptor = holder_obj->GetNamedInterceptor(); | 557 InterceptorInfo* interceptor = holder_obj->GetNamedInterceptor(); |
| 558 ASSERT(!HEAP->InNewSpace(interceptor)); | 558 ASSERT(!masm->isolate()->heap()->InNewSpace(interceptor)); |
| 559 Register scratch = name; | 559 Register scratch = name; |
| 560 __ mov(scratch, Operand(Handle<Object>(interceptor))); | 560 __ mov(scratch, Operand(Handle<Object>(interceptor))); |
| 561 __ push(scratch); | 561 __ push(scratch); |
| 562 __ push(receiver); | 562 __ push(receiver); |
| 563 __ push(holder); | 563 __ push(holder); |
| 564 __ ldr(scratch, FieldMemOperand(scratch, InterceptorInfo::kDataOffset)); | 564 __ ldr(scratch, FieldMemOperand(scratch, InterceptorInfo::kDataOffset)); |
| 565 __ push(scratch); | 565 __ push(scratch); |
| 566 } | 566 } |
| 567 | 567 |
| 568 | 568 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 617 // -- sp[(argc + 4) * 4] : receiver | 617 // -- sp[(argc + 4) * 4] : receiver |
| 618 // ----------------------------------- | 618 // ----------------------------------- |
| 619 // Get the function and setup the context. | 619 // Get the function and setup the context. |
| 620 JSFunction* function = optimization.constant_function(); | 620 JSFunction* function = optimization.constant_function(); |
| 621 __ mov(r5, Operand(Handle<JSFunction>(function))); | 621 __ mov(r5, Operand(Handle<JSFunction>(function))); |
| 622 __ ldr(cp, FieldMemOperand(r5, JSFunction::kContextOffset)); | 622 __ ldr(cp, FieldMemOperand(r5, JSFunction::kContextOffset)); |
| 623 | 623 |
| 624 // Pass the additional arguments FastHandleApiCall expects. | 624 // Pass the additional arguments FastHandleApiCall expects. |
| 625 Object* call_data = optimization.api_call_info()->data(); | 625 Object* call_data = optimization.api_call_info()->data(); |
| 626 Handle<CallHandlerInfo> api_call_info_handle(optimization.api_call_info()); | 626 Handle<CallHandlerInfo> api_call_info_handle(optimization.api_call_info()); |
| 627 if (HEAP->InNewSpace(call_data)) { | 627 if (masm->isolate()->heap()->InNewSpace(call_data)) { |
| 628 __ Move(r0, api_call_info_handle); | 628 __ Move(r0, api_call_info_handle); |
| 629 __ ldr(r6, FieldMemOperand(r0, CallHandlerInfo::kDataOffset)); | 629 __ ldr(r6, FieldMemOperand(r0, CallHandlerInfo::kDataOffset)); |
| 630 } else { | 630 } else { |
| 631 __ Move(r6, Handle<Object>(call_data)); | 631 __ Move(r6, Handle<Object>(call_data)); |
| 632 } | 632 } |
| 633 // Store js function and call data. | 633 // Store js function and call data. |
| 634 __ stm(ib, sp, r5.bit() | r6.bit()); | 634 __ stm(ib, sp, r5.bit() | r6.bit()); |
| 635 | 635 |
| 636 // r2 points to call data as expected by Arguments | 636 // r2 points to call data as expected by Arguments |
| 637 // (refer to layout above). | 637 // (refer to layout above). |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 712 } else { | 712 } else { |
| 713 CompileRegular(masm, | 713 CompileRegular(masm, |
| 714 object, | 714 object, |
| 715 receiver, | 715 receiver, |
| 716 scratch1, | 716 scratch1, |
| 717 scratch2, | 717 scratch2, |
| 718 scratch3, | 718 scratch3, |
| 719 name, | 719 name, |
| 720 holder, | 720 holder, |
| 721 miss); | 721 miss); |
| 722 return HEAP->undefined_value(); | 722 return masm->isolate()->heap()->undefined_value(); |
| 723 } | 723 } |
| 724 } | 724 } |
| 725 | 725 |
| 726 private: | 726 private: |
| 727 MaybeObject* CompileCacheable(MacroAssembler* masm, | 727 MaybeObject* CompileCacheable(MacroAssembler* masm, |
| 728 JSObject* object, | 728 JSObject* object, |
| 729 Register receiver, | 729 Register receiver, |
| 730 Register scratch1, | 730 Register scratch1, |
| 731 Register scratch2, | 731 Register scratch2, |
| 732 Register scratch3, | 732 Register scratch3, |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 815 FreeSpaceForFastApiCall(masm); | 815 FreeSpaceForFastApiCall(masm); |
| 816 __ b(miss_label); | 816 __ b(miss_label); |
| 817 } | 817 } |
| 818 | 818 |
| 819 // Invoke a regular function. | 819 // Invoke a regular function. |
| 820 __ bind(®ular_invoke); | 820 __ bind(®ular_invoke); |
| 821 if (can_do_fast_api_call) { | 821 if (can_do_fast_api_call) { |
| 822 FreeSpaceForFastApiCall(masm); | 822 FreeSpaceForFastApiCall(masm); |
| 823 } | 823 } |
| 824 | 824 |
| 825 return HEAP->undefined_value(); | 825 return masm->isolate()->heap()->undefined_value(); |
| 826 } | 826 } |
| 827 | 827 |
| 828 void CompileRegular(MacroAssembler* masm, | 828 void CompileRegular(MacroAssembler* masm, |
| 829 JSObject* object, | 829 JSObject* object, |
| 830 Register receiver, | 830 Register receiver, |
| 831 Register scratch1, | 831 Register scratch1, |
| 832 Register scratch2, | 832 Register scratch2, |
| 833 Register scratch3, | 833 Register scratch3, |
| 834 String* name, | 834 String* name, |
| 835 JSObject* interceptor_holder, | 835 JSObject* interceptor_holder, |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1084 // Only global objects and objects that do not require access | 1084 // Only global objects and objects that do not require access |
| 1085 // checks are allowed in stubs. | 1085 // checks are allowed in stubs. |
| 1086 ASSERT(current->IsJSGlobalProxy() || !current->IsAccessCheckNeeded()); | 1086 ASSERT(current->IsJSGlobalProxy() || !current->IsAccessCheckNeeded()); |
| 1087 | 1087 |
| 1088 ASSERT(current->GetPrototype()->IsJSObject()); | 1088 ASSERT(current->GetPrototype()->IsJSObject()); |
| 1089 JSObject* prototype = JSObject::cast(current->GetPrototype()); | 1089 JSObject* prototype = JSObject::cast(current->GetPrototype()); |
| 1090 if (!current->HasFastProperties() && | 1090 if (!current->HasFastProperties() && |
| 1091 !current->IsJSGlobalObject() && | 1091 !current->IsJSGlobalObject() && |
| 1092 !current->IsJSGlobalProxy()) { | 1092 !current->IsJSGlobalProxy()) { |
| 1093 if (!name->IsSymbol()) { | 1093 if (!name->IsSymbol()) { |
| 1094 MaybeObject* maybe_lookup_result = HEAP->LookupSymbol(name); | 1094 MaybeObject* maybe_lookup_result = heap()->LookupSymbol(name); |
| 1095 Object* lookup_result = NULL; // Initialization to please compiler. | 1095 Object* lookup_result = NULL; // Initialization to please compiler. |
| 1096 if (!maybe_lookup_result->ToObject(&lookup_result)) { | 1096 if (!maybe_lookup_result->ToObject(&lookup_result)) { |
| 1097 set_failure(Failure::cast(maybe_lookup_result)); | 1097 set_failure(Failure::cast(maybe_lookup_result)); |
| 1098 return reg; | 1098 return reg; |
| 1099 } | 1099 } |
| 1100 name = String::cast(lookup_result); | 1100 name = String::cast(lookup_result); |
| 1101 } | 1101 } |
| 1102 ASSERT(current->property_dictionary()->FindEntry(name) == | 1102 ASSERT(current->property_dictionary()->FindEntry(name) == |
| 1103 StringDictionary::kNotFound); | 1103 StringDictionary::kNotFound); |
| 1104 | 1104 |
| 1105 GenerateDictionaryNegativeLookup(masm(), | 1105 GenerateDictionaryNegativeLookup(masm(), |
| 1106 miss, | 1106 miss, |
| 1107 reg, | 1107 reg, |
| 1108 name, | 1108 name, |
| 1109 scratch1, | 1109 scratch1, |
| 1110 scratch2); | 1110 scratch2); |
| 1111 __ ldr(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset)); | 1111 __ ldr(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset)); |
| 1112 reg = holder_reg; // from now the object is in holder_reg | 1112 reg = holder_reg; // from now the object is in holder_reg |
| 1113 __ ldr(reg, FieldMemOperand(scratch1, Map::kPrototypeOffset)); | 1113 __ ldr(reg, FieldMemOperand(scratch1, Map::kPrototypeOffset)); |
| 1114 } else if (HEAP->InNewSpace(prototype)) { | 1114 } else if (heap()->InNewSpace(prototype)) { |
| 1115 // Get the map of the current object. | 1115 // Get the map of the current object. |
| 1116 __ ldr(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset)); | 1116 __ ldr(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset)); |
| 1117 __ cmp(scratch1, Operand(Handle<Map>(current->map()))); | 1117 __ cmp(scratch1, Operand(Handle<Map>(current->map()))); |
| 1118 | 1118 |
| 1119 // Branch on the result of the map check. | 1119 // Branch on the result of the map check. |
| 1120 __ b(ne, miss); | 1120 __ b(ne, miss); |
| 1121 | 1121 |
| 1122 // Check access rights to the global object. This has to happen | 1122 // Check access rights to the global object. This has to happen |
| 1123 // after the map check so that we know that the object is | 1123 // after the map check so that we know that the object is |
| 1124 // actually a global object. | 1124 // actually a global object. |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1252 // Check that the maps haven't changed. | 1252 // Check that the maps haven't changed. |
| 1253 Register reg = | 1253 Register reg = |
| 1254 CheckPrototypes(object, receiver, holder, scratch1, scratch2, scratch3, | 1254 CheckPrototypes(object, receiver, holder, scratch1, scratch2, scratch3, |
| 1255 name, miss); | 1255 name, miss); |
| 1256 | 1256 |
| 1257 // Build AccessorInfo::args_ list on the stack and push property name below | 1257 // Build AccessorInfo::args_ list on the stack and push property name below |
| 1258 // the exit frame to make GC aware of them and store pointers to them. | 1258 // the exit frame to make GC aware of them and store pointers to them. |
| 1259 __ push(receiver); | 1259 __ push(receiver); |
| 1260 __ mov(scratch2, sp); // scratch2 = AccessorInfo::args_ | 1260 __ mov(scratch2, sp); // scratch2 = AccessorInfo::args_ |
| 1261 Handle<AccessorInfo> callback_handle(callback); | 1261 Handle<AccessorInfo> callback_handle(callback); |
| 1262 if (HEAP->InNewSpace(callback_handle->data())) { | 1262 if (heap()->InNewSpace(callback_handle->data())) { |
| 1263 __ Move(scratch3, callback_handle); | 1263 __ Move(scratch3, callback_handle); |
| 1264 __ ldr(scratch3, FieldMemOperand(scratch3, AccessorInfo::kDataOffset)); | 1264 __ ldr(scratch3, FieldMemOperand(scratch3, AccessorInfo::kDataOffset)); |
| 1265 } else { | 1265 } else { |
| 1266 __ Move(scratch3, Handle<Object>(callback_handle->data())); | 1266 __ Move(scratch3, Handle<Object>(callback_handle->data())); |
| 1267 } | 1267 } |
| 1268 __ Push(reg, scratch3, name_reg); | 1268 __ Push(reg, scratch3, name_reg); |
| 1269 __ mov(r0, sp); // r0 = Handle<String> | 1269 __ mov(r0, sp); // r0 = Handle<String> |
| 1270 | 1270 |
| 1271 Address getter_address = v8::ToCData<Address>(callback->getter()); | 1271 Address getter_address = v8::ToCData<Address>(callback->getter()); |
| 1272 ApiFunction fun(getter_address); | 1272 ApiFunction fun(getter_address); |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1470 | 1470 |
| 1471 | 1471 |
| 1472 void CallStubCompiler::GenerateLoadFunctionFromCell(JSGlobalPropertyCell* cell, | 1472 void CallStubCompiler::GenerateLoadFunctionFromCell(JSGlobalPropertyCell* cell, |
| 1473 JSFunction* function, | 1473 JSFunction* function, |
| 1474 Label* miss) { | 1474 Label* miss) { |
| 1475 // Get the value from the cell. | 1475 // Get the value from the cell. |
| 1476 __ mov(r3, Operand(Handle<JSGlobalPropertyCell>(cell))); | 1476 __ mov(r3, Operand(Handle<JSGlobalPropertyCell>(cell))); |
| 1477 __ ldr(r1, FieldMemOperand(r3, JSGlobalPropertyCell::kValueOffset)); | 1477 __ ldr(r1, FieldMemOperand(r3, JSGlobalPropertyCell::kValueOffset)); |
| 1478 | 1478 |
| 1479 // Check that the cell contains the same function. | 1479 // Check that the cell contains the same function. |
| 1480 if (HEAP->InNewSpace(function)) { | 1480 if (heap()->InNewSpace(function)) { |
| 1481 // We can't embed a pointer to a function in new space so we have | 1481 // We can't embed a pointer to a function in new space so we have |
| 1482 // to verify that the shared function info is unchanged. This has | 1482 // to verify that the shared function info is unchanged. This has |
| 1483 // the nice side effect that multiple closures based on the same | 1483 // the nice side effect that multiple closures based on the same |
| 1484 // function can all use this call IC. Before we load through the | 1484 // function can all use this call IC. Before we load through the |
| 1485 // function, we have to verify that it still is a function. | 1485 // function, we have to verify that it still is a function. |
| 1486 __ tst(r1, Operand(kSmiTagMask)); | 1486 __ tst(r1, Operand(kSmiTagMask)); |
| 1487 __ b(eq, miss); | 1487 __ b(eq, miss); |
| 1488 __ CompareObjectType(r1, r3, r3, JS_FUNCTION_TYPE); | 1488 __ CompareObjectType(r1, r3, r3, JS_FUNCTION_TYPE); |
| 1489 __ b(ne, miss); | 1489 __ b(ne, miss); |
| 1490 | 1490 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1553 String* name) { | 1553 String* name) { |
| 1554 // ----------- S t a t e ------------- | 1554 // ----------- S t a t e ------------- |
| 1555 // -- r2 : name | 1555 // -- r2 : name |
| 1556 // -- lr : return address | 1556 // -- lr : return address |
| 1557 // -- sp[(argc - n - 1) * 4] : arg[n] (zero-based) | 1557 // -- sp[(argc - n - 1) * 4] : arg[n] (zero-based) |
| 1558 // -- ... | 1558 // -- ... |
| 1559 // -- sp[argc * 4] : receiver | 1559 // -- sp[argc * 4] : receiver |
| 1560 // ----------------------------------- | 1560 // ----------------------------------- |
| 1561 | 1561 |
| 1562 // If object is not an array, bail out to regular call. | 1562 // If object is not an array, bail out to regular call. |
| 1563 if (!object->IsJSArray() || cell != NULL) return HEAP->undefined_value(); | 1563 if (!object->IsJSArray() || cell != NULL) return heap()->undefined_value(); |
| 1564 | 1564 |
| 1565 Label miss; | 1565 Label miss; |
| 1566 | 1566 |
| 1567 GenerateNameCheck(name, &miss); | 1567 GenerateNameCheck(name, &miss); |
| 1568 | 1568 |
| 1569 Register receiver = r1; | 1569 Register receiver = r1; |
| 1570 | 1570 |
| 1571 // Get the receiver from the stack | 1571 // Get the receiver from the stack |
| 1572 const int argc = arguments().immediate(); | 1572 const int argc = arguments().immediate(); |
| 1573 __ ldr(receiver, MemOperand(sp, argc * kPointerSize)); | 1573 __ ldr(receiver, MemOperand(sp, argc * kPointerSize)); |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1713 String* name) { | 1713 String* name) { |
| 1714 // ----------- S t a t e ------------- | 1714 // ----------- S t a t e ------------- |
| 1715 // -- r2 : name | 1715 // -- r2 : name |
| 1716 // -- lr : return address | 1716 // -- lr : return address |
| 1717 // -- sp[(argc - n - 1) * 4] : arg[n] (zero-based) | 1717 // -- sp[(argc - n - 1) * 4] : arg[n] (zero-based) |
| 1718 // -- ... | 1718 // -- ... |
| 1719 // -- sp[argc * 4] : receiver | 1719 // -- sp[argc * 4] : receiver |
| 1720 // ----------------------------------- | 1720 // ----------------------------------- |
| 1721 | 1721 |
| 1722 // If object is not an array, bail out to regular call. | 1722 // If object is not an array, bail out to regular call. |
| 1723 if (!object->IsJSArray() || cell != NULL) return HEAP->undefined_value(); | 1723 if (!object->IsJSArray() || cell != NULL) return heap()->undefined_value(); |
| 1724 | 1724 |
| 1725 Label miss, return_undefined, call_builtin; | 1725 Label miss, return_undefined, call_builtin; |
| 1726 | 1726 |
| 1727 Register receiver = r1; | 1727 Register receiver = r1; |
| 1728 Register elements = r3; | 1728 Register elements = r3; |
| 1729 | 1729 |
| 1730 GenerateNameCheck(name, &miss); | 1730 GenerateNameCheck(name, &miss); |
| 1731 | 1731 |
| 1732 // Get the receiver from the stack | 1732 // Get the receiver from the stack |
| 1733 const int argc = arguments().immediate(); | 1733 const int argc = arguments().immediate(); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1799 String* name) { | 1799 String* name) { |
| 1800 // ----------- S t a t e ------------- | 1800 // ----------- S t a t e ------------- |
| 1801 // -- r2 : function name | 1801 // -- r2 : function name |
| 1802 // -- lr : return address | 1802 // -- lr : return address |
| 1803 // -- sp[(argc - n - 1) * 4] : arg[n] (zero-based) | 1803 // -- sp[(argc - n - 1) * 4] : arg[n] (zero-based) |
| 1804 // -- ... | 1804 // -- ... |
| 1805 // -- sp[argc * 4] : receiver | 1805 // -- sp[argc * 4] : receiver |
| 1806 // ----------------------------------- | 1806 // ----------------------------------- |
| 1807 | 1807 |
| 1808 // If object is not a string, bail out to regular call. | 1808 // If object is not a string, bail out to regular call. |
| 1809 if (!object->IsString() || cell != NULL) return HEAP->undefined_value(); | 1809 if (!object->IsString() || cell != NULL) return heap()->undefined_value(); |
| 1810 | 1810 |
| 1811 const int argc = arguments().immediate(); | 1811 const int argc = arguments().immediate(); |
| 1812 | 1812 |
| 1813 Label miss; | 1813 Label miss; |
| 1814 Label name_miss; | 1814 Label name_miss; |
| 1815 Label index_out_of_range; | 1815 Label index_out_of_range; |
| 1816 Label* index_out_of_range_label = &index_out_of_range; | 1816 Label* index_out_of_range_label = &index_out_of_range; |
| 1817 | 1817 |
| 1818 if (kind_ == Code::CALL_IC && extra_ic_state_ == DEFAULT_STRING_STUB) { | 1818 if (kind_ == Code::CALL_IC && extra_ic_state_ == DEFAULT_STRING_STUB) { |
| 1819 index_out_of_range_label = &miss; | 1819 index_out_of_range_label = &miss; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1883 String* name) { | 1883 String* name) { |
| 1884 // ----------- S t a t e ------------- | 1884 // ----------- S t a t e ------------- |
| 1885 // -- r2 : function name | 1885 // -- r2 : function name |
| 1886 // -- lr : return address | 1886 // -- lr : return address |
| 1887 // -- sp[(argc - n - 1) * 4] : arg[n] (zero-based) | 1887 // -- sp[(argc - n - 1) * 4] : arg[n] (zero-based) |
| 1888 // -- ... | 1888 // -- ... |
| 1889 // -- sp[argc * 4] : receiver | 1889 // -- sp[argc * 4] : receiver |
| 1890 // ----------------------------------- | 1890 // ----------------------------------- |
| 1891 | 1891 |
| 1892 // If object is not a string, bail out to regular call. | 1892 // If object is not a string, bail out to regular call. |
| 1893 if (!object->IsString() || cell != NULL) return HEAP->undefined_value(); | 1893 if (!object->IsString() || cell != NULL) return heap()->undefined_value(); |
| 1894 | 1894 |
| 1895 const int argc = arguments().immediate(); | 1895 const int argc = arguments().immediate(); |
| 1896 | 1896 |
| 1897 Label miss; | 1897 Label miss; |
| 1898 Label name_miss; | 1898 Label name_miss; |
| 1899 Label index_out_of_range; | 1899 Label index_out_of_range; |
| 1900 Label* index_out_of_range_label = &index_out_of_range; | 1900 Label* index_out_of_range_label = &index_out_of_range; |
| 1901 | 1901 |
| 1902 if (kind_ == Code::CALL_IC && extra_ic_state_ == DEFAULT_STRING_STUB) { | 1902 if (kind_ == Code::CALL_IC && extra_ic_state_ == DEFAULT_STRING_STUB) { |
| 1903 index_out_of_range_label = &miss; | 1903 index_out_of_range_label = &miss; |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1972 // -- lr : return address | 1972 // -- lr : return address |
| 1973 // -- sp[(argc - n - 1) * 4] : arg[n] (zero-based) | 1973 // -- sp[(argc - n - 1) * 4] : arg[n] (zero-based) |
| 1974 // -- ... | 1974 // -- ... |
| 1975 // -- sp[argc * 4] : receiver | 1975 // -- sp[argc * 4] : receiver |
| 1976 // ----------------------------------- | 1976 // ----------------------------------- |
| 1977 | 1977 |
| 1978 const int argc = arguments().immediate(); | 1978 const int argc = arguments().immediate(); |
| 1979 | 1979 |
| 1980 // If the object is not a JSObject or we got an unexpected number of | 1980 // If the object is not a JSObject or we got an unexpected number of |
| 1981 // arguments, bail out to the regular call. | 1981 // arguments, bail out to the regular call. |
| 1982 if (!object->IsJSObject() || argc != 1) return HEAP->undefined_value(); | 1982 if (!object->IsJSObject() || argc != 1) return heap()->undefined_value(); |
| 1983 | 1983 |
| 1984 Label miss; | 1984 Label miss; |
| 1985 GenerateNameCheck(name, &miss); | 1985 GenerateNameCheck(name, &miss); |
| 1986 | 1986 |
| 1987 if (cell == NULL) { | 1987 if (cell == NULL) { |
| 1988 __ ldr(r1, MemOperand(sp, 1 * kPointerSize)); | 1988 __ ldr(r1, MemOperand(sp, 1 * kPointerSize)); |
| 1989 | 1989 |
| 1990 STATIC_ASSERT(kSmiTag == 0); | 1990 STATIC_ASSERT(kSmiTag == 0); |
| 1991 __ tst(r1, Operand(kSmiTagMask)); | 1991 __ tst(r1, Operand(kSmiTagMask)); |
| 1992 __ b(eq, &miss); | 1992 __ b(eq, &miss); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2041 JSFunction* function, | 2041 JSFunction* function, |
| 2042 String* name) { | 2042 String* name) { |
| 2043 // ----------- S t a t e ------------- | 2043 // ----------- S t a t e ------------- |
| 2044 // -- r2 : function name | 2044 // -- r2 : function name |
| 2045 // -- lr : return address | 2045 // -- lr : return address |
| 2046 // -- sp[(argc - n - 1) * 4] : arg[n] (zero-based) | 2046 // -- sp[(argc - n - 1) * 4] : arg[n] (zero-based) |
| 2047 // -- ... | 2047 // -- ... |
| 2048 // -- sp[argc * 4] : receiver | 2048 // -- sp[argc * 4] : receiver |
| 2049 // ----------------------------------- | 2049 // ----------------------------------- |
| 2050 | 2050 |
| 2051 if (!masm()->isolate()->cpu_features()->IsSupported(VFP3)) | 2051 if (!masm()->isolate()->cpu_features()->IsSupported(VFP3)) { |
| 2052 return HEAP->undefined_value(); | 2052 return heap()->undefined_value(); |
| 2053 } |
| 2053 | 2054 |
| 2054 CpuFeatures::Scope scope_vfp3(VFP3); | 2055 CpuFeatures::Scope scope_vfp3(VFP3); |
| 2055 | 2056 |
| 2056 const int argc = arguments().immediate(); | 2057 const int argc = arguments().immediate(); |
| 2057 | 2058 |
| 2058 // If the object is not a JSObject or we got an unexpected number of | 2059 // If the object is not a JSObject or we got an unexpected number of |
| 2059 // arguments, bail out to the regular call. | 2060 // arguments, bail out to the regular call. |
| 2060 if (!object->IsJSObject() || argc != 1) return HEAP->undefined_value(); | 2061 if (!object->IsJSObject() || argc != 1) return heap()->undefined_value(); |
| 2061 | 2062 |
| 2062 Label miss, slow; | 2063 Label miss, slow; |
| 2063 GenerateNameCheck(name, &miss); | 2064 GenerateNameCheck(name, &miss); |
| 2064 | 2065 |
| 2065 if (cell == NULL) { | 2066 if (cell == NULL) { |
| 2066 __ ldr(r1, MemOperand(sp, 1 * kPointerSize)); | 2067 __ ldr(r1, MemOperand(sp, 1 * kPointerSize)); |
| 2067 | 2068 |
| 2068 STATIC_ASSERT(kSmiTag == 0); | 2069 STATIC_ASSERT(kSmiTag == 0); |
| 2069 __ JumpIfSmi(r1, &miss); | 2070 __ JumpIfSmi(r1, &miss); |
| 2070 | 2071 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2192 // -- lr : return address | 2193 // -- lr : return address |
| 2193 // -- sp[(argc - n - 1) * 4] : arg[n] (zero-based) | 2194 // -- sp[(argc - n - 1) * 4] : arg[n] (zero-based) |
| 2194 // -- ... | 2195 // -- ... |
| 2195 // -- sp[argc * 4] : receiver | 2196 // -- sp[argc * 4] : receiver |
| 2196 // ----------------------------------- | 2197 // ----------------------------------- |
| 2197 | 2198 |
| 2198 const int argc = arguments().immediate(); | 2199 const int argc = arguments().immediate(); |
| 2199 | 2200 |
| 2200 // If the object is not a JSObject or we got an unexpected number of | 2201 // If the object is not a JSObject or we got an unexpected number of |
| 2201 // arguments, bail out to the regular call. | 2202 // arguments, bail out to the regular call. |
| 2202 if (!object->IsJSObject() || argc != 1) return HEAP->undefined_value(); | 2203 if (!object->IsJSObject() || argc != 1) return heap()->undefined_value(); |
| 2203 | 2204 |
| 2204 Label miss; | 2205 Label miss; |
| 2205 GenerateNameCheck(name, &miss); | 2206 GenerateNameCheck(name, &miss); |
| 2206 | 2207 |
| 2207 if (cell == NULL) { | 2208 if (cell == NULL) { |
| 2208 __ ldr(r1, MemOperand(sp, 1 * kPointerSize)); | 2209 __ ldr(r1, MemOperand(sp, 1 * kPointerSize)); |
| 2209 | 2210 |
| 2210 STATIC_ASSERT(kSmiTag == 0); | 2211 STATIC_ASSERT(kSmiTag == 0); |
| 2211 __ tst(r1, Operand(kSmiTagMask)); | 2212 __ tst(r1, Operand(kSmiTagMask)); |
| 2212 __ b(eq, &miss); | 2213 __ b(eq, &miss); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2284 } | 2285 } |
| 2285 | 2286 |
| 2286 | 2287 |
| 2287 MaybeObject* CallStubCompiler::CompileFastApiCall( | 2288 MaybeObject* CallStubCompiler::CompileFastApiCall( |
| 2288 const CallOptimization& optimization, | 2289 const CallOptimization& optimization, |
| 2289 Object* object, | 2290 Object* object, |
| 2290 JSObject* holder, | 2291 JSObject* holder, |
| 2291 JSGlobalPropertyCell* cell, | 2292 JSGlobalPropertyCell* cell, |
| 2292 JSFunction* function, | 2293 JSFunction* function, |
| 2293 String* name) { | 2294 String* name) { |
| 2294 Isolate* isolate = masm()->isolate(); | 2295 Counters* counters = isolate()->counters(); |
| 2295 Heap* heap = isolate->heap(); | |
| 2296 Counters* counters = isolate->counters(); | |
| 2297 | 2296 |
| 2298 ASSERT(optimization.is_simple_api_call()); | 2297 ASSERT(optimization.is_simple_api_call()); |
| 2299 // Bail out if object is a global object as we don't want to | 2298 // Bail out if object is a global object as we don't want to |
| 2300 // repatch it to global receiver. | 2299 // repatch it to global receiver. |
| 2301 if (object->IsGlobalObject()) return heap->undefined_value(); | 2300 if (object->IsGlobalObject()) return heap()->undefined_value(); |
| 2302 if (cell != NULL) return heap->undefined_value(); | 2301 if (cell != NULL) return heap()->undefined_value(); |
| 2303 int depth = optimization.GetPrototypeDepthOfExpectedType( | 2302 int depth = optimization.GetPrototypeDepthOfExpectedType( |
| 2304 JSObject::cast(object), holder); | 2303 JSObject::cast(object), holder); |
| 2305 if (depth == kInvalidProtoDepth) return heap->undefined_value(); | 2304 if (depth == kInvalidProtoDepth) return heap()->undefined_value(); |
| 2306 | 2305 |
| 2307 Label miss, miss_before_stack_reserved; | 2306 Label miss, miss_before_stack_reserved; |
| 2308 | 2307 |
| 2309 GenerateNameCheck(name, &miss_before_stack_reserved); | 2308 GenerateNameCheck(name, &miss_before_stack_reserved); |
| 2310 | 2309 |
| 2311 // Get the receiver from the stack. | 2310 // Get the receiver from the stack. |
| 2312 const int argc = arguments().immediate(); | 2311 const int argc = arguments().immediate(); |
| 2313 __ ldr(r1, MemOperand(sp, argc * kPointerSize)); | 2312 __ ldr(r1, MemOperand(sp, argc * kPointerSize)); |
| 2314 | 2313 |
| 2315 // Check that the receiver isn't a smi. | 2314 // Check that the receiver isn't a smi. |
| (...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2795 | 2794 |
| 2796 // Return undefined if maps of the full prototype chain are still the | 2795 // Return undefined if maps of the full prototype chain are still the |
| 2797 // same and no global property with this name contains a value. | 2796 // same and no global property with this name contains a value. |
| 2798 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); | 2797 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); |
| 2799 __ Ret(); | 2798 __ Ret(); |
| 2800 | 2799 |
| 2801 __ bind(&miss); | 2800 __ bind(&miss); |
| 2802 GenerateLoadMiss(masm(), Code::LOAD_IC); | 2801 GenerateLoadMiss(masm(), Code::LOAD_IC); |
| 2803 | 2802 |
| 2804 // Return the generated code. | 2803 // Return the generated code. |
| 2805 return GetCode(NONEXISTENT, HEAP->empty_string()); | 2804 return GetCode(NONEXISTENT, heap()->empty_string()); |
| 2806 } | 2805 } |
| 2807 | 2806 |
| 2808 | 2807 |
| 2809 MaybeObject* LoadStubCompiler::CompileLoadField(JSObject* object, | 2808 MaybeObject* LoadStubCompiler::CompileLoadField(JSObject* object, |
| 2810 JSObject* holder, | 2809 JSObject* holder, |
| 2811 int index, | 2810 int index, |
| 2812 String* name) { | 2811 String* name) { |
| 2813 // ----------- S t a t e ------------- | 2812 // ----------- S t a t e ------------- |
| 2814 // -- r0 : receiver | 2813 // -- r0 : receiver |
| 2815 // -- r2 : name | 2814 // -- r2 : name |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3244 __ b(ne, &miss); | 3243 __ b(ne, &miss); |
| 3245 | 3244 |
| 3246 // Check that the key is a smi. | 3245 // Check that the key is a smi. |
| 3247 __ tst(key_reg, Operand(kSmiTagMask)); | 3246 __ tst(key_reg, Operand(kSmiTagMask)); |
| 3248 __ b(ne, &miss); | 3247 __ b(ne, &miss); |
| 3249 | 3248 |
| 3250 // Get the elements array and make sure it is a fast element array, not 'cow'. | 3249 // Get the elements array and make sure it is a fast element array, not 'cow'. |
| 3251 __ ldr(elements_reg, | 3250 __ ldr(elements_reg, |
| 3252 FieldMemOperand(receiver_reg, JSObject::kElementsOffset)); | 3251 FieldMemOperand(receiver_reg, JSObject::kElementsOffset)); |
| 3253 __ ldr(scratch, FieldMemOperand(elements_reg, HeapObject::kMapOffset)); | 3252 __ ldr(scratch, FieldMemOperand(elements_reg, HeapObject::kMapOffset)); |
| 3254 __ cmp(scratch, Operand(Handle<Map>(FACTORY->fixed_array_map()))); | 3253 __ cmp(scratch, Operand(Handle<Map>(factory()->fixed_array_map()))); |
| 3255 __ b(ne, &miss); | 3254 __ b(ne, &miss); |
| 3256 | 3255 |
| 3257 // Check that the key is within bounds. | 3256 // Check that the key is within bounds. |
| 3258 if (receiver->IsJSArray()) { | 3257 if (receiver->IsJSArray()) { |
| 3259 __ ldr(scratch, FieldMemOperand(receiver_reg, JSArray::kLengthOffset)); | 3258 __ ldr(scratch, FieldMemOperand(receiver_reg, JSArray::kLengthOffset)); |
| 3260 } else { | 3259 } else { |
| 3261 __ ldr(scratch, FieldMemOperand(elements_reg, FixedArray::kLengthOffset)); | 3260 __ ldr(scratch, FieldMemOperand(elements_reg, FixedArray::kLengthOffset)); |
| 3262 } | 3261 } |
| 3263 // Compare smis. | 3262 // Compare smis. |
| 3264 __ cmp(key_reg, scratch); | 3263 __ cmp(key_reg, scratch); |
| (...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4026 | 4025 |
| 4027 return GetCode(flags); | 4026 return GetCode(flags); |
| 4028 } | 4027 } |
| 4029 | 4028 |
| 4030 | 4029 |
| 4031 #undef __ | 4030 #undef __ |
| 4032 | 4031 |
| 4033 } } // namespace v8::internal | 4032 } } // namespace v8::internal |
| 4034 | 4033 |
| 4035 #endif // V8_TARGET_ARCH_ARM | 4034 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |