1 // Copyright 2010 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided
11 // with the distribution.
12 // * Neither the name of Google Inc. nor the names of its
13 // contributors may be used to endorse or promote products derived
14 // from this software without specific prior written permission.
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 #ifndef V8_ARM_CODEGEN_ARM_H_
29 #define V8_ARM_CODEGEN_ARM_H_
36 // Forward declarations
37 class CompilationInfo;
39 class RegisterAllocator;
42 enum InitState { CONST_INIT, NOT_CONST_INIT };
43 enum TypeofState { INSIDE_TYPEOF, NOT_INSIDE_TYPEOF };
46 // -------------------------------------------------------------------------
49 // A reference is a C++ stack-allocated object that puts a
50 // reference on the virtual frame. The reference may be consumed
51 // by GetValue, TakeValue, SetValue, and Codegen::UnloadReference.
52 // When the lifetime (scope) of a valid reference ends, it must have
53 // been consumed, and be in state UNLOADED.
54 class Reference BASE_EMBEDDED {
56 // The values of the types is important, see size().
57 enum Type { UNLOADED = -2, ILLEGAL = -1, SLOT = 0, NAMED = 1, KEYED = 2 };
58 Reference(CodeGenerator* cgen,
59 Expression* expression,
60 bool persist_after_get = false);
63 Expression* expression() const { return expression_; }
64 Type type() const { return type_; }
65 void set_type(Type value) {
66 ASSERT_EQ(ILLEGAL, type_);
71 ASSERT_NE(ILLEGAL, type_);
72 ASSERT_NE(UNLOADED, type_);
75 // The size the reference takes up on the stack.
77 return (type_ < SLOT) ? 0 : type_;
80 bool is_illegal() const { return type_ == ILLEGAL; }
81 bool is_slot() const { return type_ == SLOT; }
82 bool is_property() const { return type_ == NAMED || type_ == KEYED; }
83 bool is_unloaded() const { return type_ == UNLOADED; }
85 // Return the name. Only valid for named property references.
86 Handle<String> GetName();
88 // Generate code to push the value of the reference on top of the
89 // expression stack. The reference is expected to be already on top of
90 // the expression stack, and it is consumed by the call unless the
91 // reference is for a compound assignment.
92 // If the reference is not consumed, it is left in place under its value.
95 // Generate code to store the value on top of the expression stack in the
96 // reference. The reference is expected to be immediately below the value
97 // on the expression stack. The value is stored in the location specified
98 // by the reference, and is left on top of the stack, after the reference
99 // is popped from beneath it (unloaded).
100 void SetValue(InitState init_state);
103 CodeGenerator* cgen_;
104 Expression* expression_;
106 // Keep the reference on the stack after get, so it can be used by set later.
107 bool persist_after_get_;
111 // -------------------------------------------------------------------------
112 // Code generation state
114 // The state is passed down the AST by the code generator (and back up, in
115 // the form of the state of the label pair). It is threaded through the
116 // call stack. Constructing a state implicitly pushes it on the owning code
117 // generator's stack of states, and destroying one implicitly pops it.
119 class CodeGenState BASE_EMBEDDED {
121 // Create an initial code generator state. Destroying the initial state
122 // leaves the code generator with a NULL state.
123 explicit CodeGenState(CodeGenerator* owner);
125 // Create a code generator state based on a code generator's current
126 // state. The new state has its own pair of branch labels.
127 CodeGenState(CodeGenerator* owner,
128 JumpTarget* true_target,
129 JumpTarget* false_target);
131 // Destroy a code generator state and restore the owning code generator's
135 JumpTarget* true_target() const { return true_target_; }
136 JumpTarget* false_target() const { return false_target_; }
139 CodeGenerator* owner_;
140 JumpTarget* true_target_;
141 JumpTarget* false_target_;
142 CodeGenState* previous_;
146 // -------------------------------------------------------------------------
149 class CodeGenerator: public AstVisitor {
151 // Takes a function literal, generates code for it. This function should only
152 // be called by compiler.cc.
153 static Handle<Code> MakeCode(CompilationInfo* info);
155 // Printing of AST, etc. as requested by flags.
156 static void MakeCodePrologue(CompilationInfo* info);
158 // Allocate and install the code.
159 static Handle<Code> MakeCodeEpilogue(MacroAssembler* masm,
161 CompilationInfo* info);
163 #ifdef ENABLE_LOGGING_AND_PROFILING
164 static bool ShouldGenerateLog(Expression* type);
167 static void SetFunctionInfo(Handle<JSFunction> fun,
168 FunctionLiteral* lit,
170 Handle<Script> script);
172 static void RecordPositions(MacroAssembler* masm, int pos);
175 MacroAssembler* masm() { return masm_; }
176 VirtualFrame* frame() const { return frame_; }
177 inline Handle<Script> script();
179 bool has_valid_frame() const { return frame_ != NULL; }
181 // Set the virtual frame to be new_frame, with non-frame register
182 // reference counts given by non_frame_registers. The non-frame
183 // register reference counts of the old frame are returned in
184 // non_frame_registers.
185 void SetFrame(VirtualFrame* new_frame, RegisterFile* non_frame_registers);
189 RegisterAllocator* allocator() const { return allocator_; }
191 CodeGenState* state() { return state_; }
192 void set_state(CodeGenState* state) { state_ = state; }
194 void AddDeferred(DeferredCode* code) { deferred_.Add(code); }
196 static const int kUnknownIntValue = -1;
198 // If the name is an inline runtime function call return the number of
199 // expected arguments. Otherwise return -1.
200 static int InlineRuntimeCallArgumentsCount(Handle<String> name);
203 // Construction/Destruction
204 explicit CodeGenerator(MacroAssembler* masm);
207 inline bool is_eval();
208 inline Scope* scope();
210 // Generating deferred code.
211 void ProcessDeferred();
214 bool has_cc() const { return cc_reg_ != al; }
215 JumpTarget* true_target() const { return state_->true_target(); }
216 JumpTarget* false_target() const { return state_->false_target(); }
218 // Track loop nesting level.
219 int loop_nesting() const { return loop_nesting_; }
220 void IncrementLoopNesting() { loop_nesting_++; }
221 void DecrementLoopNesting() { loop_nesting_--; }
224 void VisitStatements(ZoneList<Statement*>* statements);
226 #define DEF_VISIT(type) \
227 void Visit##type(type* node);
228 AST_NODE_LIST(DEF_VISIT)
231 // Visit a statement and then spill the virtual frame if control flow can
232 // reach the end of the statement (ie, it does not exit via break,
233 // continue, return, or throw). This function is used temporarily while
234 // the code generator is being transformed.
235 inline void VisitAndSpill(Statement* statement);
237 // Visit a list of statements and then spill the virtual frame if control
238 // flow can reach the end of the list.
239 inline void VisitStatementsAndSpill(ZoneList<Statement*>* statements);
241 // Main code generation function
242 void Generate(CompilationInfo* info);
244 // The following are used by class Reference.
245 void LoadReference(Reference* ref);
246 void UnloadReference(Reference* ref);
248 static MemOperand ContextOperand(Register context, int index) {
249 return MemOperand(context, Context::SlotOffset(index));
252 MemOperand SlotOperand(Slot* slot, Register tmp);
254 MemOperand ContextSlotOperandCheckExtensions(Slot* slot,
260 static MemOperand GlobalObject() {
261 return ContextOperand(cp, Context::GLOBAL_INDEX);
264 void LoadCondition(Expression* x,
265 JumpTarget* true_target,
266 JumpTarget* false_target,
268 void Load(Expression* expr);
270 void LoadGlobalReceiver(Register scratch);
272 // Generate code to push the value of an expression on top of the frame
273 // and then spill the frame fully to memory. This function is used
274 // temporarily while the code generator is being transformed.
275 inline void LoadAndSpill(Expression* expression);
277 // Call LoadCondition and then spill the virtual frame unless control flow
278 // cannot reach the end of the expression (ie, by emitting only
279 // unconditional jumps to the control targets).
280 inline void LoadConditionAndSpill(Expression* expression,
281 JumpTarget* true_target,
282 JumpTarget* false_target,
285 // Read a value from a slot and leave it on top of the expression stack.
286 void LoadFromSlot(Slot* slot, TypeofState typeof_state);
287 // Store the value on top of the stack to a slot.
288 void StoreToSlot(Slot* slot, InitState init_state);
290 // Load a keyed property, leaving it in r0. The receiver and key are
291 // passed on the stack, and remain there.
292 void EmitKeyedLoad(bool is_global);
294 void LoadFromGlobalSlotCheckExtensions(Slot* slot,
295 TypeofState typeof_state,
300 // Special code for typeof expressions: Unfortunately, we must
301 // be careful when loading the expression in 'typeof'
302 // expressions. We are not allowed to throw reference errors for
303 // non-existing properties of the global object, so we must make it
304 // look like an explicit property access, instead of an access
305 // through the context chain.
306 void LoadTypeofExpression(Expression* x);
308 void ToBoolean(JumpTarget* true_target, JumpTarget* false_target);
310 // Generate code that computes a shortcutting logical operation.
311 void GenerateLogicalBooleanOperation(BinaryOperation* node);
313 void GenericBinaryOperation(Token::Value op,
314 OverwriteMode overwrite_mode,
315 int known_rhs = kUnknownIntValue);
316 void VirtualFrameBinaryOperation(Token::Value op,
317 OverwriteMode overwrite_mode,
318 int known_rhs = kUnknownIntValue);
319 void Comparison(Condition cc,
322 bool strict = false);
324 void SmiOperation(Token::Value op,
325 Handle<Object> value,
329 void VirtualFrameSmiOperation(Token::Value op,
330 Handle<Object> value,
334 void CallWithArguments(ZoneList<Expression*>* arguments,
335 CallFunctionFlags flags,
339 void Branch(bool if_true, JumpTarget* target);
342 struct InlineRuntimeLUT {
343 void (CodeGenerator::*method)(ZoneList<Expression*>*);
348 static InlineRuntimeLUT* FindInlineRuntimeLUT(Handle<String> name);
349 bool CheckForInlineRuntimeCall(CallRuntime* node);
350 static bool PatchInlineRuntimeEntry(Handle<String> name,
351 const InlineRuntimeLUT& new_entry,
352 InlineRuntimeLUT* old_entry);
354 static Handle<Code> ComputeLazyCompile(int argc);
355 void ProcessDeclarations(ZoneList<Declaration*>* declarations);
357 static Handle<Code> ComputeCallInitialize(int argc, InLoopFlag in_loop);
359 // Declare global variables and functions in the given array of
361 void DeclareGlobals(Handle<FixedArray> pairs);
363 // Instantiate the function based on the shared function info.
364 void InstantiateFunction(Handle<SharedFunctionInfo> function_info);
366 // Support for type checks.
367 void GenerateIsSmi(ZoneList<Expression*>* args);
368 void GenerateIsNonNegativeSmi(ZoneList<Expression*>* args);
369 void GenerateIsArray(ZoneList<Expression*>* args);
370 void GenerateIsRegExp(ZoneList<Expression*>* args);
371 void GenerateIsObject(ZoneList<Expression*>* args);
372 void GenerateIsFunction(ZoneList<Expression*>* args);
373 void GenerateIsUndetectableObject(ZoneList<Expression*>* args);
375 // Support for construct call checks.
376 void GenerateIsConstructCall(ZoneList<Expression*>* args);
378 // Support for arguments.length and arguments[?].
379 void GenerateArgumentsLength(ZoneList<Expression*>* args);
380 void GenerateArguments(ZoneList<Expression*>* args);
382 // Support for accessing the class and value fields of an object.
383 void GenerateClassOf(ZoneList<Expression*>* args);
384 void GenerateValueOf(ZoneList<Expression*>* args);
385 void GenerateSetValueOf(ZoneList<Expression*>* args);
387 // Fast support for charCodeAt(n).
388 void GenerateFastCharCodeAt(ZoneList<Expression*>* args);
390 // Fast support for string.charAt(n) and string[n].
391 void GenerateCharFromCode(ZoneList<Expression*>* args);
393 // Fast support for object equality testing.
394 void GenerateObjectEquals(ZoneList<Expression*>* args);
396 void GenerateLog(ZoneList<Expression*>* args);
398 // Fast support for Math.random().
399 void GenerateRandomHeapNumber(ZoneList<Expression*>* args);
401 // Fast support for StringAdd.
402 void GenerateStringAdd(ZoneList<Expression*>* args);
404 // Fast support for SubString.
405 void GenerateSubString(ZoneList<Expression*>* args);
407 // Fast support for StringCompare.
408 void GenerateStringCompare(ZoneList<Expression*>* args);
410 // Support for direct calls from JavaScript to native RegExp code.
411 void GenerateRegExpExec(ZoneList<Expression*>* args);
413 void GenerateRegExpConstructResult(ZoneList<Expression*>* args);
415 // Support for fast native caches.
416 void GenerateGetFromCache(ZoneList<Expression*>* args);
418 // Fast support for number to string.
419 void GenerateNumberToString(ZoneList<Expression*>* args);
421 // Fast call for custom callbacks.
422 void GenerateCallFunction(ZoneList<Expression*>* args);
424 // Fast call to math functions.
425 void GenerateMathPow(ZoneList<Expression*>* args);
426 void GenerateMathSin(ZoneList<Expression*>* args);
427 void GenerateMathCos(ZoneList<Expression*>* args);
428 void GenerateMathSqrt(ZoneList<Expression*>* args);
430 // Simple condition analysis.
431 enum ConditionAnalysis {
436 ConditionAnalysis AnalyzeCondition(Expression* cond);
438 // Methods used to indicate which source code is generated for. Source
439 // positions are collected by the assembler and emitted with the relocation
441 void CodeForFunctionPosition(FunctionLiteral* fun);
442 void CodeForReturnPosition(FunctionLiteral* fun);
443 void CodeForStatementPosition(Statement* node);
444 void CodeForDoWhileConditionPosition(DoWhileStatement* stmt);
445 void CodeForSourcePosition(int pos);
448 // True if the registers are valid for entry to a block.
449 bool HasValidEntryRegisters();
452 List<DeferredCode*> deferred_;
455 MacroAssembler* masm_; // to generate code
457 CompilationInfo* info_;
459 // Code generation state
460 VirtualFrame* frame_;
461 RegisterAllocator* allocator_;
463 CodeGenState* state_;
467 BreakTarget function_return_;
469 // True if the function return is shadowed (ie, jumping to the target
470 // function_return_ does not jump to the true function return, but rather
471 // to some unlinking code).
472 bool function_return_is_shadowed_;
474 static InlineRuntimeLUT kInlineRuntimeLUT[];
476 friend class VirtualFrame;
477 friend class JumpTarget;
478 friend class Reference;
479 friend class FastCodeGenerator;
480 friend class FullCodeGenerator;
481 friend class FullCodeGenSyntaxChecker;
483 DISALLOW_COPY_AND_ASSIGN(CodeGenerator);
487 class GenericBinaryOpStub : public CodeStub {
489 GenericBinaryOpStub(Token::Value op,
493 int constant_rhs = CodeGenerator::kUnknownIntValue)
498 constant_rhs_(constant_rhs),
499 specialized_on_rhs_(RhsIsOneWeWantToOptimizeFor(op, constant_rhs)),
500 runtime_operands_type_(BinaryOpIC::DEFAULT),
503 GenericBinaryOpStub(int key, BinaryOpIC::TypeInfo type_info)
504 : op_(OpBits::decode(key)),
505 mode_(ModeBits::decode(key)),
506 lhs_(LhsRegister(RegisterBits::decode(key))),
507 rhs_(RhsRegister(RegisterBits::decode(key))),
508 constant_rhs_(KnownBitsForMinorKey(KnownIntBits::decode(key))),
509 specialized_on_rhs_(RhsIsOneWeWantToOptimizeFor(op_, constant_rhs_)),
510 runtime_operands_type_(type_info),
519 bool specialized_on_rhs_;
520 BinaryOpIC::TypeInfo runtime_operands_type_;
523 static const int kMaxKnownRhs = 0x40000000;
524 static const int kKnownRhsKeyBits = 6;
526 // Minor key encoding in 17 bits.
527 class ModeBits: public BitField<OverwriteMode, 0, 2> {};
528 class OpBits: public BitField<Token::Value, 2, 6> {};
529 class TypeInfoBits: public BitField<int, 8, 2> {};
530 class RegisterBits: public BitField<bool, 10, 1> {};
531 class KnownIntBits: public BitField<int, 11, kKnownRhsKeyBits> {};
533 Major MajorKey() { return GenericBinaryOp; }
535 ASSERT((lhs_.is(r0) && rhs_.is(r1)) ||
536 (lhs_.is(r1) && rhs_.is(r0)));
537 // Encode the parameters in a unique 18 bit value.
538 return OpBits::encode(op_)
539 | ModeBits::encode(mode_)
540 | KnownIntBits::encode(MinorKeyForKnownInt())
541 | TypeInfoBits::encode(runtime_operands_type_)
542 | RegisterBits::encode(lhs_.is(r0));
545 void Generate(MacroAssembler* masm);
546 void HandleNonSmiBitwiseOp(MacroAssembler* masm, Register lhs, Register rhs);
547 void HandleBinaryOpSlowCases(MacroAssembler* masm,
551 const Builtins::JavaScript& builtin);
552 void GenerateTypeTransition(MacroAssembler* masm);
554 static bool RhsIsOneWeWantToOptimizeFor(Token::Value op, int constant_rhs) {
555 if (constant_rhs == CodeGenerator::kUnknownIntValue) return false;
556 if (op == Token::DIV) return constant_rhs >= 2 && constant_rhs <= 3;
557 if (op == Token::MOD) {
558 if (constant_rhs <= 1) return false;
559 if (constant_rhs <= 10) return true;
560 if (constant_rhs <= kMaxKnownRhs && IsPowerOf2(constant_rhs)) return true;
566 int MinorKeyForKnownInt() {
567 if (!specialized_on_rhs_) return 0;
568 if (constant_rhs_ <= 10) return constant_rhs_ + 1;
569 ASSERT(IsPowerOf2(constant_rhs_));
571 int d = constant_rhs_;
572 while ((d & 1) == 0) {
576 ASSERT(key >= 0 && key < (1 << kKnownRhsKeyBits));
580 int KnownBitsForMinorKey(int key) {
582 if (key <= 11) return key - 1;
591 Register LhsRegister(bool lhs_is_r0) {
592 return lhs_is_r0 ? r0 : r1;
595 Register RhsRegister(bool lhs_is_r0) {
596 return lhs_is_r0 ? r1 : r0;
599 bool ShouldGenerateSmiCode() {
600 return ((op_ != Token::DIV && op_ != Token::MOD) || specialized_on_rhs_) &&
601 runtime_operands_type_ != BinaryOpIC::HEAP_NUMBERS &&
602 runtime_operands_type_ != BinaryOpIC::STRINGS;
605 bool ShouldGenerateFPCode() {
606 return runtime_operands_type_ != BinaryOpIC::STRINGS;
609 virtual int GetCodeKind() { return Code::BINARY_OP_IC; }
611 virtual InlineCacheState GetICState() {
612 return BinaryOpIC::ToState(runtime_operands_type_);
615 const char* GetName();
619 if (!specialized_on_rhs_) {
620 PrintF("GenericBinaryOpStub (%s)\n", Token::String(op_));
622 PrintF("GenericBinaryOpStub (%s by %d)\n",
631 class StringStubBase: public CodeStub {
633 // Generate code for copying characters using a simple loop. This should only
634 // be used in places where the number of characters is small and the
635 // additional setup and checking in GenerateCopyCharactersLong adds too much
636 // overhead. Copying of overlapping regions is not supported.
637 // Dest register ends at the position after the last character written.
638 void GenerateCopyCharacters(MacroAssembler* masm,
645 // Generate code for copying a large number of characters. This function
646 // is allowed to spend extra time setting up conditions to make copying
647 // faster. Copying of overlapping regions is not supported.
648 // Dest register ends at the position after the last character written.
649 void GenerateCopyCharactersLong(MacroAssembler* masm,
661 // Probe the symbol table for a two character string. If the string is
662 // not found by probing a jump to the label not_found is performed. This jump
663 // does not guarantee that the string is not in the symbol table. If the
664 // string is found the code falls through with the string in register r0.
665 // Contents of both c1 and c2 registers are modified. At the exit c1 is
666 // guaranteed to contain halfword with low and high bytes equal to
667 // initial contents of c1 and c2 respectively.
668 void GenerateTwoCharacterSymbolTableProbe(MacroAssembler* masm,
678 // Generate string hash.
679 void GenerateHashInit(MacroAssembler* masm,
683 void GenerateHashAddCharacter(MacroAssembler* masm,
687 void GenerateHashGetHash(MacroAssembler* masm,
692 // Flag that indicates how to generate code for the stub StringAddStub.
693 enum StringAddFlags {
694 NO_STRING_ADD_FLAGS = 0,
695 NO_STRING_CHECK_IN_STUB = 1 << 0 // Omit string check in stub.
699 class StringAddStub: public StringStubBase {
701 explicit StringAddStub(StringAddFlags flags) {
702 string_check_ = ((flags & NO_STRING_CHECK_IN_STUB) == 0);
706 Major MajorKey() { return StringAdd; }
707 int MinorKey() { return string_check_ ? 0 : 1; }
709 void Generate(MacroAssembler* masm);
711 // Should the stub check whether arguments are strings?
716 class SubStringStub: public StringStubBase {
721 Major MajorKey() { return SubString; }
722 int MinorKey() { return 0; }
724 void Generate(MacroAssembler* masm);
729 class StringCompareStub: public CodeStub {
731 StringCompareStub() { }
733 // Compare two flat ASCII strings and returns result in r0.
734 // Does not use the stack.
735 static void GenerateCompareFlatAsciiStrings(MacroAssembler* masm,
744 Major MajorKey() { return StringCompare; }
745 int MinorKey() { return 0; }
747 void Generate(MacroAssembler* masm);
751 // This stub can convert a signed int32 to a heap number (double). It does
752 // not work for int32s that are in Smi range! No GC occurs during this stub
753 // so you don't have to set up the frame.
754 class WriteInt32ToHeapNumberStub : public CodeStub {
756 WriteInt32ToHeapNumberStub(Register the_int,
757 Register the_heap_number,
760 the_heap_number_(the_heap_number),
761 scratch_(scratch) { }
765 Register the_heap_number_;
768 // Minor key encoding in 16 bits.
769 class IntRegisterBits: public BitField<int, 0, 4> {};
770 class HeapNumberRegisterBits: public BitField<int, 4, 4> {};
771 class ScratchRegisterBits: public BitField<int, 8, 4> {};
773 Major MajorKey() { return WriteInt32ToHeapNumber; }
775 // Encode the parameters in a unique 16 bit value.
776 return IntRegisterBits::encode(the_int_.code())
777 | HeapNumberRegisterBits::encode(the_heap_number_.code())
778 | ScratchRegisterBits::encode(scratch_.code());
781 void Generate(MacroAssembler* masm);
783 const char* GetName() { return "WriteInt32ToHeapNumberStub"; }
786 void Print() { PrintF("WriteInt32ToHeapNumberStub\n"); }
791 class NumberToStringStub: public CodeStub {
793 NumberToStringStub() { }
795 // Generate code to do a lookup in the number string cache. If the number in
796 // the register object is found in the cache the generated code falls through
797 // with the result in the result register. The object and the result register
798 // can be the same. If the number is not found in the cache the code jumps to
799 // the label not_found with only the content of register object unchanged.
800 static void GenerateLookupNumberStringCache(MacroAssembler* masm,
809 Major MajorKey() { return NumberToString; }
810 int MinorKey() { return 0; }
812 void Generate(MacroAssembler* masm);
814 const char* GetName() { return "NumberToStringStub"; }
818 PrintF("NumberToStringStub\n");
824 } } // namespace v8::internal
826 #endif // V8_ARM_CODEGEN_ARM_H_