Commit 8f890063 authored by whesse@chromium.org's avatar whesse@chromium.org

Align builtins-{arch}.cc on ia32 and x64 platforms by moving functions and editing.

Review URL: http://codereview.chromium.org/5781004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5984 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent f1b702b8
......@@ -29,7 +29,6 @@
#if defined(V8_TARGET_ARCH_IA32)
#include "code-stubs.h"
#include "codegen-inl.h"
#include "deoptimizer.h"
#include "full-codegen.h"
......
This diff is collapsed.
......@@ -2250,6 +2250,31 @@ void MacroAssembler::LoadContext(Register dst, int context_chain_length) {
}
void MacroAssembler::LoadGlobalFunction(int index, Register function) {
// Load the global or builtins object from the current context.
movq(function, Operand(rsi, Context::SlotOffset(Context::GLOBAL_INDEX)));
// Load the global context from the global or builtins object.
movq(function, FieldOperand(function, GlobalObject::kGlobalContextOffset));
// Load the function from the global context.
movq(function, Operand(function, Context::SlotOffset(index)));
}
void MacroAssembler::LoadGlobalFunctionInitialMap(Register function,
Register map) {
// Load the initial map. The global functions all have initial maps.
movq(map, FieldOperand(function, JSFunction::kPrototypeOrInitialMapOffset));
if (FLAG_debug_code) {
Label ok, fail;
CheckMap(map, Factory::meta_map(), &fail, false);
jmp(&ok);
bind(&fail);
Abort("Global functions must have initial map");
bind(&ok);
}
}
int MacroAssembler::ArgumentStackSlotsForCFunctionCall(int num_arguments) {
// On Windows 64 stack slots are reserved by the caller for all arguments
// including the ones passed in registers, and space is always allocated for
......
......@@ -772,6 +772,13 @@ class MacroAssembler: public Assembler {
// Find the function context up the context chain.
void LoadContext(Register dst, int context_chain_length);
// Load the global function with the given index.
void LoadGlobalFunction(int index, Register function);
// Load the initial map from the global function. The registers
// function and map can be the same.
void LoadGlobalFunctionInitialMap(Register function, Register map);
// ---------------------------------------------------------------------------
// Runtime calls
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment