OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 2011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2022 return GetCode(FIELD, name); | 2022 return GetCode(FIELD, name); |
2023 } | 2023 } |
2024 | 2024 |
2025 | 2025 |
2026 Object* KeyedStoreStubCompiler::CompileStoreField(JSObject* object, | 2026 Object* KeyedStoreStubCompiler::CompileStoreField(JSObject* object, |
2027 int index, | 2027 int index, |
2028 Map* transition, | 2028 Map* transition, |
2029 String* name) { | 2029 String* name) { |
2030 // ----------- S t a t e ------------- | 2030 // ----------- S t a t e ------------- |
2031 // -- rax : value | 2031 // -- rax : value |
| 2032 // -- rcx : key |
| 2033 // -- rdx : receiver |
2032 // -- rsp[0] : return address | 2034 // -- rsp[0] : return address |
2033 // -- rsp[8] : key | |
2034 // -- rsp[16] : receiver | |
2035 // ----------------------------------- | 2035 // ----------------------------------- |
2036 Label miss; | 2036 Label miss; |
2037 | 2037 |
2038 __ IncrementCounter(&Counters::keyed_store_field, 1); | 2038 __ IncrementCounter(&Counters::keyed_store_field, 1); |
2039 | 2039 |
2040 // Get the name from the stack. | |
2041 __ movq(rcx, Operand(rsp, 1 * kPointerSize)); | |
2042 // Check that the name has not changed. | 2040 // Check that the name has not changed. |
2043 __ Cmp(rcx, Handle<String>(name)); | 2041 __ Cmp(rcx, Handle<String>(name)); |
2044 __ j(not_equal, &miss); | 2042 __ j(not_equal, &miss); |
2045 | 2043 |
2046 // Get the receiver from the stack. | |
2047 __ movq(rdx, Operand(rsp, 2 * kPointerSize)); | |
2048 | |
2049 // Generate store field code. Preserves receiver and name on jump to miss. | 2044 // Generate store field code. Preserves receiver and name on jump to miss. |
2050 GenerateStoreField(masm(), | 2045 GenerateStoreField(masm(), |
2051 object, | 2046 object, |
2052 index, | 2047 index, |
2053 transition, | 2048 transition, |
2054 rdx, rcx, rbx, | 2049 rdx, rcx, rbx, |
2055 &miss); | 2050 &miss); |
2056 | 2051 |
2057 // Handle store cache miss. | 2052 // Handle store cache miss. |
2058 __ bind(&miss); | 2053 __ bind(&miss); |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2364 // Return the generated code. | 2359 // Return the generated code. |
2365 return GetCode(); | 2360 return GetCode(); |
2366 } | 2361 } |
2367 | 2362 |
2368 | 2363 |
2369 #undef __ | 2364 #undef __ |
2370 | 2365 |
2371 } } // namespace v8::internal | 2366 } } // namespace v8::internal |
2372 | 2367 |
2373 #endif // V8_TARGET_ARCH_X64 | 2368 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |