OLD | NEW |
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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 | 373 |
374 | 374 |
375 // Generate code to load the length from a string object and return the length. | 375 // Generate code to load the length from a string object and return the length. |
376 // If the receiver object is not a string or a wrapped string object the | 376 // If the receiver object is not a string or a wrapped string object the |
377 // execution continues at the miss label. The register containing the | 377 // execution continues at the miss label. The register containing the |
378 // receiver is potentially clobbered. | 378 // receiver is potentially clobbered. |
379 void StubCompiler::GenerateLoadStringLength(MacroAssembler* masm, | 379 void StubCompiler::GenerateLoadStringLength(MacroAssembler* masm, |
380 Register receiver, | 380 Register receiver, |
381 Register scratch1, | 381 Register scratch1, |
382 Register scratch2, | 382 Register scratch2, |
383 Label* miss) { | 383 Label* miss, |
| 384 bool support_wrappers) { |
384 Label check_wrapper; | 385 Label check_wrapper; |
385 | 386 |
386 // Check if the object is a string leaving the instance type in the | 387 // Check if the object is a string leaving the instance type in the |
387 // scratch1 register. | 388 // scratch1 register. |
388 GenerateStringCheck(masm, receiver, scratch1, scratch2, miss, &check_wrapper); | 389 GenerateStringCheck(masm, receiver, scratch1, scratch2, miss, |
| 390 support_wrappers ? &check_wrapper : miss); |
389 | 391 |
390 // Load length directly from the string. | 392 // Load length directly from the string. |
391 __ ldr(r0, FieldMemOperand(receiver, String::kLengthOffset)); | 393 __ ldr(r0, FieldMemOperand(receiver, String::kLengthOffset)); |
392 __ Ret(); | 394 __ Ret(); |
393 | 395 |
394 // Check if the object is a JSValue wrapper. | 396 if (support_wrappers) { |
395 __ bind(&check_wrapper); | 397 // Check if the object is a JSValue wrapper. |
396 __ cmp(scratch1, Operand(JS_VALUE_TYPE)); | 398 __ bind(&check_wrapper); |
397 __ b(ne, miss); | 399 __ cmp(scratch1, Operand(JS_VALUE_TYPE)); |
| 400 __ b(ne, miss); |
398 | 401 |
399 // Unwrap the value and check if the wrapped value is a string. | 402 // Unwrap the value and check if the wrapped value is a string. |
400 __ ldr(scratch1, FieldMemOperand(receiver, JSValue::kValueOffset)); | 403 __ ldr(scratch1, FieldMemOperand(receiver, JSValue::kValueOffset)); |
401 GenerateStringCheck(masm, scratch1, scratch2, scratch2, miss, miss); | 404 GenerateStringCheck(masm, scratch1, scratch2, scratch2, miss, miss); |
402 __ ldr(r0, FieldMemOperand(scratch1, String::kLengthOffset)); | 405 __ ldr(r0, FieldMemOperand(scratch1, String::kLengthOffset)); |
403 __ Ret(); | 406 __ Ret(); |
| 407 } |
404 } | 408 } |
405 | 409 |
406 | 410 |
407 void StubCompiler::GenerateLoadFunctionPrototype(MacroAssembler* masm, | 411 void StubCompiler::GenerateLoadFunctionPrototype(MacroAssembler* masm, |
408 Register receiver, | 412 Register receiver, |
409 Register scratch1, | 413 Register scratch1, |
410 Register scratch2, | 414 Register scratch2, |
411 Label* miss_label) { | 415 Label* miss_label) { |
412 __ TryGetFunctionPrototype(receiver, scratch1, scratch2, miss_label); | 416 __ TryGetFunctionPrototype(receiver, scratch1, scratch2, miss_label); |
413 __ mov(r0, scratch1); | 417 __ mov(r0, scratch1); |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
832 | 836 |
833 | 837 |
834 // Undoes the effects of ReserveSpaceForFastApiCall. | 838 // Undoes the effects of ReserveSpaceForFastApiCall. |
835 static void FreeSpaceForFastApiCall(MacroAssembler* masm) { | 839 static void FreeSpaceForFastApiCall(MacroAssembler* masm) { |
836 __ Drop(kFastApiCallArguments); | 840 __ Drop(kFastApiCallArguments); |
837 } | 841 } |
838 | 842 |
839 | 843 |
840 static void GenerateFastApiDirectCall(MacroAssembler* masm, | 844 static void GenerateFastApiDirectCall(MacroAssembler* masm, |
841 const CallOptimization& optimization, | 845 const CallOptimization& optimization, |
842 int argc, | 846 int argc) { |
843 bool restore_context) { | |
844 // ----------- S t a t e ------------- | 847 // ----------- S t a t e ------------- |
845 // -- sp[0] : context | 848 // -- sp[0] : holder (set by CheckPrototypes) |
846 // -- sp[4] : holder (set by CheckPrototypes) | 849 // -- sp[4] : callee JS function |
847 // -- sp[8] : callee JS function | 850 // -- sp[8] : call data |
848 // -- sp[12] : call data | 851 // -- sp[12] : isolate |
849 // -- sp[16] : isolate | 852 // -- sp[16] : ReturnValue default value |
850 // -- sp[20] : ReturnValue default value | 853 // -- sp[20] : ReturnValue |
851 // -- sp[24] : ReturnValue | 854 // -- sp[24] : last JS argument |
852 // -- sp[28] : last JS argument | |
853 // -- ... | 855 // -- ... |
854 // -- sp[(argc + 6) * 4] : first JS argument | 856 // -- sp[(argc + 5) * 4] : first JS argument |
855 // -- sp[(argc + 7) * 4] : receiver | 857 // -- sp[(argc + 6) * 4] : receiver |
856 // ----------------------------------- | 858 // ----------------------------------- |
857 // Save calling context. | |
858 __ str(cp, MemOperand(sp)); | |
859 // Get the function and setup the context. | 859 // Get the function and setup the context. |
860 Handle<JSFunction> function = optimization.constant_function(); | 860 Handle<JSFunction> function = optimization.constant_function(); |
861 __ LoadHeapObject(r5, function); | 861 __ LoadHeapObject(r5, function); |
862 __ ldr(cp, FieldMemOperand(r5, JSFunction::kContextOffset)); | 862 __ ldr(cp, FieldMemOperand(r5, JSFunction::kContextOffset)); |
863 __ str(r5, MemOperand(sp, 2 * kPointerSize)); | |
864 | 863 |
865 // Pass the additional arguments. | 864 // Pass the additional arguments. |
866 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); | 865 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); |
867 Handle<Object> call_data(api_call_info->data(), masm->isolate()); | 866 Handle<Object> call_data(api_call_info->data(), masm->isolate()); |
868 if (masm->isolate()->heap()->InNewSpace(*call_data)) { | 867 if (masm->isolate()->heap()->InNewSpace(*call_data)) { |
869 __ Move(r0, api_call_info); | 868 __ Move(r0, api_call_info); |
870 __ ldr(r6, FieldMemOperand(r0, CallHandlerInfo::kDataOffset)); | 869 __ ldr(r6, FieldMemOperand(r0, CallHandlerInfo::kDataOffset)); |
871 } else { | 870 } else { |
872 __ Move(r6, call_data); | 871 __ Move(r6, call_data); |
873 } | 872 } |
874 // Store call data. | |
875 __ str(r6, MemOperand(sp, 3 * kPointerSize)); | |
876 // Store isolate. | |
877 __ mov(r7, Operand(ExternalReference::isolate_address(masm->isolate()))); | 873 __ mov(r7, Operand(ExternalReference::isolate_address(masm->isolate()))); |
878 __ str(r7, MemOperand(sp, 4 * kPointerSize)); | 874 // Store JS function, call data, isolate ReturnValue default and ReturnValue. |
879 // Store ReturnValue default and ReturnValue. | 875 __ stm(ib, sp, r5.bit() | r6.bit() | r7.bit()); |
880 __ LoadRoot(r5, Heap::kUndefinedValueRootIndex); | 876 __ LoadRoot(r5, Heap::kUndefinedValueRootIndex); |
| 877 __ str(r5, MemOperand(sp, 4 * kPointerSize)); |
881 __ str(r5, MemOperand(sp, 5 * kPointerSize)); | 878 __ str(r5, MemOperand(sp, 5 * kPointerSize)); |
882 __ str(r5, MemOperand(sp, 6 * kPointerSize)); | |
883 | 879 |
884 // Prepare arguments. | 880 // Prepare arguments. |
885 __ add(r2, sp, Operand((kFastApiCallArguments - 1) * kPointerSize)); | 881 __ add(r2, sp, Operand(5 * kPointerSize)); |
886 | 882 |
887 // Allocate the v8::Arguments structure in the arguments' space since | 883 // Allocate the v8::Arguments structure in the arguments' space since |
888 // it's not controlled by GC. | 884 // it's not controlled by GC. |
889 const int kApiStackSpace = 4; | 885 const int kApiStackSpace = 4; |
890 | 886 |
891 FrameScope frame_scope(masm, StackFrame::MANUAL); | 887 FrameScope frame_scope(masm, StackFrame::MANUAL); |
892 __ EnterExitFrame(false, kApiStackSpace); | 888 __ EnterExitFrame(false, kApiStackSpace); |
893 | 889 |
894 // r0 = v8::Arguments& | 890 // r0 = v8::Arguments& |
895 // Arguments is after the return address. | 891 // Arguments is after the return address. |
(...skipping 17 matching lines...) Expand all Loading... |
913 ExternalReference ref = ExternalReference(&fun, | 909 ExternalReference ref = ExternalReference(&fun, |
914 type, | 910 type, |
915 masm->isolate()); | 911 masm->isolate()); |
916 Address thunk_address = FUNCTION_ADDR(&InvokeFunctionCallback); | 912 Address thunk_address = FUNCTION_ADDR(&InvokeFunctionCallback); |
917 ExternalReference::Type thunk_type = ExternalReference::PROFILING_API_CALL; | 913 ExternalReference::Type thunk_type = ExternalReference::PROFILING_API_CALL; |
918 ApiFunction thunk_fun(thunk_address); | 914 ApiFunction thunk_fun(thunk_address); |
919 ExternalReference thunk_ref = ExternalReference(&thunk_fun, thunk_type, | 915 ExternalReference thunk_ref = ExternalReference(&thunk_fun, thunk_type, |
920 masm->isolate()); | 916 masm->isolate()); |
921 | 917 |
922 AllowExternalCallThatCantCauseGC scope(masm); | 918 AllowExternalCallThatCantCauseGC scope(masm); |
923 MemOperand context_restore_operand( | |
924 fp, 2 * kPointerSize); | |
925 MemOperand return_value_operand( | |
926 fp, (kFastApiCallArguments + 1) * kPointerSize); | |
927 __ CallApiFunctionAndReturn(ref, | 919 __ CallApiFunctionAndReturn(ref, |
928 function_address, | 920 function_address, |
929 thunk_ref, | 921 thunk_ref, |
930 r1, | 922 r1, |
931 kStackUnwindSpace, | 923 kStackUnwindSpace, |
932 return_value_operand, | 924 kFastApiCallArguments + 1); |
933 restore_context ? | |
934 &context_restore_operand : NULL); | |
935 } | 925 } |
936 | 926 |
937 | 927 |
938 // Generate call to api function. | 928 // Generate call to api function. |
939 static void GenerateFastApiCall(MacroAssembler* masm, | 929 static void GenerateFastApiCall(MacroAssembler* masm, |
940 const CallOptimization& optimization, | 930 const CallOptimization& optimization, |
941 Register receiver, | 931 Register receiver, |
942 Register scratch, | 932 Register scratch, |
943 int argc, | 933 int argc, |
944 Register* values) { | 934 Register* values) { |
945 ASSERT(optimization.is_simple_api_call()); | 935 ASSERT(optimization.is_simple_api_call()); |
946 ASSERT(!receiver.is(scratch)); | 936 ASSERT(!receiver.is(scratch)); |
947 | 937 |
948 const int stack_space = kFastApiCallArguments + argc + 1; | 938 const int stack_space = kFastApiCallArguments + argc + 1; |
949 const int kHolderIndex = kFastApiCallArguments + | |
950 FunctionCallbackArguments::kHolderIndex - 1; | |
951 // Assign stack space for the call arguments. | 939 // Assign stack space for the call arguments. |
952 __ sub(sp, sp, Operand(stack_space * kPointerSize)); | 940 __ sub(sp, sp, Operand(stack_space * kPointerSize)); |
953 // Write holder to stack frame. | 941 // Write holder to stack frame. |
954 __ str(receiver, MemOperand(sp, kHolderIndex * kPointerSize)); | 942 __ str(receiver, MemOperand(sp, 0)); |
955 // Write receiver to stack frame. | 943 // Write receiver to stack frame. |
956 int index = stack_space - 1; | 944 int index = stack_space - 1; |
957 __ str(receiver, MemOperand(sp, index * kPointerSize)); | 945 __ str(receiver, MemOperand(sp, index * kPointerSize)); |
958 // Write the arguments to stack frame. | 946 // Write the arguments to stack frame. |
959 for (int i = 0; i < argc; i++) { | 947 for (int i = 0; i < argc; i++) { |
960 ASSERT(!receiver.is(values[i])); | 948 ASSERT(!receiver.is(values[i])); |
961 ASSERT(!scratch.is(values[i])); | 949 ASSERT(!scratch.is(values[i])); |
962 __ str(receiver, MemOperand(sp, index-- * kPointerSize)); | 950 __ str(receiver, MemOperand(sp, index-- * kPointerSize)); |
963 } | 951 } |
964 | 952 |
965 GenerateFastApiDirectCall(masm, optimization, argc, true); | 953 GenerateFastApiDirectCall(masm, optimization, argc); |
966 } | 954 } |
967 | 955 |
968 | 956 |
969 class CallInterceptorCompiler BASE_EMBEDDED { | 957 class CallInterceptorCompiler BASE_EMBEDDED { |
970 public: | 958 public: |
971 CallInterceptorCompiler(StubCompiler* stub_compiler, | 959 CallInterceptorCompiler(StubCompiler* stub_compiler, |
972 const ParameterCount& arguments, | 960 const ParameterCount& arguments, |
973 Register name, | 961 Register name, |
974 Code::ExtraICState extra_ic_state) | 962 Code::ExtraICState extra_ic_state) |
975 : stub_compiler_(stub_compiler), | 963 : stub_compiler_(stub_compiler), |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1069 } else { | 1057 } else { |
1070 // CheckPrototypes has a side effect of fetching a 'holder' | 1058 // CheckPrototypes has a side effect of fetching a 'holder' |
1071 // for API (object which is instanceof for the signature). It's | 1059 // for API (object which is instanceof for the signature). It's |
1072 // safe to omit it here, as if present, it should be fetched | 1060 // safe to omit it here, as if present, it should be fetched |
1073 // by the previous CheckPrototypes. | 1061 // by the previous CheckPrototypes. |
1074 ASSERT(depth2 == kInvalidProtoDepth); | 1062 ASSERT(depth2 == kInvalidProtoDepth); |
1075 } | 1063 } |
1076 | 1064 |
1077 // Invoke function. | 1065 // Invoke function. |
1078 if (can_do_fast_api_call) { | 1066 if (can_do_fast_api_call) { |
1079 GenerateFastApiDirectCall( | 1067 GenerateFastApiDirectCall(masm, optimization, arguments_.immediate()); |
1080 masm, optimization, arguments_.immediate(), false); | |
1081 } else { | 1068 } else { |
1082 CallKind call_kind = CallICBase::Contextual::decode(extra_ic_state_) | 1069 CallKind call_kind = CallICBase::Contextual::decode(extra_ic_state_) |
1083 ? CALL_AS_FUNCTION | 1070 ? CALL_AS_FUNCTION |
1084 : CALL_AS_METHOD; | 1071 : CALL_AS_METHOD; |
1085 Handle<JSFunction> function = optimization.constant_function(); | 1072 Handle<JSFunction> function = optimization.constant_function(); |
1086 ParameterCount expected(function); | 1073 ParameterCount expected(function); |
1087 __ InvokeFunction(function, expected, arguments_, | 1074 __ InvokeFunction(function, expected, arguments_, |
1088 JUMP_FUNCTION, NullCallWrapper(), call_kind); | 1075 JUMP_FUNCTION, NullCallWrapper(), call_kind); |
1089 } | 1076 } |
1090 | 1077 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1194 Register StubCompiler::CheckPrototypes(Handle<JSObject> object, | 1181 Register StubCompiler::CheckPrototypes(Handle<JSObject> object, |
1195 Register object_reg, | 1182 Register object_reg, |
1196 Handle<JSObject> holder, | 1183 Handle<JSObject> holder, |
1197 Register holder_reg, | 1184 Register holder_reg, |
1198 Register scratch1, | 1185 Register scratch1, |
1199 Register scratch2, | 1186 Register scratch2, |
1200 Handle<Name> name, | 1187 Handle<Name> name, |
1201 int save_at_depth, | 1188 int save_at_depth, |
1202 Label* miss, | 1189 Label* miss, |
1203 PrototypeCheckType check) { | 1190 PrototypeCheckType check) { |
1204 const int kHolderIndex = kFastApiCallArguments + | |
1205 FunctionCallbackArguments::kHolderIndex - 1; | |
1206 // Make sure that the type feedback oracle harvests the receiver map. | 1191 // Make sure that the type feedback oracle harvests the receiver map. |
1207 // TODO(svenpanne) Remove this hack when all ICs are reworked. | 1192 // TODO(svenpanne) Remove this hack when all ICs are reworked. |
1208 __ mov(scratch1, Operand(Handle<Map>(object->map()))); | 1193 __ mov(scratch1, Operand(Handle<Map>(object->map()))); |
1209 | 1194 |
1210 Handle<JSObject> first = object; | 1195 Handle<JSObject> first = object; |
1211 // Make sure there's no overlap between holder and object registers. | 1196 // Make sure there's no overlap between holder and object registers. |
1212 ASSERT(!scratch1.is(object_reg) && !scratch1.is(holder_reg)); | 1197 ASSERT(!scratch1.is(object_reg) && !scratch1.is(holder_reg)); |
1213 ASSERT(!scratch2.is(object_reg) && !scratch2.is(holder_reg) | 1198 ASSERT(!scratch2.is(object_reg) && !scratch2.is(holder_reg) |
1214 && !scratch2.is(scratch1)); | 1199 && !scratch2.is(scratch1)); |
1215 | 1200 |
1216 // Keep track of the current object in register reg. | 1201 // Keep track of the current object in register reg. |
1217 Register reg = object_reg; | 1202 Register reg = object_reg; |
1218 int depth = 0; | 1203 int depth = 0; |
1219 | 1204 |
1220 if (save_at_depth == depth) { | 1205 if (save_at_depth == depth) { |
1221 __ str(reg, MemOperand(sp, kHolderIndex * kPointerSize)); | 1206 __ str(reg, MemOperand(sp)); |
1222 } | 1207 } |
1223 | 1208 |
1224 // Check the maps in the prototype chain. | 1209 // Check the maps in the prototype chain. |
1225 // Traverse the prototype chain from the object and do map checks. | 1210 // Traverse the prototype chain from the object and do map checks. |
1226 Handle<JSObject> current = object; | 1211 Handle<JSObject> current = object; |
1227 while (!current.is_identical_to(holder)) { | 1212 while (!current.is_identical_to(holder)) { |
1228 ++depth; | 1213 ++depth; |
1229 | 1214 |
1230 // Only global objects and objects that do not require access | 1215 // Only global objects and objects that do not require access |
1231 // checks are allowed in stubs. | 1216 // checks are allowed in stubs. |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1270 // The prototype is in new space; we cannot store a reference to it | 1255 // The prototype is in new space; we cannot store a reference to it |
1271 // in the code. Load it from the map. | 1256 // in the code. Load it from the map. |
1272 __ ldr(reg, FieldMemOperand(map_reg, Map::kPrototypeOffset)); | 1257 __ ldr(reg, FieldMemOperand(map_reg, Map::kPrototypeOffset)); |
1273 } else { | 1258 } else { |
1274 // The prototype is in old space; load it directly. | 1259 // The prototype is in old space; load it directly. |
1275 __ mov(reg, Operand(prototype)); | 1260 __ mov(reg, Operand(prototype)); |
1276 } | 1261 } |
1277 } | 1262 } |
1278 | 1263 |
1279 if (save_at_depth == depth) { | 1264 if (save_at_depth == depth) { |
1280 __ str(reg, MemOperand(sp, kHolderIndex * kPointerSize)); | 1265 __ str(reg, MemOperand(sp)); |
1281 } | 1266 } |
1282 | 1267 |
1283 // Go to the next object in the prototype chain. | 1268 // Go to the next object in the prototype chain. |
1284 current = prototype; | 1269 current = prototype; |
1285 } | 1270 } |
1286 | 1271 |
1287 // Log the check depth. | 1272 // Log the check depth. |
1288 LOG(isolate(), IntEvent("check-maps-depth", depth + 1)); | 1273 LOG(isolate(), IntEvent("check-maps-depth", depth + 1)); |
1289 | 1274 |
1290 if (!holder.is_identical_to(first) || check == CHECK_ALL_MAPS) { | 1275 if (!holder.is_identical_to(first) || check == CHECK_ALL_MAPS) { |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1465 | 1450 |
1466 const int kApiStackSpace = 1; | 1451 const int kApiStackSpace = 1; |
1467 FrameScope frame_scope(masm(), StackFrame::MANUAL); | 1452 FrameScope frame_scope(masm(), StackFrame::MANUAL); |
1468 __ EnterExitFrame(false, kApiStackSpace); | 1453 __ EnterExitFrame(false, kApiStackSpace); |
1469 | 1454 |
1470 // Create AccessorInfo instance on the stack above the exit frame with | 1455 // Create AccessorInfo instance on the stack above the exit frame with |
1471 // scratch2 (internal::Object** args_) as the data. | 1456 // scratch2 (internal::Object** args_) as the data. |
1472 __ str(scratch2(), MemOperand(sp, 1 * kPointerSize)); | 1457 __ str(scratch2(), MemOperand(sp, 1 * kPointerSize)); |
1473 __ add(r1, sp, Operand(1 * kPointerSize)); // r1 = AccessorInfo& | 1458 __ add(r1, sp, Operand(1 * kPointerSize)); // r1 = AccessorInfo& |
1474 | 1459 |
1475 const int kStackUnwindSpace = PropertyCallbackArguments::kArgsLength + 1; | 1460 const int kStackUnwindSpace = kFastApiCallArguments + 1; |
1476 Address getter_address = v8::ToCData<Address>(callback->getter()); | 1461 Address getter_address = v8::ToCData<Address>(callback->getter()); |
1477 | 1462 |
1478 ApiFunction fun(getter_address); | 1463 ApiFunction fun(getter_address); |
1479 ExternalReference::Type type = ExternalReference::DIRECT_GETTER_CALL; | 1464 ExternalReference::Type type = ExternalReference::DIRECT_GETTER_CALL; |
1480 ExternalReference ref = ExternalReference(&fun, type, isolate()); | 1465 ExternalReference ref = ExternalReference(&fun, type, isolate()); |
1481 | 1466 |
1482 Address thunk_address = FUNCTION_ADDR(&InvokeAccessorGetterCallback); | 1467 Address thunk_address = FUNCTION_ADDR(&InvokeAccessorGetterCallback); |
1483 ExternalReference::Type thunk_type = | 1468 ExternalReference::Type thunk_type = |
1484 ExternalReference::PROFILING_GETTER_CALL; | 1469 ExternalReference::PROFILING_GETTER_CALL; |
1485 ApiFunction thunk_fun(thunk_address); | 1470 ApiFunction thunk_fun(thunk_address); |
1486 ExternalReference thunk_ref = ExternalReference(&thunk_fun, thunk_type, | 1471 ExternalReference thunk_ref = ExternalReference(&thunk_fun, thunk_type, |
1487 isolate()); | 1472 isolate()); |
1488 __ CallApiFunctionAndReturn(ref, | 1473 __ CallApiFunctionAndReturn(ref, |
1489 getter_address, | 1474 getter_address, |
1490 thunk_ref, | 1475 thunk_ref, |
1491 r2, | 1476 r2, |
1492 kStackUnwindSpace, | 1477 kStackUnwindSpace, |
1493 MemOperand(fp, 6 * kPointerSize), | 1478 6); |
1494 NULL); | |
1495 } | 1479 } |
1496 | 1480 |
1497 | 1481 |
1498 void BaseLoadStubCompiler::GenerateLoadInterceptor( | 1482 void BaseLoadStubCompiler::GenerateLoadInterceptor( |
1499 Register holder_reg, | 1483 Register holder_reg, |
1500 Handle<JSObject> object, | 1484 Handle<JSObject> object, |
1501 Handle<JSObject> interceptor_holder, | 1485 Handle<JSObject> interceptor_holder, |
1502 LookupResult* lookup, | 1486 LookupResult* lookup, |
1503 Handle<Name> name) { | 1487 Handle<Name> name) { |
1504 ASSERT(interceptor_holder->HasNamedInterceptor()); | 1488 ASSERT(interceptor_holder->HasNamedInterceptor()); |
(...skipping 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2548 | 2532 |
2549 __ IncrementCounter(counters->call_const(), 1, r0, r3); | 2533 __ IncrementCounter(counters->call_const(), 1, r0, r3); |
2550 __ IncrementCounter(counters->call_const_fast_api(), 1, r0, r3); | 2534 __ IncrementCounter(counters->call_const_fast_api(), 1, r0, r3); |
2551 | 2535 |
2552 ReserveSpaceForFastApiCall(masm(), r0); | 2536 ReserveSpaceForFastApiCall(masm(), r0); |
2553 | 2537 |
2554 // Check that the maps haven't changed and find a Holder as a side effect. | 2538 // Check that the maps haven't changed and find a Holder as a side effect. |
2555 CheckPrototypes(Handle<JSObject>::cast(object), r1, holder, r0, r3, r4, name, | 2539 CheckPrototypes(Handle<JSObject>::cast(object), r1, holder, r0, r3, r4, name, |
2556 depth, &miss); | 2540 depth, &miss); |
2557 | 2541 |
2558 GenerateFastApiDirectCall(masm(), optimization, argc, false); | 2542 GenerateFastApiDirectCall(masm(), optimization, argc); |
2559 | 2543 |
2560 __ bind(&miss); | 2544 __ bind(&miss); |
2561 FreeSpaceForFastApiCall(masm()); | 2545 FreeSpaceForFastApiCall(masm()); |
2562 | 2546 |
2563 __ bind(&miss_before_stack_reserved); | 2547 __ bind(&miss_before_stack_reserved); |
2564 GenerateMissBranch(); | 2548 GenerateMissBranch(); |
2565 | 2549 |
2566 // Return the generated code. | 2550 // Return the generated code. |
2567 return GetCode(function); | 2551 return GetCode(function); |
2568 } | 2552 } |
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3191 // ----------------------------------- | 3175 // ----------------------------------- |
3192 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); | 3176 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); |
3193 } | 3177 } |
3194 | 3178 |
3195 | 3179 |
3196 #undef __ | 3180 #undef __ |
3197 | 3181 |
3198 } } // namespace v8::internal | 3182 } } // namespace v8::internal |
3199 | 3183 |
3200 #endif // V8_TARGET_ARCH_ARM | 3184 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |