| 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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 Register receiver, | 251 Register receiver, |
| 252 Register scratch, | 252 Register scratch, |
| 253 Label* smi, | 253 Label* smi, |
| 254 Label* non_string_object) { | 254 Label* non_string_object) { |
| 255 // Check that the object isn't a smi. | 255 // Check that the object isn't a smi. |
| 256 __ JumpIfSmi(receiver, smi); | 256 __ JumpIfSmi(receiver, smi); |
| 257 | 257 |
| 258 // Check that the object is a string. | 258 // Check that the object is a string. |
| 259 __ movq(scratch, FieldOperand(receiver, HeapObject::kMapOffset)); | 259 __ movq(scratch, FieldOperand(receiver, HeapObject::kMapOffset)); |
| 260 __ movzxbq(scratch, FieldOperand(scratch, Map::kInstanceTypeOffset)); | 260 __ movzxbq(scratch, FieldOperand(scratch, Map::kInstanceTypeOffset)); |
| 261 ASSERT(kNotStringTag != 0); | 261 STATIC_ASSERT(kNotStringTag != 0); |
| 262 __ testl(scratch, Immediate(kNotStringTag)); | 262 __ testl(scratch, Immediate(kNotStringTag)); |
| 263 __ j(not_zero, non_string_object); | 263 __ j(not_zero, non_string_object); |
| 264 } | 264 } |
| 265 | 265 |
| 266 | 266 |
| 267 void StubCompiler::GenerateLoadStringLength(MacroAssembler* masm, | 267 void StubCompiler::GenerateLoadStringLength(MacroAssembler* masm, |
| 268 Register receiver, | 268 Register receiver, |
| 269 Register scratch1, | 269 Register scratch1, |
| 270 Register scratch2, | 270 Register scratch2, |
| 271 Label* miss, | 271 Label* miss, |
| (...skipping 2814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3086 // code for the function thereby hitting the break points. | 3086 // code for the function thereby hitting the break points. |
| 3087 __ movq(rbx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset)); | 3087 __ movq(rbx, FieldOperand(rdi, JSFunction::kSharedFunctionInfoOffset)); |
| 3088 __ movq(rbx, FieldOperand(rbx, SharedFunctionInfo::kDebugInfoOffset)); | 3088 __ movq(rbx, FieldOperand(rbx, SharedFunctionInfo::kDebugInfoOffset)); |
| 3089 __ cmpq(rbx, r8); | 3089 __ cmpq(rbx, r8); |
| 3090 __ j(not_equal, &generic_stub_call); | 3090 __ j(not_equal, &generic_stub_call); |
| 3091 #endif | 3091 #endif |
| 3092 | 3092 |
| 3093 // Load the initial map and verify that it is in fact a map. | 3093 // Load the initial map and verify that it is in fact a map. |
| 3094 __ movq(rbx, FieldOperand(rdi, JSFunction::kPrototypeOrInitialMapOffset)); | 3094 __ movq(rbx, FieldOperand(rdi, JSFunction::kPrototypeOrInitialMapOffset)); |
| 3095 // Will both indicate a NULL and a Smi. | 3095 // Will both indicate a NULL and a Smi. |
| 3096 ASSERT(kSmiTag == 0); | 3096 STATIC_ASSERT(kSmiTag == 0); |
| 3097 __ JumpIfSmi(rbx, &generic_stub_call); | 3097 __ JumpIfSmi(rbx, &generic_stub_call); |
| 3098 __ CmpObjectType(rbx, MAP_TYPE, rcx); | 3098 __ CmpObjectType(rbx, MAP_TYPE, rcx); |
| 3099 __ j(not_equal, &generic_stub_call); | 3099 __ j(not_equal, &generic_stub_call); |
| 3100 | 3100 |
| 3101 #ifdef DEBUG | 3101 #ifdef DEBUG |
| 3102 // Cannot construct functions this way. | 3102 // Cannot construct functions this way. |
| 3103 // rdi: constructor | 3103 // rdi: constructor |
| 3104 // rbx: initial map | 3104 // rbx: initial map |
| 3105 __ CmpInstanceType(rbx, JS_FUNCTION_TYPE); | 3105 __ CmpInstanceType(rbx, JS_FUNCTION_TYPE); |
| 3106 __ Assert(not_equal, "Function constructed by construct stub."); | 3106 __ Assert(not_equal, "Function constructed by construct stub."); |
| (...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3791 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); | 3791 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); |
| 3792 __ jmp(ic_force_generic, RelocInfo::CODE_TARGET); | 3792 __ jmp(ic_force_generic, RelocInfo::CODE_TARGET); |
| 3793 } | 3793 } |
| 3794 | 3794 |
| 3795 | 3795 |
| 3796 #undef __ | 3796 #undef __ |
| 3797 | 3797 |
| 3798 } } // namespace v8::internal | 3798 } } // namespace v8::internal |
| 3799 | 3799 |
| 3800 #endif // V8_TARGET_ARCH_X64 | 3800 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |