From 5e90dba9108466ef869c14702b0c53a39ebf6b12 Mon Sep 17 00:00:00 2001 From: "whesse@chromium.org" Date: Mon, 28 Sep 2009 13:53:43 +0000 Subject: [PATCH] Rename JumpToBuiltin to JumpToRuntime. Add comment to ResolveBuiltin. Review URL: http://codereview.chromium.org/218025 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2979 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/arm/builtins-arm.cc | 4 ++-- src/arm/macro-assembler-arm.cc | 4 ++-- src/arm/macro-assembler-arm.h | 18 +++++++++++++----- src/ia32/builtins-ia32.cc | 4 ++-- src/ia32/macro-assembler-ia32.cc | 4 ++-- src/ia32/macro-assembler-ia32.h | 18 +++++++++++++----- src/x64/builtins-x64.cc | 4 ++-- src/x64/macro-assembler-x64.cc | 4 ++-- src/x64/macro-assembler-x64.h | 18 +++++++++++++----- 9 files changed, 51 insertions(+), 27 deletions(-) diff --git a/src/arm/builtins-arm.cc b/src/arm/builtins-arm.cc index 4d1fe7319..18d022d7b 100644 --- a/src/arm/builtins-arm.cc +++ b/src/arm/builtins-arm.cc @@ -44,10 +44,10 @@ void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id) { __ str(r1, MemOperand(ip, 0)); // The actual argument count has already been loaded into register - // r0, but JumpToBuiltin expects r0 to contain the number of + // r0, but JumpToRuntime expects r0 to contain the number of // arguments including the receiver. __ add(r0, r0, Operand(1)); - __ JumpToBuiltin(ExternalReference(id)); + __ JumpToRuntime(ExternalReference(id)); } diff --git a/src/arm/macro-assembler-arm.cc b/src/arm/macro-assembler-arm.cc index 6dd9b8faa..f663e40bd 100644 --- a/src/arm/macro-assembler-arm.cc +++ b/src/arm/macro-assembler-arm.cc @@ -1001,11 +1001,11 @@ void MacroAssembler::TailCallRuntime(const ExternalReference& ext, // should remove this need and make the runtime routine entry code // smarter. mov(r0, Operand(num_arguments)); - JumpToBuiltin(ext); + JumpToRuntime(ext); } -void MacroAssembler::JumpToBuiltin(const ExternalReference& builtin) { +void MacroAssembler::JumpToRuntime(const ExternalReference& builtin) { #if defined(__thumb__) // Thumb mode builtin. ASSERT((reinterpret_cast(builtin.address()) & 1) == 1); diff --git a/src/arm/macro-assembler-arm.h b/src/arm/macro-assembler-arm.h index 03aa4d0c2..32ba8e563 100644 --- a/src/arm/macro-assembler-arm.h +++ b/src/arm/macro-assembler-arm.h @@ -257,14 +257,14 @@ class MacroAssembler: public Assembler { void CallRuntime(Runtime::FunctionId fid, int num_arguments); // Tail call of a runtime routine (jump). - // Like JumpToBuiltin, but also takes care of passing the number + // Like JumpToRuntime, but also takes care of passing the number // of parameters. void TailCallRuntime(const ExternalReference& ext, int num_arguments, int result_size); - // Jump to the builtin routine. - void JumpToBuiltin(const ExternalReference& builtin); + // Jump to a runtime routine. + void JumpToRuntime(const ExternalReference& builtin); // Invoke specified builtin JavaScript function. Adds an entry to // the unresolved list if the name does not resolve. @@ -329,8 +329,16 @@ class MacroAssembler: public Assembler { Label* done, InvokeFlag flag); - // Get the code for the given builtin. Returns if able to resolve - // the function in the 'resolved' flag. + // Prepares for a call or jump to a builtin by doing two things: + // 1. Emits code that fetches the builtin's function object from the context + // at runtime, and puts it in the register rdi. + // 2. Fetches the builtin's code object, and returns it in a handle, at + // compile time, so that later code can emit instructions to jump or call + // the builtin directly. If the code object has not yet been created, it + // returns the builtin code object for IllegalFunction, and sets the + // output parameter "resolved" to false. Code that uses the return value + // should then add the address and the builtin name to the list of fixups + // called unresolved_, which is fixed up by the bootstrapper. Handle ResolveBuiltin(Builtins::JavaScript id, bool* resolved); // Activation support. diff --git a/src/ia32/builtins-ia32.cc b/src/ia32/builtins-ia32.cc index 19f22665e..2070a1e97 100644 --- a/src/ia32/builtins-ia32.cc +++ b/src/ia32/builtins-ia32.cc @@ -42,10 +42,10 @@ void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id) { __ mov(Operand::StaticVariable(passed), edi); // The actual argument count has already been loaded into register - // eax, but JumpToBuiltin expects eax to contain the number of + // eax, but JumpToRuntime expects eax to contain the number of // arguments including the receiver. __ inc(eax); - __ JumpToBuiltin(ExternalReference(id)); + __ JumpToRuntime(ExternalReference(id)); } diff --git a/src/ia32/macro-assembler-ia32.cc b/src/ia32/macro-assembler-ia32.cc index a8d7e445c..22e22182d 100644 --- a/src/ia32/macro-assembler-ia32.cc +++ b/src/ia32/macro-assembler-ia32.cc @@ -903,11 +903,11 @@ void MacroAssembler::TailCallRuntime(const ExternalReference& ext, // should remove this need and make the runtime routine entry code // smarter. Set(eax, Immediate(num_arguments)); - JumpToBuiltin(ext); + JumpToRuntime(ext); } -void MacroAssembler::JumpToBuiltin(const ExternalReference& ext) { +void MacroAssembler::JumpToRuntime(const ExternalReference& ext) { // Set the entry point and jump to the C entry runtime stub. mov(ebx, Immediate(ext)); CEntryStub ces(1); diff --git a/src/ia32/macro-assembler-ia32.h b/src/ia32/macro-assembler-ia32.h index 60ede8a4e..1a6d9f203 100644 --- a/src/ia32/macro-assembler-ia32.h +++ b/src/ia32/macro-assembler-ia32.h @@ -254,14 +254,14 @@ class MacroAssembler: public Assembler { void CallRuntime(Runtime::FunctionId id, int num_arguments); // Tail call of a runtime routine (jump). - // Like JumpToBuiltin, but also takes care of passing the number + // Like JumpToRuntime, but also takes care of passing the number // of arguments. void TailCallRuntime(const ExternalReference& ext, int num_arguments, int result_size); - // Jump to the builtin routine. - void JumpToBuiltin(const ExternalReference& ext); + // Jump to a runtime routine. + void JumpToRuntime(const ExternalReference& ext); // --------------------------------------------------------------------------- @@ -321,8 +321,16 @@ class MacroAssembler: public Assembler { Label* done, InvokeFlag flag); - // Get the code for the given builtin. Returns if able to resolve - // the function in the 'resolved' flag. + // Prepares for a call or jump to a builtin by doing two things: + // 1. Emits code that fetches the builtin's function object from the context + // at runtime, and puts it in the register rdi. + // 2. Fetches the builtin's code object, and returns it in a handle, at + // compile time, so that later code can emit instructions to jump or call + // the builtin directly. If the code object has not yet been created, it + // returns the builtin code object for IllegalFunction, and sets the + // output parameter "resolved" to false. Code that uses the return value + // should then add the address and the builtin name to the list of fixups + // called unresolved_, which is fixed up by the bootstrapper. Handle ResolveBuiltin(Builtins::JavaScript id, bool* resolved); // Activation support. diff --git a/src/x64/builtins-x64.cc b/src/x64/builtins-x64.cc index cda676204..959f94ac7 100644 --- a/src/x64/builtins-x64.cc +++ b/src/x64/builtins-x64.cc @@ -41,10 +41,10 @@ void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id) { __ movq(Operand(kScratchRegister, 0), rdi); // The actual argument count has already been loaded into register - // rax, but JumpToBuiltin expects rax to contain the number of + // rax, but JumpToRuntime expects rax to contain the number of // arguments including the receiver. __ incq(rax); - __ JumpToBuiltin(ExternalReference(id), 1); + __ JumpToRuntime(ExternalReference(id), 1); } diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc index cc7970b24..19e9a432a 100644 --- a/src/x64/macro-assembler-x64.cc +++ b/src/x64/macro-assembler-x64.cc @@ -332,11 +332,11 @@ void MacroAssembler::TailCallRuntime(ExternalReference const& ext, // should remove this need and make the runtime routine entry code // smarter. movq(rax, Immediate(num_arguments)); - JumpToBuiltin(ext, result_size); + JumpToRuntime(ext, result_size); } -void MacroAssembler::JumpToBuiltin(const ExternalReference& ext, +void MacroAssembler::JumpToRuntime(const ExternalReference& ext, int result_size) { // Set the entry point and jump to the C entry runtime stub. movq(rbx, ext); diff --git a/src/x64/macro-assembler-x64.h b/src/x64/macro-assembler-x64.h index edc5c59df..f199825e0 100644 --- a/src/x64/macro-assembler-x64.h +++ b/src/x64/macro-assembler-x64.h @@ -536,14 +536,14 @@ class MacroAssembler: public Assembler { void CallRuntime(Runtime::FunctionId id, int num_arguments); // Tail call of a runtime routine (jump). - // Like JumpToBuiltin, but also takes care of passing the number + // Like JumpToRuntime, but also takes care of passing the number // of arguments. void TailCallRuntime(const ExternalReference& ext, int num_arguments, int result_size); - // Jump to the builtin routine. - void JumpToBuiltin(const ExternalReference& ext, int result_size); + // Jump to a runtime routine. + void JumpToRuntime(const ExternalReference& ext, int result_size); // --------------------------------------------------------------------------- @@ -603,8 +603,16 @@ class MacroAssembler: public Assembler { Label* done, InvokeFlag flag); - // Get the code for the given builtin. Returns if able to resolve - // the function in the 'resolved' flag. + // Prepares for a call or jump to a builtin by doing two things: + // 1. Emits code that fetches the builtin's function object from the context + // at runtime, and puts it in the register rdi. + // 2. Fetches the builtin's code object, and returns it in a handle, at + // compile time, so that later code can emit instructions to jump or call + // the builtin directly. If the code object has not yet been created, it + // returns the builtin code object for IllegalFunction, and sets the + // output parameter "resolved" to false. Code that uses the return value + // should then add the address and the builtin name to the list of fixups + // called unresolved_, which is fixed up by the bootstrapper. Handle ResolveBuiltin(Builtins::JavaScript id, bool* resolved); // Activation support. -- 2.34.1