Commit f3d1453f authored by whesse@chromium.org's avatar whesse@chromium.org

As part of allowing different contexts for inlined functions, eliminate most...

As part of allowing different contexts for inlined functions, eliminate most explicit reads of the context from the stack frame in ia32 crankshaft codegen.

Eliminates the enum flag RESTORE_CONTEXT and CONTEXT_ADJUSTED, and adds a context HValue and LOperand to many hydrogen and lithium instructions.

Context is still used from the stack from in CallKnownFunction (this seems safe), and in CallRuntimeFromDeferred in lithium-codegen-ia32.cc, which needs to be fixed.

BUG=
TEST=

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8529 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 8f602083
......@@ -836,11 +836,11 @@ LInstruction* LChunkBuilder::DoShift(Token::Value op,
}
ASSERT(instr->representation().IsInteger32());
ASSERT(instr->OperandAt(0)->representation().IsInteger32());
ASSERT(instr->OperandAt(1)->representation().IsInteger32());
LOperand* left = UseRegisterAtStart(instr->OperandAt(0));
ASSERT(instr->left()->representation().IsInteger32());
ASSERT(instr->right()->representation().IsInteger32());
LOperand* left = UseRegisterAtStart(instr->left());
HValue* right_value = instr->OperandAt(1);
HValue* right_value = instr->right();
LOperand* right = NULL;
int constant_value = 0;
if (right_value->IsConstant()) {
......@@ -1064,7 +1064,7 @@ LInstruction* LChunkBuilder::DoInstanceOf(HInstanceOf* instr) {
LInstruction* LChunkBuilder::DoInstanceOfKnownGlobal(
HInstanceOfKnownGlobal* instr) {
LInstanceOfKnownGlobal* result =
new LInstanceOfKnownGlobal(UseFixed(instr->value(), r0), FixedTemp(r4));
new LInstanceOfKnownGlobal(UseFixed(instr->left(), r0), FixedTemp(r4));
return MarkAsCall(DefineFixed(result, r0), instr);
}
......
......@@ -1268,13 +1268,15 @@ void HLoadNamedField::PrintDataTo(StringStream* stream) {
}
HLoadNamedFieldPolymorphic::HLoadNamedFieldPolymorphic(HValue* object,
HLoadNamedFieldPolymorphic::HLoadNamedFieldPolymorphic(HValue* context,
HValue* object,
ZoneMapList* types,
Handle<String> name)
: HUnaryOperation(object),
types_(Min(types->length(), kMaxLoadPolymorphism)),
: types_(Min(types->length(), kMaxLoadPolymorphism)),
name_(name),
need_generic_(false) {
SetOperandAt(0, context);
SetOperandAt(1, object);
set_representation(Representation::Tagged());
SetFlag(kDependsOnMaps);
for (int i = 0;
......
This diff is collapsed.
This diff is collapsed.
......@@ -904,7 +904,8 @@ class HGraphBuilder: public AstVisitor {
void HandleLiteralCompareUndefined(CompareOperation* compare_expr,
Expression* expr);
HStringCharCodeAt* BuildStringCharCodeAt(HValue* string,
HStringCharCodeAt* BuildStringCharCodeAt(HValue* context,
HValue* string,
HValue* index);
HInstruction* BuildBinaryOperation(BinaryOperation* expr,
HValue* left,
......
This diff is collapsed.
......@@ -166,11 +166,6 @@ class LCodeGen BASE_EMBEDDED {
bool GenerateRelocPadding();
bool GenerateSafepointTable();
enum ContextMode {
RESTORE_CONTEXT,
CONTEXT_ADJUSTED
};
enum SafepointMode {
RECORD_SIMPLE_SAFEPOINT,
RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS
......@@ -178,31 +173,28 @@ class LCodeGen BASE_EMBEDDED {
void CallCode(Handle<Code> code,
RelocInfo::Mode mode,
LInstruction* instr,
ContextMode context_mode);
LInstruction* instr);
void CallCodeGeneric(Handle<Code> code,
RelocInfo::Mode mode,
LInstruction* instr,
ContextMode context_mode,
SafepointMode safepoint_mode);
void CallRuntime(const Runtime::Function* fun,
int argc,
LInstruction* instr,
ContextMode context_mode);
LInstruction* instr);
void CallRuntime(Runtime::FunctionId id,
int argc,
LInstruction* instr,
ContextMode context_mode) {
LInstruction* instr) {
const Runtime::Function* function = Runtime::FunctionForId(id);
CallRuntime(function, argc, instr, context_mode);
CallRuntime(function, argc, instr);
}
void CallRuntimeFromDeferred(Runtime::FunctionId id,
int argc,
LInstruction* instr);
LInstruction* instr,
LOperand* context);
// Generate a direct call to a known function. Expects the function
// to be in edi.
......
This diff is collapsed.
This diff is collapsed.
......@@ -831,11 +831,11 @@ LInstruction* LChunkBuilder::DoShift(Token::Value op,
}
ASSERT(instr->representation().IsInteger32());
ASSERT(instr->OperandAt(0)->representation().IsInteger32());
ASSERT(instr->OperandAt(1)->representation().IsInteger32());
LOperand* left = UseRegisterAtStart(instr->OperandAt(0));
ASSERT(instr->left()->representation().IsInteger32());
ASSERT(instr->right()->representation().IsInteger32());
LOperand* left = UseRegisterAtStart(instr->left());
HValue* right_value = instr->OperandAt(1);
HValue* right_value = instr->right();
LOperand* right = NULL;
int constant_value = 0;
if (right_value->IsConstant()) {
......@@ -1059,7 +1059,7 @@ LInstruction* LChunkBuilder::DoInstanceOf(HInstanceOf* instr) {
LInstruction* LChunkBuilder::DoInstanceOfKnownGlobal(
HInstanceOfKnownGlobal* instr) {
LInstanceOfKnownGlobal* result =
new LInstanceOfKnownGlobal(UseFixed(instr->value(), rax),
new LInstanceOfKnownGlobal(UseFixed(instr->left(), rax),
FixedTemp(rdi));
return MarkAsCall(DefineFixed(result, rax), instr);
}
......
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