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 2042 matching lines...) Loading... |
2053 // Patch the receiver on the stack with the global proxy if | 2053 // Patch the receiver on the stack with the global proxy if |
2054 // necessary. | 2054 // necessary. |
2055 if (object->IsGlobalObject()) { | 2055 if (object->IsGlobalObject()) { |
2056 ASSERT(depth == kInvalidProtoDepth); | 2056 ASSERT(depth == kInvalidProtoDepth); |
2057 __ movq(rdx, FieldOperand(rdx, GlobalObject::kGlobalReceiverOffset)); | 2057 __ movq(rdx, FieldOperand(rdx, GlobalObject::kGlobalReceiverOffset)); |
2058 __ movq(Operand(rsp, (argc + 1) * kPointerSize), rdx); | 2058 __ movq(Operand(rsp, (argc + 1) * kPointerSize), rdx); |
2059 } | 2059 } |
2060 break; | 2060 break; |
2061 | 2061 |
2062 case STRING_CHECK: | 2062 case STRING_CHECK: |
2063 if (!function->IsBuiltin()) { | 2063 if (!function->IsBuiltin() && !function_info->strict_mode()) { |
2064 // Calling non-builtins with a value as receiver requires boxing. | 2064 // Calling non-strict non-builtins with a value as the receiver |
| 2065 // requires boxing. |
2065 __ jmp(&miss); | 2066 __ jmp(&miss); |
2066 } else { | 2067 } else { |
2067 // Check that the object is a two-byte string or a symbol. | 2068 // Check that the object is a two-byte string or a symbol. |
2068 __ CmpObjectType(rdx, FIRST_NONSTRING_TYPE, rax); | 2069 __ CmpObjectType(rdx, FIRST_NONSTRING_TYPE, rax); |
2069 __ j(above_equal, &miss); | 2070 __ j(above_equal, &miss); |
2070 // Check that the maps starting from the prototype haven't changed. | 2071 // Check that the maps starting from the prototype haven't changed. |
2071 GenerateDirectLoadGlobalFunctionPrototype( | 2072 GenerateDirectLoadGlobalFunctionPrototype( |
2072 masm(), Context::STRING_FUNCTION_INDEX, rax, &miss); | 2073 masm(), Context::STRING_FUNCTION_INDEX, rax, &miss); |
2073 CheckPrototypes(JSObject::cast(object->GetPrototype()), rax, holder, | 2074 CheckPrototypes(JSObject::cast(object->GetPrototype()), rax, holder, |
2074 rbx, rdx, rdi, name, &miss); | 2075 rbx, rdx, rdi, name, &miss); |
2075 } | 2076 } |
2076 break; | 2077 break; |
2077 | 2078 |
2078 case NUMBER_CHECK: { | 2079 case NUMBER_CHECK: { |
2079 if (!function->IsBuiltin()) { | 2080 if (!function->IsBuiltin() && !function_info->strict_mode()) { |
2080 // Calling non-builtins with a value as receiver requires boxing. | 2081 // Calling non-strict non-builtins with a value as the receiver |
| 2082 // requires boxing. |
2081 __ jmp(&miss); | 2083 __ jmp(&miss); |
2082 } else { | 2084 } else { |
2083 Label fast; | 2085 Label fast; |
2084 // Check that the object is a smi or a heap number. | 2086 // Check that the object is a smi or a heap number. |
2085 __ JumpIfSmi(rdx, &fast); | 2087 __ JumpIfSmi(rdx, &fast); |
2086 __ CmpObjectType(rdx, HEAP_NUMBER_TYPE, rax); | 2088 __ CmpObjectType(rdx, HEAP_NUMBER_TYPE, rax); |
2087 __ j(not_equal, &miss); | 2089 __ j(not_equal, &miss); |
2088 __ bind(&fast); | 2090 __ bind(&fast); |
2089 // Check that the maps starting from the prototype haven't changed. | 2091 // Check that the maps starting from the prototype haven't changed. |
2090 GenerateDirectLoadGlobalFunctionPrototype( | 2092 GenerateDirectLoadGlobalFunctionPrototype( |
2091 masm(), Context::NUMBER_FUNCTION_INDEX, rax, &miss); | 2093 masm(), Context::NUMBER_FUNCTION_INDEX, rax, &miss); |
2092 CheckPrototypes(JSObject::cast(object->GetPrototype()), rax, holder, | 2094 CheckPrototypes(JSObject::cast(object->GetPrototype()), rax, holder, |
2093 rbx, rdx, rdi, name, &miss); | 2095 rbx, rdx, rdi, name, &miss); |
2094 } | 2096 } |
2095 break; | 2097 break; |
2096 } | 2098 } |
2097 | 2099 |
2098 case BOOLEAN_CHECK: { | 2100 case BOOLEAN_CHECK: { |
2099 if (!function->IsBuiltin()) { | 2101 if (!function->IsBuiltin() && !function_info->strict_mode()) { |
2100 // Calling non-builtins with a value as receiver requires boxing. | 2102 // Calling non-strict non-builtins with a value as the receiver |
| 2103 // requires boxing. |
2101 __ jmp(&miss); | 2104 __ jmp(&miss); |
2102 } else { | 2105 } else { |
2103 Label fast; | 2106 Label fast; |
2104 // Check that the object is a boolean. | 2107 // Check that the object is a boolean. |
2105 __ CompareRoot(rdx, Heap::kTrueValueRootIndex); | 2108 __ CompareRoot(rdx, Heap::kTrueValueRootIndex); |
2106 __ j(equal, &fast); | 2109 __ j(equal, &fast); |
2107 __ CompareRoot(rdx, Heap::kFalseValueRootIndex); | 2110 __ CompareRoot(rdx, Heap::kFalseValueRootIndex); |
2108 __ j(not_equal, &miss); | 2111 __ j(not_equal, &miss); |
2109 __ bind(&fast); | 2112 __ bind(&fast); |
2110 // Check that the maps starting from the prototype haven't changed. | 2113 // Check that the maps starting from the prototype haven't changed. |
(...skipping 1382 matching lines...) Loading... |
3493 __ TailCallRuntime(Runtime::kSetProperty, 3, 1); | 3496 __ TailCallRuntime(Runtime::kSetProperty, 3, 1); |
3494 | 3497 |
3495 return GetCode(flags); | 3498 return GetCode(flags); |
3496 } | 3499 } |
3497 | 3500 |
3498 #undef __ | 3501 #undef __ |
3499 | 3502 |
3500 } } // namespace v8::internal | 3503 } } // namespace v8::internal |
3501 | 3504 |
3502 #endif // V8_TARGET_ARCH_X64 | 3505 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |