| 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 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 StubCache::kInterceptorArgsLength); | 391 StubCache::kInterceptorArgsLength); |
| 392 } | 392 } |
| 393 | 393 |
| 394 | 394 |
| 395 // Generate call to api function. | 395 // Generate call to api function. |
| 396 static void GenerateFastApiCall(MacroAssembler* masm, | 396 static void GenerateFastApiCall(MacroAssembler* masm, |
| 397 const CallOptimization& optimization, | 397 const CallOptimization& optimization, |
| 398 Handle<Map> receiver_map, | 398 Handle<Map> receiver_map, |
| 399 Register receiver, | 399 Register receiver, |
| 400 Register scratch_in, | 400 Register scratch_in, |
| 401 bool is_store, |
| 401 int argc, | 402 int argc, |
| 402 Register* values) { | 403 Register* values) { |
| 403 ASSERT(optimization.is_simple_api_call()); | 404 ASSERT(optimization.is_simple_api_call()); |
| 404 | 405 |
| 405 __ PopReturnAddressTo(scratch_in); | 406 __ PopReturnAddressTo(scratch_in); |
| 406 // receiver | 407 // receiver |
| 407 __ push(receiver); | 408 __ push(receiver); |
| 408 // Write the arguments to stack frame. | 409 // Write the arguments to stack frame. |
| 409 for (int i = 0; i < argc; i++) { | 410 for (int i = 0; i < argc; i++) { |
| 410 Register arg = values[argc-1-i]; | 411 Register arg = values[argc-1-i]; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 } else { | 459 } else { |
| 459 __ Move(call_data, call_data_obj); | 460 __ Move(call_data, call_data_obj); |
| 460 } | 461 } |
| 461 | 462 |
| 462 // Put api_function_address in place. | 463 // Put api_function_address in place. |
| 463 Address function_address = v8::ToCData<Address>(api_call_info->callback()); | 464 Address function_address = v8::ToCData<Address>(api_call_info->callback()); |
| 464 __ Move( | 465 __ Move( |
| 465 api_function_address, function_address, RelocInfo::EXTERNAL_REFERENCE); | 466 api_function_address, function_address, RelocInfo::EXTERNAL_REFERENCE); |
| 466 | 467 |
| 467 // Jump to stub. | 468 // Jump to stub. |
| 468 CallApiFunctionStub stub(true, call_data_undefined, argc); | 469 CallApiFunctionStub stub(is_store, call_data_undefined, argc); |
| 469 __ TailCallStub(&stub); | 470 __ TailCallStub(&stub); |
| 470 } | 471 } |
| 471 | 472 |
| 472 | 473 |
| 473 void StoreStubCompiler::GenerateRestoreName(MacroAssembler* masm, | 474 void StoreStubCompiler::GenerateRestoreName(MacroAssembler* masm, |
| 474 Label* label, | 475 Label* label, |
| 475 Handle<Name> name) { | 476 Handle<Name> name) { |
| 476 if (!label->is_unused()) { | 477 if (!label->is_unused()) { |
| 477 __ bind(label); | 478 __ bind(label); |
| 478 __ Move(this->name(), name); | 479 __ Move(this->name(), name); |
| (...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 967 GenerateTailCall(masm(), stub.GetCode(isolate())); | 968 GenerateTailCall(masm(), stub.GetCode(isolate())); |
| 968 } | 969 } |
| 969 } | 970 } |
| 970 | 971 |
| 971 | 972 |
| 972 void LoadStubCompiler::GenerateLoadCallback( | 973 void LoadStubCompiler::GenerateLoadCallback( |
| 973 const CallOptimization& call_optimization, | 974 const CallOptimization& call_optimization, |
| 974 Handle<Map> receiver_map) { | 975 Handle<Map> receiver_map) { |
| 975 GenerateFastApiCall( | 976 GenerateFastApiCall( |
| 976 masm(), call_optimization, receiver_map, | 977 masm(), call_optimization, receiver_map, |
| 977 receiver(), scratch1(), 0, NULL); | 978 receiver(), scratch1(), false, 0, NULL); |
| 978 } | 979 } |
| 979 | 980 |
| 980 | 981 |
| 981 void LoadStubCompiler::GenerateLoadCallback( | 982 void LoadStubCompiler::GenerateLoadCallback( |
| 982 Register reg, | 983 Register reg, |
| 983 Handle<ExecutableAccessorInfo> callback) { | 984 Handle<ExecutableAccessorInfo> callback) { |
| 984 // Insert additional parameters into the stack frame above return address. | 985 // Insert additional parameters into the stack frame above return address. |
| 985 ASSERT(!scratch4().is(reg)); | 986 ASSERT(!scratch4().is(reg)); |
| 986 __ PopReturnAddressTo(scratch4()); | 987 __ PopReturnAddressTo(scratch4()); |
| 987 | 988 |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1162 Handle<JSObject> object, | 1163 Handle<JSObject> object, |
| 1163 Handle<JSObject> holder, | 1164 Handle<JSObject> holder, |
| 1164 Handle<Name> name, | 1165 Handle<Name> name, |
| 1165 const CallOptimization& call_optimization) { | 1166 const CallOptimization& call_optimization) { |
| 1166 HandlerFrontend(IC::CurrentTypeOf(object, isolate()), | 1167 HandlerFrontend(IC::CurrentTypeOf(object, isolate()), |
| 1167 receiver(), holder, name); | 1168 receiver(), holder, name); |
| 1168 | 1169 |
| 1169 Register values[] = { value() }; | 1170 Register values[] = { value() }; |
| 1170 GenerateFastApiCall( | 1171 GenerateFastApiCall( |
| 1171 masm(), call_optimization, handle(object->map()), | 1172 masm(), call_optimization, handle(object->map()), |
| 1172 receiver(), scratch1(), 1, values); | 1173 receiver(), scratch1(), true, 1, values); |
| 1173 | 1174 |
| 1174 // Return the generated code. | 1175 // Return the generated code. |
| 1175 return GetCode(kind(), Code::FAST, name); | 1176 return GetCode(kind(), Code::FAST, name); |
| 1176 } | 1177 } |
| 1177 | 1178 |
| 1178 | 1179 |
| 1179 #undef __ | 1180 #undef __ |
| 1180 #define __ ACCESS_MASM(masm) | 1181 #define __ ACCESS_MASM(masm) |
| 1181 | 1182 |
| 1182 | 1183 |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1502 // ----------------------------------- | 1503 // ----------------------------------- |
| 1503 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 1504 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
| 1504 } | 1505 } |
| 1505 | 1506 |
| 1506 | 1507 |
| 1507 #undef __ | 1508 #undef __ |
| 1508 | 1509 |
| 1509 } } // namespace v8::internal | 1510 } } // namespace v8::internal |
| 1510 | 1511 |
| 1511 #endif // V8_TARGET_ARCH_X64 | 1512 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |