Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/x64/codegen-x64.cc

Issue 1635001: Make not sucking at regexp the default... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 6926 matching lines...) Expand 10 before | Expand all | Expand 10 after
6937 default: 6937 default:
6938 UNREACHABLE(); 6938 UNREACHABLE();
6939 } 6939 }
6940 } 6940 }
6941 6941
6942 6942
6943 void RegExpExecStub::Generate(MacroAssembler* masm) { 6943 void RegExpExecStub::Generate(MacroAssembler* masm) {
6944 // Just jump directly to runtime if native RegExp is not selected at compile 6944 // Just jump directly to runtime if native RegExp is not selected at compile
6945 // time or if regexp entry in generated code is turned off runtime switch or 6945 // time or if regexp entry in generated code is turned off runtime switch or
6946 // at compilation. 6946 // at compilation.
6947 #ifndef V8_NATIVE_REGEXP 6947 #ifdef V8_INTERPRETED_REGEXP
6948 __ TailCallRuntime(Runtime::kRegExpExec, 4, 1); 6948 __ TailCallRuntime(Runtime::kRegExpExec, 4, 1);
6949 #else // V8_NATIVE_REGEXP 6949 #else // V8_INTERPRETED_REGEXP
6950 if (!FLAG_regexp_entry_native) { 6950 if (!FLAG_regexp_entry_native) {
6951 __ TailCallRuntime(Runtime::kRegExpExec, 4, 1); 6951 __ TailCallRuntime(Runtime::kRegExpExec, 4, 1);
6952 return; 6952 return;
6953 } 6953 }
6954 6954
6955 // Stack frame on entry. 6955 // Stack frame on entry.
6956 // esp[0]: return address 6956 // esp[0]: return address
6957 // esp[8]: last_match_info (expected JSArray) 6957 // esp[8]: last_match_info (expected JSArray)
6958 // esp[16]: previous index 6958 // esp[16]: previous index
6959 // esp[24]: subject string 6959 // esp[24]: subject string
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
7280 __ jmp(&next_capture); 7280 __ jmp(&next_capture);
7281 __ bind(&done); 7281 __ bind(&done);
7282 7282
7283 // Return last match info. 7283 // Return last match info.
7284 __ movq(rax, Operand(rsp, kLastMatchInfoOffset)); 7284 __ movq(rax, Operand(rsp, kLastMatchInfoOffset));
7285 __ ret(4 * kPointerSize); 7285 __ ret(4 * kPointerSize);
7286 7286
7287 // Do the runtime call to execute the regexp. 7287 // Do the runtime call to execute the regexp.
7288 __ bind(&runtime); 7288 __ bind(&runtime);
7289 __ TailCallRuntime(Runtime::kRegExpExec, 4, 1); 7289 __ TailCallRuntime(Runtime::kRegExpExec, 4, 1);
7290 #endif // V8_NATIVE_REGEXP 7290 #endif // V8_INTERPRETED_REGEXP
7291 } 7291 }
7292 7292
7293 7293
7294 void NumberToStringStub::GenerateLookupNumberStringCache(MacroAssembler* masm, 7294 void NumberToStringStub::GenerateLookupNumberStringCache(MacroAssembler* masm,
7295 Register object, 7295 Register object,
7296 Register result, 7296 Register result,
7297 Register scratch1, 7297 Register scratch1,
7298 Register scratch2, 7298 Register scratch2,
7299 bool object_is_smi, 7299 bool object_is_smi,
7300 Label* not_found) { 7300 Label* not_found) {
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
7874 // callee-saved register. 7874 // callee-saved register.
7875 7875
7876 // Simple results returned in rax (both AMD64 and Win64 calling conventions). 7876 // Simple results returned in rax (both AMD64 and Win64 calling conventions).
7877 // Complex results must be written to address passed as first argument. 7877 // Complex results must be written to address passed as first argument.
7878 // AMD64 calling convention: a struct of two pointers in rax+rdx 7878 // AMD64 calling convention: a struct of two pointers in rax+rdx
7879 7879
7880 if (do_gc) { 7880 if (do_gc) {
7881 // Pass failure code returned from last attempt as first argument to GC. 7881 // Pass failure code returned from last attempt as first argument to GC.
7882 #ifdef _WIN64 7882 #ifdef _WIN64
7883 __ movq(rcx, rax); 7883 __ movq(rcx, rax);
7884 #else // ! defined(_WIN64) 7884 #else // _WIN64
7885 __ movq(rdi, rax); 7885 __ movq(rdi, rax);
7886 #endif 7886 #endif
7887 __ movq(kScratchRegister, 7887 __ movq(kScratchRegister,
7888 FUNCTION_ADDR(Runtime::PerformGC), 7888 FUNCTION_ADDR(Runtime::PerformGC),
7889 RelocInfo::RUNTIME_ENTRY); 7889 RelocInfo::RUNTIME_ENTRY);
7890 __ call(kScratchRegister); 7890 __ call(kScratchRegister);
7891 } 7891 }
7892 7892
7893 ExternalReference scope_depth = 7893 ExternalReference scope_depth =
7894 ExternalReference::heap_always_allocate_scope_depth(); 7894 ExternalReference::heap_always_allocate_scope_depth();
(...skipping 13 matching lines...) Expand all
7908 // Return result in single register (rax). 7908 // Return result in single register (rax).
7909 __ lea(rcx, Operand(rsp, 4 * kPointerSize)); 7909 __ lea(rcx, Operand(rsp, 4 * kPointerSize));
7910 } else { 7910 } else {
7911 ASSERT_EQ(2, result_size_); 7911 ASSERT_EQ(2, result_size_);
7912 // Pass a pointer to the result location as the first argument. 7912 // Pass a pointer to the result location as the first argument.
7913 __ lea(rcx, Operand(rsp, 6 * kPointerSize)); 7913 __ lea(rcx, Operand(rsp, 6 * kPointerSize));
7914 // Pass a pointer to the Arguments object as the second argument. 7914 // Pass a pointer to the Arguments object as the second argument.
7915 __ lea(rdx, Operand(rsp, 4 * kPointerSize)); 7915 __ lea(rdx, Operand(rsp, 4 * kPointerSize));
7916 } 7916 }
7917 7917
7918 #else // ! defined(_WIN64) 7918 #else // _WIN64
7919 // GCC passes arguments in rdi, rsi, rdx, rcx, r8, r9. 7919 // GCC passes arguments in rdi, rsi, rdx, rcx, r8, r9.
7920 __ movq(rdi, r14); // argc. 7920 __ movq(rdi, r14); // argc.
7921 __ movq(rsi, r15); // argv. 7921 __ movq(rsi, r15); // argv.
7922 #endif 7922 #endif
Søren Thygesen Gjesse 2010/04/19 19:59:12 Comment here as well.
7923 __ call(rbx); 7923 __ call(rbx);
7924 // Result is in rax - do not destroy this register! 7924 // Result is in rax - do not destroy this register!
7925 7925
7926 if (always_allocate_scope) { 7926 if (always_allocate_scope) {
7927 __ movq(kScratchRegister, scope_depth); 7927 __ movq(kScratchRegister, scope_depth);
7928 __ decl(Operand(kScratchRegister, 0)); 7928 __ decl(Operand(kScratchRegister, 0));
7929 } 7929 }
7930 7930
7931 // Check for failure result. 7931 // Check for failure result.
7932 Label failure_returned; 7932 Label failure_returned;
(...skipping 2124 matching lines...) Expand 10 before | Expand all | Expand 10 after
10057 // Call the function from C++. 10057 // Call the function from C++.
10058 return FUNCTION_CAST<ModuloFunction>(buffer); 10058 return FUNCTION_CAST<ModuloFunction>(buffer);
10059 } 10059 }
10060 10060
10061 #endif 10061 #endif
10062 10062
10063 10063
10064 #undef __ 10064 #undef __
10065 10065
10066 } } // namespace v8::internal 10066 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698