| 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 10 matching lines...) Expand all Loading... |
| 21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | 27 |
| 28 | 28 |
| 29 #include "v8.h" | 29 #include "v8.h" |
| 30 | 30 |
| 31 #if defined(V8_TARGET_ARCH_X64) |
| 32 |
| 31 #include "ic-inl.h" | 33 #include "ic-inl.h" |
| 32 #include "codegen-inl.h" | 34 #include "codegen-inl.h" |
| 33 #include "stub-cache.h" | 35 #include "stub-cache.h" |
| 34 #include "macro-assembler-x64.h" | 36 #include "macro-assembler-x64.h" |
| 35 | 37 |
| 36 namespace v8 { | 38 namespace v8 { |
| 37 namespace internal { | 39 namespace internal { |
| 38 | 40 |
| 39 //----------------------------------------------------------------------------- | 41 //----------------------------------------------------------------------------- |
| 40 // StubCompiler static helper functions | 42 // StubCompiler static helper functions |
| (...skipping 1979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2020 return GetCode(FIELD, name); | 2022 return GetCode(FIELD, name); |
| 2021 } | 2023 } |
| 2022 | 2024 |
| 2023 | 2025 |
| 2024 Object* KeyedStoreStubCompiler::CompileStoreField(JSObject* object, | 2026 Object* KeyedStoreStubCompiler::CompileStoreField(JSObject* object, |
| 2025 int index, | 2027 int index, |
| 2026 Map* transition, | 2028 Map* transition, |
| 2027 String* name) { | 2029 String* name) { |
| 2028 // ----------- S t a t e ------------- | 2030 // ----------- S t a t e ------------- |
| 2029 // -- rax : value | 2031 // -- rax : value |
| 2032 // -- rcx : key |
| 2033 // -- rdx : receiver |
| 2030 // -- rsp[0] : return address | 2034 // -- rsp[0] : return address |
| 2031 // -- rsp[8] : key | |
| 2032 // -- rsp[16] : receiver | |
| 2033 // ----------------------------------- | 2035 // ----------------------------------- |
| 2034 Label miss; | 2036 Label miss; |
| 2035 | 2037 |
| 2036 __ IncrementCounter(&Counters::keyed_store_field, 1); | 2038 __ IncrementCounter(&Counters::keyed_store_field, 1); |
| 2037 | 2039 |
| 2038 // Get the name from the stack. | |
| 2039 __ movq(rcx, Operand(rsp, 1 * kPointerSize)); | |
| 2040 // Check that the name has not changed. | 2040 // Check that the name has not changed. |
| 2041 __ Cmp(rcx, Handle<String>(name)); | 2041 __ Cmp(rcx, Handle<String>(name)); |
| 2042 __ j(not_equal, &miss); | 2042 __ j(not_equal, &miss); |
| 2043 | 2043 |
| 2044 // Get the receiver from the stack. | |
| 2045 __ movq(rdx, Operand(rsp, 2 * kPointerSize)); | |
| 2046 | |
| 2047 // 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. |
| 2048 GenerateStoreField(masm(), | 2045 GenerateStoreField(masm(), |
| 2049 object, | 2046 object, |
| 2050 index, | 2047 index, |
| 2051 transition, | 2048 transition, |
| 2052 rdx, rcx, rbx, | 2049 rdx, rcx, rbx, |
| 2053 &miss); | 2050 &miss); |
| 2054 | 2051 |
| 2055 // Handle store cache miss. | 2052 // Handle store cache miss. |
| 2056 __ bind(&miss); | 2053 __ bind(&miss); |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2360 __ Jump(generic_construct_stub, RelocInfo::CODE_TARGET); | 2357 __ Jump(generic_construct_stub, RelocInfo::CODE_TARGET); |
| 2361 | 2358 |
| 2362 // Return the generated code. | 2359 // Return the generated code. |
| 2363 return GetCode(); | 2360 return GetCode(); |
| 2364 } | 2361 } |
| 2365 | 2362 |
| 2366 | 2363 |
| 2367 #undef __ | 2364 #undef __ |
| 2368 | 2365 |
| 2369 } } // namespace v8::internal | 2366 } } // namespace v8::internal |
| 2367 |
| 2368 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |