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