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 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 | 420 |
421 // Generate call to api function. | 421 // Generate call to api function. |
422 // This function uses push() to generate smaller, faster code than | 422 // This function uses push() to generate smaller, faster code than |
423 // the version above. It is an optimization that should will be removed | 423 // the version above. It is an optimization that should will be removed |
424 // when api call ICs are generated in hydrogen. | 424 // when api call ICs are generated in hydrogen. |
425 static void GenerateFastApiCall(MacroAssembler* masm, | 425 static void GenerateFastApiCall(MacroAssembler* masm, |
426 const CallOptimization& optimization, | 426 const CallOptimization& optimization, |
427 Handle<Map> receiver_map, | 427 Handle<Map> receiver_map, |
428 Register receiver, | 428 Register receiver, |
429 Register scratch_in, | 429 Register scratch_in, |
| 430 bool is_store, |
430 int argc, | 431 int argc, |
431 Register* values) { | 432 Register* values) { |
432 // Copy return value. | 433 // Copy return value. |
433 __ pop(scratch_in); | 434 __ pop(scratch_in); |
434 // receiver | 435 // receiver |
435 __ push(receiver); | 436 __ push(receiver); |
436 // Write the arguments to stack frame. | 437 // Write the arguments to stack frame. |
437 for (int i = 0; i < argc; i++) { | 438 for (int i = 0; i < argc; i++) { |
438 Register arg = values[argc-1-i]; | 439 Register arg = values[argc-1-i]; |
439 ASSERT(!receiver.is(arg)); | 440 ASSERT(!receiver.is(arg)); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 __ mov(call_data, Immediate(isolate->factory()->undefined_value())); | 487 __ mov(call_data, Immediate(isolate->factory()->undefined_value())); |
487 } else { | 488 } else { |
488 __ mov(call_data, call_data_obj); | 489 __ mov(call_data, call_data_obj); |
489 } | 490 } |
490 | 491 |
491 // Put api_function_address in place. | 492 // Put api_function_address in place. |
492 Address function_address = v8::ToCData<Address>(api_call_info->callback()); | 493 Address function_address = v8::ToCData<Address>(api_call_info->callback()); |
493 __ mov(api_function_address, Immediate(function_address)); | 494 __ mov(api_function_address, Immediate(function_address)); |
494 | 495 |
495 // Jump to stub. | 496 // Jump to stub. |
496 CallApiFunctionStub stub(true, call_data_undefined, argc); | 497 CallApiFunctionStub stub(is_store, call_data_undefined, argc); |
497 __ TailCallStub(&stub); | 498 __ TailCallStub(&stub); |
498 } | 499 } |
499 | 500 |
500 | 501 |
501 void StoreStubCompiler::GenerateRestoreName(MacroAssembler* masm, | 502 void StoreStubCompiler::GenerateRestoreName(MacroAssembler* masm, |
502 Label* label, | 503 Label* label, |
503 Handle<Name> name) { | 504 Handle<Name> name) { |
504 if (!label->is_unused()) { | 505 if (!label->is_unused()) { |
505 __ bind(label); | 506 __ bind(label); |
506 __ mov(this->name(), Immediate(name)); | 507 __ mov(this->name(), Immediate(name)); |
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1063 GenerateTailCall(masm(), stub.GetCode(isolate())); | 1064 GenerateTailCall(masm(), stub.GetCode(isolate())); |
1064 } | 1065 } |
1065 } | 1066 } |
1066 | 1067 |
1067 | 1068 |
1068 void LoadStubCompiler::GenerateLoadCallback( | 1069 void LoadStubCompiler::GenerateLoadCallback( |
1069 const CallOptimization& call_optimization, | 1070 const CallOptimization& call_optimization, |
1070 Handle<Map> receiver_map) { | 1071 Handle<Map> receiver_map) { |
1071 GenerateFastApiCall( | 1072 GenerateFastApiCall( |
1072 masm(), call_optimization, receiver_map, | 1073 masm(), call_optimization, receiver_map, |
1073 receiver(), scratch1(), 0, NULL); | 1074 receiver(), scratch1(), false, 0, NULL); |
1074 } | 1075 } |
1075 | 1076 |
1076 | 1077 |
1077 void LoadStubCompiler::GenerateLoadCallback( | 1078 void LoadStubCompiler::GenerateLoadCallback( |
1078 Register reg, | 1079 Register reg, |
1079 Handle<ExecutableAccessorInfo> callback) { | 1080 Handle<ExecutableAccessorInfo> callback) { |
1080 // Insert additional parameters into the stack frame above return address. | 1081 // Insert additional parameters into the stack frame above return address. |
1081 ASSERT(!scratch3().is(reg)); | 1082 ASSERT(!scratch3().is(reg)); |
1082 __ pop(scratch3()); // Get return address to place it below. | 1083 __ pop(scratch3()); // Get return address to place it below. |
1083 | 1084 |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1267 Handle<JSObject> object, | 1268 Handle<JSObject> object, |
1268 Handle<JSObject> holder, | 1269 Handle<JSObject> holder, |
1269 Handle<Name> name, | 1270 Handle<Name> name, |
1270 const CallOptimization& call_optimization) { | 1271 const CallOptimization& call_optimization) { |
1271 HandlerFrontend(IC::CurrentTypeOf(object, isolate()), | 1272 HandlerFrontend(IC::CurrentTypeOf(object, isolate()), |
1272 receiver(), holder, name); | 1273 receiver(), holder, name); |
1273 | 1274 |
1274 Register values[] = { value() }; | 1275 Register values[] = { value() }; |
1275 GenerateFastApiCall( | 1276 GenerateFastApiCall( |
1276 masm(), call_optimization, handle(object->map()), | 1277 masm(), call_optimization, handle(object->map()), |
1277 receiver(), scratch1(), 1, values); | 1278 receiver(), scratch1(), true, 1, values); |
1278 | 1279 |
1279 // Return the generated code. | 1280 // Return the generated code. |
1280 return GetCode(kind(), Code::FAST, name); | 1281 return GetCode(kind(), Code::FAST, name); |
1281 } | 1282 } |
1282 | 1283 |
1283 | 1284 |
1284 #undef __ | 1285 #undef __ |
1285 #define __ ACCESS_MASM(masm) | 1286 #define __ ACCESS_MASM(masm) |
1286 | 1287 |
1287 | 1288 |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1597 // ----------------------------------- | 1598 // ----------------------------------- |
1598 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 1599 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
1599 } | 1600 } |
1600 | 1601 |
1601 | 1602 |
1602 #undef __ | 1603 #undef __ |
1603 | 1604 |
1604 } } // namespace v8::internal | 1605 } } // namespace v8::internal |
1605 | 1606 |
1606 #endif // V8_TARGET_ARCH_IA32 | 1607 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |