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

Side by Side Diff: src/x64/code-stubs-x64.cc

Issue 683913008: Turn ToNumberStub into a PlatformCodeStub again. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Use branches on ARM as well (better prediction). Created 6 years, 1 month 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
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_X64 7 #if V8_TARGET_ARCH_X64
8 8
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 3104 matching lines...) Expand 10 before | Expand all | Expand 10 after
3115 // rdx: from index (smi) 3115 // rdx: from index (smi)
3116 StringCharAtGenerator generator(rax, rdx, rcx, rax, &runtime, &runtime, 3116 StringCharAtGenerator generator(rax, rdx, rcx, rax, &runtime, &runtime,
3117 &runtime, STRING_INDEX_IS_NUMBER, 3117 &runtime, STRING_INDEX_IS_NUMBER,
3118 RECEIVER_IS_STRING); 3118 RECEIVER_IS_STRING);
3119 generator.GenerateFast(masm); 3119 generator.GenerateFast(masm);
3120 __ ret(SUB_STRING_ARGUMENT_COUNT * kPointerSize); 3120 __ ret(SUB_STRING_ARGUMENT_COUNT * kPointerSize);
3121 generator.SkipSlow(masm, &runtime); 3121 generator.SkipSlow(masm, &runtime);
3122 } 3122 }
3123 3123
3124 3124
3125 void ToNumberStub::Generate(MacroAssembler* masm) {
3126 // The ToNumber stub takes one argument in rax.
3127 Label check_heap_number, call_builtin;
3128 __ JumpIfNotSmi(rax, &check_heap_number, Label::kNear);
3129 __ Ret();
3130
3131 __ bind(&check_heap_number);
3132 __ CompareRoot(FieldOperand(rax, HeapObject::kMapOffset),
3133 Heap::kHeapNumberMapRootIndex);
3134 __ j(not_equal, &call_builtin, Label::kNear);
3135 __ Ret();
3136
3137 __ bind(&call_builtin);
3138 __ popq(rcx); // Pop return address.
3139 __ pushq(rax);
3140 __ pushq(rcx); // Push return address.
3141 __ InvokeBuiltin(Builtins::TO_NUMBER, JUMP_FUNCTION);
3142 }
3143
3144
3125 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm, 3145 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm,
3126 Register left, 3146 Register left,
3127 Register right, 3147 Register right,
3128 Register scratch1, 3148 Register scratch1,
3129 Register scratch2) { 3149 Register scratch2) {
3130 Register length = scratch1; 3150 Register length = scratch1;
3131 3151
3132 // Compare lengths. 3152 // Compare lengths.
3133 Label check_zero_length; 3153 Label check_zero_length;
3134 __ movp(length, FieldOperand(left, String::kLengthOffset)); 3154 __ movp(length, FieldOperand(left, String::kLengthOffset));
(...skipping 1572 matching lines...) Expand 10 before | Expand all | Expand 10 after
4707 return_value_operand, 4727 return_value_operand,
4708 NULL); 4728 NULL);
4709 } 4729 }
4710 4730
4711 4731
4712 #undef __ 4732 #undef __
4713 4733
4714 } } // namespace v8::internal 4734 } } // namespace v8::internal
4715 4735
4716 #endif // V8_TARGET_ARCH_X64 4736 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698