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

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

Issue 6350021: Introduce ToNumber stub and use it in non-optimized code for to-number conver... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 11 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
« no previous file with comments | « no previous file | src/arm/full-codegen-arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 Register rhs, 48 Register rhs,
49 Label* lhs_not_nan, 49 Label* lhs_not_nan,
50 Label* slow, 50 Label* slow,
51 bool strict); 51 bool strict);
52 static void EmitTwoNonNanDoubleComparison(MacroAssembler* masm, Condition cond); 52 static void EmitTwoNonNanDoubleComparison(MacroAssembler* masm, Condition cond);
53 static void EmitStrictTwoHeapObjectCompare(MacroAssembler* masm, 53 static void EmitStrictTwoHeapObjectCompare(MacroAssembler* masm,
54 Register lhs, 54 Register lhs,
55 Register rhs); 55 Register rhs);
56 56
57 57
58 void ToNumberStub::Generate(MacroAssembler* masm) {
59 // The ToNumber stub takes one argument in eax.
60 Label check_heap_number, call_builtin;
61 __ tst(r0, Operand(kSmiTagMask));
62 __ b(ne, &check_heap_number);
63 __ Ret();
64
65 __ bind(&check_heap_number);
66 __ ldr(r1, FieldMemOperand(r0, HeapObject::kMapOffset));
67 __ LoadRoot(ip, Heap::kHeapNumberMapRootIndex);
68 __ cmp(r1, ip);
69 __ b(ne, &call_builtin);
70 __ Ret();
71
72 __ bind(&call_builtin);
73 __ pop(r2); // Pop return address.
74 __ push(r0);
75 __ push(r2); // Push return address.
76 __ InvokeBuiltin(Builtins::TO_NUMBER, JUMP_JS);
77 }
78
79
58 void FastNewClosureStub::Generate(MacroAssembler* masm) { 80 void FastNewClosureStub::Generate(MacroAssembler* masm) {
59 // Create a new closure from the given function info in new 81 // Create a new closure from the given function info in new
60 // space. Set the context to the current context in cp. 82 // space. Set the context to the current context in cp.
61 Label gc; 83 Label gc;
62 84
63 // Pop the function info from the stack. 85 // Pop the function info from the stack.
64 __ pop(r3); 86 __ pop(r3);
65 87
66 // Attempt to allocate new JSFunction in new space. 88 // Attempt to allocate new JSFunction in new space.
67 __ AllocateInNewSpace(JSFunction::kSize, 89 __ AllocateInNewSpace(JSFunction::kSize,
(...skipping 5628 matching lines...) Expand 10 before | Expand all | Expand 10 after
5696 __ pop(r1); 5718 __ pop(r1);
5697 __ Jump(r2); 5719 __ Jump(r2);
5698 } 5720 }
5699 5721
5700 5722
5701 #undef __ 5723 #undef __
5702 5724
5703 } } // namespace v8::internal 5725 } } // namespace v8::internal
5704 5726
5705 #endif // V8_TARGET_ARCH_ARM 5727 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm/full-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698