OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2008 | 2008 |
2009 // Patch the receiver on the stack with the global proxy if | 2009 // Patch the receiver on the stack with the global proxy if |
2010 // necessary. | 2010 // necessary. |
2011 if (object->IsGlobalObject()) { | 2011 if (object->IsGlobalObject()) { |
2012 __ movq(rdx, FieldOperand(rdx, GlobalObject::kGlobalReceiverOffset)); | 2012 __ movq(rdx, FieldOperand(rdx, GlobalObject::kGlobalReceiverOffset)); |
2013 __ movq(Operand(rsp, (argc + 1) * kPointerSize), rdx); | 2013 __ movq(Operand(rsp, (argc + 1) * kPointerSize), rdx); |
2014 } | 2014 } |
2015 break; | 2015 break; |
2016 | 2016 |
2017 case STRING_CHECK: | 2017 case STRING_CHECK: |
2018 if (function->IsBuiltin() || function->shared()->strict_mode()) { | 2018 if (function->IsBuiltin() || !function->shared()->is_classic_mode()) { |
2019 // Check that the object is a two-byte string or a symbol. | 2019 // Check that the object is a two-byte string or a symbol. |
2020 __ CmpObjectType(rdx, FIRST_NONSTRING_TYPE, rax); | 2020 __ CmpObjectType(rdx, FIRST_NONSTRING_TYPE, rax); |
2021 __ j(above_equal, &miss); | 2021 __ j(above_equal, &miss); |
2022 // Check that the maps starting from the prototype haven't changed. | 2022 // Check that the maps starting from the prototype haven't changed. |
2023 GenerateDirectLoadGlobalFunctionPrototype( | 2023 GenerateDirectLoadGlobalFunctionPrototype( |
2024 masm(), Context::STRING_FUNCTION_INDEX, rax, &miss); | 2024 masm(), Context::STRING_FUNCTION_INDEX, rax, &miss); |
2025 CheckPrototypes( | 2025 CheckPrototypes( |
2026 Handle<JSObject>(JSObject::cast(object->GetPrototype())), | 2026 Handle<JSObject>(JSObject::cast(object->GetPrototype())), |
2027 rax, holder, rbx, rdx, rdi, name, &miss); | 2027 rax, holder, rbx, rdx, rdi, name, &miss); |
2028 } else { | 2028 } else { |
2029 // Calling non-strict non-builtins with a value as the receiver | 2029 // Calling non-strict non-builtins with a value as the receiver |
2030 // requires boxing. | 2030 // requires boxing. |
2031 __ jmp(&miss); | 2031 __ jmp(&miss); |
2032 } | 2032 } |
2033 break; | 2033 break; |
2034 | 2034 |
2035 case NUMBER_CHECK: | 2035 case NUMBER_CHECK: |
2036 if (function->IsBuiltin() || function->shared()->strict_mode()) { | 2036 if (function->IsBuiltin() || !function->shared()->is_classic_mode()) { |
2037 Label fast; | 2037 Label fast; |
2038 // Check that the object is a smi or a heap number. | 2038 // Check that the object is a smi or a heap number. |
2039 __ JumpIfSmi(rdx, &fast); | 2039 __ JumpIfSmi(rdx, &fast); |
2040 __ CmpObjectType(rdx, HEAP_NUMBER_TYPE, rax); | 2040 __ CmpObjectType(rdx, HEAP_NUMBER_TYPE, rax); |
2041 __ j(not_equal, &miss); | 2041 __ j(not_equal, &miss); |
2042 __ bind(&fast); | 2042 __ bind(&fast); |
2043 // Check that the maps starting from the prototype haven't changed. | 2043 // Check that the maps starting from the prototype haven't changed. |
2044 GenerateDirectLoadGlobalFunctionPrototype( | 2044 GenerateDirectLoadGlobalFunctionPrototype( |
2045 masm(), Context::NUMBER_FUNCTION_INDEX, rax, &miss); | 2045 masm(), Context::NUMBER_FUNCTION_INDEX, rax, &miss); |
2046 CheckPrototypes( | 2046 CheckPrototypes( |
2047 Handle<JSObject>(JSObject::cast(object->GetPrototype())), | 2047 Handle<JSObject>(JSObject::cast(object->GetPrototype())), |
2048 rax, holder, rbx, rdx, rdi, name, &miss); | 2048 rax, holder, rbx, rdx, rdi, name, &miss); |
2049 } else { | 2049 } else { |
2050 // Calling non-strict non-builtins with a value as the receiver | 2050 // Calling non-strict non-builtins with a value as the receiver |
2051 // requires boxing. | 2051 // requires boxing. |
2052 __ jmp(&miss); | 2052 __ jmp(&miss); |
2053 } | 2053 } |
2054 break; | 2054 break; |
2055 | 2055 |
2056 case BOOLEAN_CHECK: | 2056 case BOOLEAN_CHECK: |
2057 if (function->IsBuiltin() || function->shared()->strict_mode()) { | 2057 if (function->IsBuiltin() || !function->shared()->is_classic_mode()) { |
2058 Label fast; | 2058 Label fast; |
2059 // Check that the object is a boolean. | 2059 // Check that the object is a boolean. |
2060 __ CompareRoot(rdx, Heap::kTrueValueRootIndex); | 2060 __ CompareRoot(rdx, Heap::kTrueValueRootIndex); |
2061 __ j(equal, &fast); | 2061 __ j(equal, &fast); |
2062 __ CompareRoot(rdx, Heap::kFalseValueRootIndex); | 2062 __ CompareRoot(rdx, Heap::kFalseValueRootIndex); |
2063 __ j(not_equal, &miss); | 2063 __ j(not_equal, &miss); |
2064 __ bind(&fast); | 2064 __ bind(&fast); |
2065 // Check that the maps starting from the prototype haven't changed. | 2065 // Check that the maps starting from the prototype haven't changed. |
2066 GenerateDirectLoadGlobalFunctionPrototype( | 2066 GenerateDirectLoadGlobalFunctionPrototype( |
2067 masm(), Context::BOOLEAN_FUNCTION_INDEX, rax, &miss); | 2067 masm(), Context::BOOLEAN_FUNCTION_INDEX, rax, &miss); |
(...skipping 1546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3614 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss(); | 3614 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss(); |
3615 __ jmp(ic_miss, RelocInfo::CODE_TARGET); | 3615 __ jmp(ic_miss, RelocInfo::CODE_TARGET); |
3616 } | 3616 } |
3617 | 3617 |
3618 | 3618 |
3619 #undef __ | 3619 #undef __ |
3620 | 3620 |
3621 } } // namespace v8::internal | 3621 } } // namespace v8::internal |
3622 | 3622 |
3623 #endif // V8_TARGET_ARCH_X64 | 3623 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |