| 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 7178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7189 // Return and remove the on-stack parameter. | 7189 // Return and remove the on-stack parameter. |
| 7190 __ ret(1 * kPointerSize); | 7190 __ ret(1 * kPointerSize); |
| 7191 | 7191 |
| 7192 // Create a new closure through the slower runtime call. | 7192 // Create a new closure through the slower runtime call. |
| 7193 __ bind(&gc); | 7193 __ bind(&gc); |
| 7194 __ pop(ecx); // Temporarily remove return address. | 7194 __ pop(ecx); // Temporarily remove return address. |
| 7195 __ pop(edx); | 7195 __ pop(edx); |
| 7196 __ push(esi); | 7196 __ push(esi); |
| 7197 __ push(edx); | 7197 __ push(edx); |
| 7198 __ push(ecx); // Restore return address. | 7198 __ push(ecx); // Restore return address. |
| 7199 __ TailCallRuntime(ExternalReference(Runtime::kNewClosure), 2, 1); | 7199 __ TailCallRuntime(Runtime::kNewClosure, 2, 1); |
| 7200 } | 7200 } |
| 7201 | 7201 |
| 7202 | 7202 |
| 7203 void FastNewContextStub::Generate(MacroAssembler* masm) { | 7203 void FastNewContextStub::Generate(MacroAssembler* masm) { |
| 7204 // Try to allocate the context in new space. | 7204 // Try to allocate the context in new space. |
| 7205 Label gc; | 7205 Label gc; |
| 7206 int length = slots_ + Context::MIN_CONTEXT_SLOTS; | 7206 int length = slots_ + Context::MIN_CONTEXT_SLOTS; |
| 7207 __ AllocateInNewSpace((length * kPointerSize) + FixedArray::kHeaderSize, | 7207 __ AllocateInNewSpace((length * kPointerSize) + FixedArray::kHeaderSize, |
| 7208 eax, ebx, ecx, &gc, TAG_OBJECT); | 7208 eax, ebx, ecx, &gc, TAG_OBJECT); |
| 7209 | 7209 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 7233 for (int i = Context::MIN_CONTEXT_SLOTS; i < length; i++) { | 7233 for (int i = Context::MIN_CONTEXT_SLOTS; i < length; i++) { |
| 7234 __ mov(Operand(eax, Context::SlotOffset(i)), ebx); | 7234 __ mov(Operand(eax, Context::SlotOffset(i)), ebx); |
| 7235 } | 7235 } |
| 7236 | 7236 |
| 7237 // Return and remove the on-stack parameter. | 7237 // Return and remove the on-stack parameter. |
| 7238 __ mov(esi, Operand(eax)); | 7238 __ mov(esi, Operand(eax)); |
| 7239 __ ret(1 * kPointerSize); | 7239 __ ret(1 * kPointerSize); |
| 7240 | 7240 |
| 7241 // Need to collect. Call into runtime system. | 7241 // Need to collect. Call into runtime system. |
| 7242 __ bind(&gc); | 7242 __ bind(&gc); |
| 7243 __ TailCallRuntime(ExternalReference(Runtime::kNewContext), 1, 1); | 7243 __ TailCallRuntime(Runtime::kNewContext, 1, 1); |
| 7244 } | 7244 } |
| 7245 | 7245 |
| 7246 | 7246 |
| 7247 void FastCloneShallowArrayStub::Generate(MacroAssembler* masm) { | 7247 void FastCloneShallowArrayStub::Generate(MacroAssembler* masm) { |
| 7248 // Stack layout on entry: | 7248 // Stack layout on entry: |
| 7249 // | 7249 // |
| 7250 // [esp + kPointerSize]: constant elements. | 7250 // [esp + kPointerSize]: constant elements. |
| 7251 // [esp + (2 * kPointerSize)]: literal index. | 7251 // [esp + (2 * kPointerSize)]: literal index. |
| 7252 // [esp + (3 * kPointerSize)]: literals array. | 7252 // [esp + (3 * kPointerSize)]: literals array. |
| 7253 | 7253 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7288 for (int i = 0; i < elements_size; i += kPointerSize) { | 7288 for (int i = 0; i < elements_size; i += kPointerSize) { |
| 7289 __ mov(ebx, FieldOperand(ecx, i)); | 7289 __ mov(ebx, FieldOperand(ecx, i)); |
| 7290 __ mov(FieldOperand(edx, i), ebx); | 7290 __ mov(FieldOperand(edx, i), ebx); |
| 7291 } | 7291 } |
| 7292 } | 7292 } |
| 7293 | 7293 |
| 7294 // Return and remove the on-stack parameters. | 7294 // Return and remove the on-stack parameters. |
| 7295 __ ret(3 * kPointerSize); | 7295 __ ret(3 * kPointerSize); |
| 7296 | 7296 |
| 7297 __ bind(&slow_case); | 7297 __ bind(&slow_case); |
| 7298 ExternalReference runtime(Runtime::kCreateArrayLiteralShallow); | 7298 __ TailCallRuntime(Runtime::kCreateArrayLiteralShallow, 3, 1); |
| 7299 __ TailCallRuntime(runtime, 3, 1); | |
| 7300 } | 7299 } |
| 7301 | 7300 |
| 7302 | 7301 |
| 7303 // NOTE: The stub does not handle the inlined cases (Smis, Booleans, undefined). | 7302 // NOTE: The stub does not handle the inlined cases (Smis, Booleans, undefined). |
| 7304 void ToBooleanStub::Generate(MacroAssembler* masm) { | 7303 void ToBooleanStub::Generate(MacroAssembler* masm) { |
| 7305 Label false_result, true_result, not_string; | 7304 Label false_result, true_result, not_string; |
| 7306 __ mov(eax, Operand(esp, 1 * kPointerSize)); | 7305 __ mov(eax, Operand(esp, 1 * kPointerSize)); |
| 7307 | 7306 |
| 7308 // 'null' => false. | 7307 // 'null' => false. |
| 7309 __ cmp(eax, Factory::null_value()); | 7308 __ cmp(eax, Factory::null_value()); |
| (...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8241 GenerateOperation(masm); | 8240 GenerateOperation(masm); |
| 8242 __ mov(Operand(ecx, 0), ebx); | 8241 __ mov(Operand(ecx, 0), ebx); |
| 8243 __ mov(Operand(ecx, kIntSize), edx); | 8242 __ mov(Operand(ecx, kIntSize), edx); |
| 8244 __ mov(Operand(ecx, 2 * kIntSize), eax); | 8243 __ mov(Operand(ecx, 2 * kIntSize), eax); |
| 8245 __ fstp_d(FieldOperand(eax, HeapNumber::kValueOffset)); | 8244 __ fstp_d(FieldOperand(eax, HeapNumber::kValueOffset)); |
| 8246 __ ret(kPointerSize); | 8245 __ ret(kPointerSize); |
| 8247 | 8246 |
| 8248 __ bind(&runtime_call_clear_stack); | 8247 __ bind(&runtime_call_clear_stack); |
| 8249 __ fstp(0); | 8248 __ fstp(0); |
| 8250 __ bind(&runtime_call); | 8249 __ bind(&runtime_call); |
| 8251 __ TailCallRuntime(ExternalReference(RuntimeFunction()), 1, 1); | 8250 __ TailCallExternalReference(ExternalReference(RuntimeFunction()), 1, 1); |
| 8252 } | 8251 } |
| 8253 | 8252 |
| 8254 | 8253 |
| 8255 Runtime::FunctionId TranscendentalCacheStub::RuntimeFunction() { | 8254 Runtime::FunctionId TranscendentalCacheStub::RuntimeFunction() { |
| 8256 switch (type_) { | 8255 switch (type_) { |
| 8257 // Add more cases when necessary. | 8256 // Add more cases when necessary. |
| 8258 case TranscendentalCache::SIN: return Runtime::kMath_sin; | 8257 case TranscendentalCache::SIN: return Runtime::kMath_sin; |
| 8259 case TranscendentalCache::COS: return Runtime::kMath_cos; | 8258 case TranscendentalCache::COS: return Runtime::kMath_cos; |
| 8260 default: | 8259 default: |
| 8261 UNIMPLEMENTED(); | 8260 UNIMPLEMENTED(); |
| (...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8905 __ neg(edx); | 8904 __ neg(edx); |
| 8906 __ mov(eax, Operand(ebx, edx, times_2, kDisplacement)); | 8905 __ mov(eax, Operand(ebx, edx, times_2, kDisplacement)); |
| 8907 __ ret(0); | 8906 __ ret(0); |
| 8908 | 8907 |
| 8909 // Slow-case: Handle non-smi or out-of-bounds access to arguments | 8908 // Slow-case: Handle non-smi or out-of-bounds access to arguments |
| 8910 // by calling the runtime system. | 8909 // by calling the runtime system. |
| 8911 __ bind(&slow); | 8910 __ bind(&slow); |
| 8912 __ pop(ebx); // Return address. | 8911 __ pop(ebx); // Return address. |
| 8913 __ push(edx); | 8912 __ push(edx); |
| 8914 __ push(ebx); | 8913 __ push(ebx); |
| 8915 __ TailCallRuntime(ExternalReference(Runtime::kGetArgumentsProperty), 1, 1); | 8914 __ TailCallRuntime(Runtime::kGetArgumentsProperty, 1, 1); |
| 8916 } | 8915 } |
| 8917 | 8916 |
| 8918 | 8917 |
| 8919 void ArgumentsAccessStub::GenerateNewObject(MacroAssembler* masm) { | 8918 void ArgumentsAccessStub::GenerateNewObject(MacroAssembler* masm) { |
| 8920 // esp[0] : return address | 8919 // esp[0] : return address |
| 8921 // esp[4] : number of parameters | 8920 // esp[4] : number of parameters |
| 8922 // esp[8] : receiver displacement | 8921 // esp[8] : receiver displacement |
| 8923 // esp[16] : function | 8922 // esp[16] : function |
| 8924 | 8923 |
| 8925 // The displacement is used for skipping the return address and the | 8924 // The displacement is used for skipping the return address and the |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9006 __ sub(Operand(edx), Immediate(kPointerSize)); | 9005 __ sub(Operand(edx), Immediate(kPointerSize)); |
| 9007 __ dec(ecx); | 9006 __ dec(ecx); |
| 9008 __ j(not_zero, &loop); | 9007 __ j(not_zero, &loop); |
| 9009 | 9008 |
| 9010 // Return and remove the on-stack parameters. | 9009 // Return and remove the on-stack parameters. |
| 9011 __ bind(&done); | 9010 __ bind(&done); |
| 9012 __ ret(3 * kPointerSize); | 9011 __ ret(3 * kPointerSize); |
| 9013 | 9012 |
| 9014 // Do the runtime call to allocate the arguments object. | 9013 // Do the runtime call to allocate the arguments object. |
| 9015 __ bind(&runtime); | 9014 __ bind(&runtime); |
| 9016 __ TailCallRuntime(ExternalReference(Runtime::kNewArgumentsFast), 3, 1); | 9015 __ TailCallRuntime(Runtime::kNewArgumentsFast, 3, 1); |
| 9017 } | 9016 } |
| 9018 | 9017 |
| 9019 | 9018 |
| 9020 void RegExpExecStub::Generate(MacroAssembler* masm) { | 9019 void RegExpExecStub::Generate(MacroAssembler* masm) { |
| 9021 // Just jump directly to runtime if native RegExp is not selected at compile | 9020 // Just jump directly to runtime if native RegExp is not selected at compile |
| 9022 // time or if regexp entry in generated code is turned off runtime switch or | 9021 // time or if regexp entry in generated code is turned off runtime switch or |
| 9023 // at compilation. | 9022 // at compilation. |
| 9024 #ifndef V8_NATIVE_REGEXP | 9023 #ifndef V8_NATIVE_REGEXP |
| 9025 __ TailCallRuntime(ExternalReference(Runtime::kRegExpExec), 4, 1); | 9024 __ TailCallRuntime(Runtime::kRegExpExec, 4, 1); |
| 9026 #else // V8_NATIVE_REGEXP | 9025 #else // V8_NATIVE_REGEXP |
| 9027 if (!FLAG_regexp_entry_native) { | 9026 if (!FLAG_regexp_entry_native) { |
| 9028 __ TailCallRuntime(ExternalReference(Runtime::kRegExpExec), 4, 1); | 9027 __ TailCallRuntime(Runtime::kRegExpExec, 4, 1); |
| 9029 return; | 9028 return; |
| 9030 } | 9029 } |
| 9031 | 9030 |
| 9032 // Stack frame on entry. | 9031 // Stack frame on entry. |
| 9033 // esp[0]: return address | 9032 // esp[0]: return address |
| 9034 // esp[4]: last_match_info (expected JSArray) | 9033 // esp[4]: last_match_info (expected JSArray) |
| 9035 // esp[8]: previous index | 9034 // esp[8]: previous index |
| 9036 // esp[12]: subject string | 9035 // esp[12]: subject string |
| 9037 // esp[16]: JSRegExp object | 9036 // esp[16]: JSRegExp object |
| 9038 | 9037 |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9340 edi); | 9339 edi); |
| 9341 __ jmp(&next_capture); | 9340 __ jmp(&next_capture); |
| 9342 __ bind(&done); | 9341 __ bind(&done); |
| 9343 | 9342 |
| 9344 // Return last match info. | 9343 // Return last match info. |
| 9345 __ mov(eax, Operand(esp, kLastMatchInfoOffset)); | 9344 __ mov(eax, Operand(esp, kLastMatchInfoOffset)); |
| 9346 __ ret(4 * kPointerSize); | 9345 __ ret(4 * kPointerSize); |
| 9347 | 9346 |
| 9348 // Do the runtime call to execute the regexp. | 9347 // Do the runtime call to execute the regexp. |
| 9349 __ bind(&runtime); | 9348 __ bind(&runtime); |
| 9350 __ TailCallRuntime(ExternalReference(Runtime::kRegExpExec), 4, 1); | 9349 __ TailCallRuntime(Runtime::kRegExpExec, 4, 1); |
| 9351 #endif // V8_NATIVE_REGEXP | 9350 #endif // V8_NATIVE_REGEXP |
| 9352 } | 9351 } |
| 9353 | 9352 |
| 9354 | 9353 |
| 9355 void NumberToStringStub::GenerateLookupNumberStringCache(MacroAssembler* masm, | 9354 void NumberToStringStub::GenerateLookupNumberStringCache(MacroAssembler* masm, |
| 9356 Register object, | 9355 Register object, |
| 9357 Register result, | 9356 Register result, |
| 9358 Register scratch1, | 9357 Register scratch1, |
| 9359 Register scratch2, | 9358 Register scratch2, |
| 9360 bool object_is_smi, | 9359 bool object_is_smi, |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9409 Label runtime; | 9408 Label runtime; |
| 9410 | 9409 |
| 9411 __ mov(ebx, Operand(esp, kPointerSize)); | 9410 __ mov(ebx, Operand(esp, kPointerSize)); |
| 9412 | 9411 |
| 9413 // Generate code to lookup number in the number string cache. | 9412 // Generate code to lookup number in the number string cache. |
| 9414 GenerateLookupNumberStringCache(masm, ebx, eax, ecx, edx, false, &runtime); | 9413 GenerateLookupNumberStringCache(masm, ebx, eax, ecx, edx, false, &runtime); |
| 9415 __ ret(1 * kPointerSize); | 9414 __ ret(1 * kPointerSize); |
| 9416 | 9415 |
| 9417 __ bind(&runtime); | 9416 __ bind(&runtime); |
| 9418 // Handle number to string in the runtime system if not found in the cache. | 9417 // Handle number to string in the runtime system if not found in the cache. |
| 9419 __ TailCallRuntime(ExternalReference(Runtime::kNumberToString), 1, 1); | 9418 __ TailCallRuntime(Runtime::kNumberToString, 1, 1); |
| 9420 } | 9419 } |
| 9421 | 9420 |
| 9422 | 9421 |
| 9423 void CompareStub::Generate(MacroAssembler* masm) { | 9422 void CompareStub::Generate(MacroAssembler* masm) { |
| 9424 Label call_builtin, done; | 9423 Label call_builtin, done; |
| 9425 | 9424 |
| 9426 // NOTICE! This code is only reached after a smi-fast-case check, so | 9425 // NOTICE! This code is only reached after a smi-fast-case check, so |
| 9427 // it is certain that at least one operand isn't a smi. | 9426 // it is certain that at least one operand isn't a smi. |
| 9428 | 9427 |
| 9429 if (cc_ == equal) { // Both strict and non-strict. | 9428 if (cc_ == equal) { // Both strict and non-strict. |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9694 void StackCheckStub::Generate(MacroAssembler* masm) { | 9693 void StackCheckStub::Generate(MacroAssembler* masm) { |
| 9695 // Because builtins always remove the receiver from the stack, we | 9694 // Because builtins always remove the receiver from the stack, we |
| 9696 // have to fake one to avoid underflowing the stack. The receiver | 9695 // have to fake one to avoid underflowing the stack. The receiver |
| 9697 // must be inserted below the return address on the stack so we | 9696 // must be inserted below the return address on the stack so we |
| 9698 // temporarily store that in a register. | 9697 // temporarily store that in a register. |
| 9699 __ pop(eax); | 9698 __ pop(eax); |
| 9700 __ push(Immediate(Smi::FromInt(0))); | 9699 __ push(Immediate(Smi::FromInt(0))); |
| 9701 __ push(eax); | 9700 __ push(eax); |
| 9702 | 9701 |
| 9703 // Do tail-call to runtime routine. | 9702 // Do tail-call to runtime routine. |
| 9704 __ TailCallRuntime(ExternalReference(Runtime::kStackGuard), 1, 1); | 9703 __ TailCallRuntime(Runtime::kStackGuard, 1, 1); |
| 9705 } | 9704 } |
| 9706 | 9705 |
| 9707 | 9706 |
| 9708 void CallFunctionStub::Generate(MacroAssembler* masm) { | 9707 void CallFunctionStub::Generate(MacroAssembler* masm) { |
| 9709 Label slow; | 9708 Label slow; |
| 9710 | 9709 |
| 9711 // If the receiver might be a value (string, number or boolean) check for this | 9710 // If the receiver might be a value (string, number or boolean) check for this |
| 9712 // and box it if it is. | 9711 // and box it if it is. |
| 9713 if (ReceiverMightBeValue()) { | 9712 if (ReceiverMightBeValue()) { |
| 9714 // Get the receiver from the stack. | 9713 // Get the receiver from the stack. |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9855 // It was zero; the result is undefined. | 9854 // It was zero; the result is undefined. |
| 9856 __ mov(eax, Factory::undefined_value()); | 9855 __ mov(eax, Factory::undefined_value()); |
| 9857 __ jmp(&prologue); | 9856 __ jmp(&prologue); |
| 9858 // It was non-zero. Dereference to get the result value. | 9857 // It was non-zero. Dereference to get the result value. |
| 9859 __ bind(&get_result); | 9858 __ bind(&get_result); |
| 9860 __ mov(eax, Operand(eax, 0)); | 9859 __ mov(eax, Operand(eax, 0)); |
| 9861 __ bind(&prologue); | 9860 __ bind(&prologue); |
| 9862 __ LeaveExitFrame(ExitFrame::MODE_NORMAL); | 9861 __ LeaveExitFrame(ExitFrame::MODE_NORMAL); |
| 9863 __ ret(0); | 9862 __ ret(0); |
| 9864 __ bind(&promote_scheduled_exception); | 9863 __ bind(&promote_scheduled_exception); |
| 9865 __ TailCallRuntime(ExternalReference(Runtime::kPromoteScheduledException), | 9864 __ TailCallRuntime(Runtime::kPromoteScheduledException, 0, 1); |
| 9866 0, | |
| 9867 1); | |
| 9868 } | 9865 } |
| 9869 | 9866 |
| 9870 | 9867 |
| 9871 void CEntryStub::GenerateCore(MacroAssembler* masm, | 9868 void CEntryStub::GenerateCore(MacroAssembler* masm, |
| 9872 Label* throw_normal_exception, | 9869 Label* throw_normal_exception, |
| 9873 Label* throw_termination_exception, | 9870 Label* throw_termination_exception, |
| 9874 Label* throw_out_of_memory_exception, | 9871 Label* throw_out_of_memory_exception, |
| 9875 bool do_gc, | 9872 bool do_gc, |
| 9876 bool always_allocate_scope) { | 9873 bool always_allocate_scope) { |
| 9877 // eax: result parameter for PerformGC, if any | 9874 // eax: result parameter for PerformGC, if any |
| (...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10486 // eax: result string | 10483 // eax: result string |
| 10487 // ecx: next character of result | 10484 // ecx: next character of result |
| 10488 // edx: first char of second argument | 10485 // edx: first char of second argument |
| 10489 // edi: length of second argument | 10486 // edi: length of second argument |
| 10490 GenerateCopyCharacters(masm, ecx, edx, edi, ebx, false); | 10487 GenerateCopyCharacters(masm, ecx, edx, edi, ebx, false); |
| 10491 __ IncrementCounter(&Counters::string_add_native, 1); | 10488 __ IncrementCounter(&Counters::string_add_native, 1); |
| 10492 __ ret(2 * kPointerSize); | 10489 __ ret(2 * kPointerSize); |
| 10493 | 10490 |
| 10494 // Just jump to runtime to add the two strings. | 10491 // Just jump to runtime to add the two strings. |
| 10495 __ bind(&string_add_runtime); | 10492 __ bind(&string_add_runtime); |
| 10496 __ TailCallRuntime(ExternalReference(Runtime::kStringAdd), 2, 1); | 10493 __ TailCallRuntime(Runtime::kStringAdd, 2, 1); |
| 10497 } | 10494 } |
| 10498 | 10495 |
| 10499 | 10496 |
| 10500 void StringStubBase::GenerateCopyCharacters(MacroAssembler* masm, | 10497 void StringStubBase::GenerateCopyCharacters(MacroAssembler* masm, |
| 10501 Register dest, | 10498 Register dest, |
| 10502 Register src, | 10499 Register src, |
| 10503 Register count, | 10500 Register count, |
| 10504 Register scratch, | 10501 Register scratch, |
| 10505 bool ascii) { | 10502 bool ascii) { |
| 10506 Label loop; | 10503 Label loop; |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10896 // edx: original value of esi | 10893 // edx: original value of esi |
| 10897 // edi: first character of result | 10894 // edi: first character of result |
| 10898 // esi: character of sub string start | 10895 // esi: character of sub string start |
| 10899 GenerateCopyCharactersREP(masm, edi, esi, ecx, ebx, false); | 10896 GenerateCopyCharactersREP(masm, edi, esi, ecx, ebx, false); |
| 10900 __ mov(esi, edx); // Restore esi. | 10897 __ mov(esi, edx); // Restore esi. |
| 10901 __ IncrementCounter(&Counters::sub_string_native, 1); | 10898 __ IncrementCounter(&Counters::sub_string_native, 1); |
| 10902 __ ret(3 * kPointerSize); | 10899 __ ret(3 * kPointerSize); |
| 10903 | 10900 |
| 10904 // Just jump to runtime to create the sub string. | 10901 // Just jump to runtime to create the sub string. |
| 10905 __ bind(&runtime); | 10902 __ bind(&runtime); |
| 10906 __ TailCallRuntime(ExternalReference(Runtime::kSubString), 3, 1); | 10903 __ TailCallRuntime(Runtime::kSubString, 3, 1); |
| 10907 } | 10904 } |
| 10908 | 10905 |
| 10909 | 10906 |
| 10910 void StringCompareStub::GenerateCompareFlatAsciiStrings(MacroAssembler* masm, | 10907 void StringCompareStub::GenerateCompareFlatAsciiStrings(MacroAssembler* masm, |
| 10911 Register left, | 10908 Register left, |
| 10912 Register right, | 10909 Register right, |
| 10913 Register scratch1, | 10910 Register scratch1, |
| 10914 Register scratch2, | 10911 Register scratch2, |
| 10915 Register scratch3) { | 10912 Register scratch3) { |
| 10916 Label result_not_equal; | 10913 Label result_not_equal; |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11012 // Check that both objects are sequential ascii strings. | 11009 // Check that both objects are sequential ascii strings. |
| 11013 __ JumpIfNotBothSequentialAsciiStrings(edx, eax, ecx, ebx, &runtime); | 11010 __ JumpIfNotBothSequentialAsciiStrings(edx, eax, ecx, ebx, &runtime); |
| 11014 | 11011 |
| 11015 // Compare flat ascii strings. | 11012 // Compare flat ascii strings. |
| 11016 __ IncrementCounter(&Counters::string_compare_native, 1); | 11013 __ IncrementCounter(&Counters::string_compare_native, 1); |
| 11017 GenerateCompareFlatAsciiStrings(masm, edx, eax, ecx, ebx, edi); | 11014 GenerateCompareFlatAsciiStrings(masm, edx, eax, ecx, ebx, edi); |
| 11018 | 11015 |
| 11019 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) | 11016 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) |
| 11020 // tagged as a small integer. | 11017 // tagged as a small integer. |
| 11021 __ bind(&runtime); | 11018 __ bind(&runtime); |
| 11022 __ TailCallRuntime(ExternalReference(Runtime::kStringCompare), 2, 1); | 11019 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); |
| 11023 } | 11020 } |
| 11024 | 11021 |
| 11025 #undef __ | 11022 #undef __ |
| 11026 | 11023 |
| 11027 } } // namespace v8::internal | 11024 } } // namespace v8::internal |
| OLD | NEW |