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 2197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2208 ASSERT(args->length() == 1); | 2208 ASSERT(args->length() == 1); |
2209 Label done, null, function, non_function_constructor; | 2209 Label done, null, function, non_function_constructor; |
2210 | 2210 |
2211 VisitForValue(args->at(0), kAccumulator); | 2211 VisitForValue(args->at(0), kAccumulator); |
2212 | 2212 |
2213 // If the object is a smi, we return null. | 2213 // If the object is a smi, we return null. |
2214 __ JumpIfSmi(rax, &null); | 2214 __ JumpIfSmi(rax, &null); |
2215 | 2215 |
2216 // Check that the object is a JS object but take special care of JS | 2216 // Check that the object is a JS object but take special care of JS |
2217 // functions to make sure they have 'Function' as their class. | 2217 // functions to make sure they have 'Function' as their class. |
2218 __ CmpObjectType(rax, FIRST_JS_OBJECT_TYPE, rax); | 2218 __ CmpObjectType(rax, FIRST_JS_OBJECT_TYPE, rax); // Map is now in rax. |
2219 __ j(below, &null); | 2219 __ j(below, &null); |
2220 | 2220 |
2221 // As long as JS_FUNCTION_TYPE is the last instance type and it is | 2221 // As long as JS_FUNCTION_TYPE is the last instance type and it is |
2222 // right after LAST_JS_OBJECT_TYPE, we can avoid checking for | 2222 // right after LAST_JS_OBJECT_TYPE, we can avoid checking for |
2223 // LAST_JS_OBJECT_TYPE. | 2223 // LAST_JS_OBJECT_TYPE. |
2224 ASSERT(LAST_TYPE == JS_FUNCTION_TYPE); | 2224 ASSERT(LAST_TYPE == JS_FUNCTION_TYPE); |
2225 ASSERT(JS_FUNCTION_TYPE == LAST_JS_OBJECT_TYPE + 1); | 2225 ASSERT(JS_FUNCTION_TYPE == LAST_JS_OBJECT_TYPE + 1); |
2226 __ CmpInstanceType(rax, JS_FUNCTION_TYPE); | 2226 __ CmpInstanceType(rax, JS_FUNCTION_TYPE); |
2227 __ j(equal, &function); | 2227 __ j(equal, &function); |
2228 | 2228 |
(...skipping 981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3210 __ ret(0); | 3210 __ ret(0); |
3211 } | 3211 } |
3212 | 3212 |
3213 | 3213 |
3214 #undef __ | 3214 #undef __ |
3215 | 3215 |
3216 | 3216 |
3217 } } // namespace v8::internal | 3217 } } // namespace v8::internal |
3218 | 3218 |
3219 #endif // V8_TARGET_ARCH_X64 | 3219 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |