Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Unified Diff: src/arm/fast-codegen-arm.cc

Issue 550043: Fix issue 541 and some refactoring of the top-level compiler. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/fast-codegen.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/fast-codegen-arm.cc
===================================================================
--- src/arm/fast-codegen-arm.cc (revision 3610)
+++ src/arm/fast-codegen-arm.cc (working copy)
@@ -817,23 +817,19 @@
}
-void FastCodeGenerator::EmitNamedPropertyLoad(Property* prop,
- Expression::Context context) {
+void FastCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
SetSourcePosition(prop->position());
Literal* key = prop->key()->AsLiteral();
__ mov(r2, Operand(key->handle()));
Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize));
__ Call(ic, RelocInfo::CODE_TARGET);
- Apply(context, r0);
}
-void FastCodeGenerator::EmitKeyedPropertyLoad(Property* prop,
- Expression::Context context) {
+void FastCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
SetSourcePosition(prop->position());
Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
__ Call(ic, RelocInfo::CODE_TARGET);
- Apply(context, r0);
}
@@ -970,6 +966,9 @@
__ CallRuntime(Runtime::kToSlowProperties, 1);
}
+ // Record source code position before IC call.
+ SetSourcePosition(expr->position());
+
__ pop(r0);
__ mov(r2, Operand(prop->key()->AsLiteral()->handle()));
Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize));
@@ -1001,6 +1000,9 @@
__ CallRuntime(Runtime::kToSlowProperties, 1);
}
+ // Record source code position before IC call.
+ SetSourcePosition(expr->position());
+
__ pop(r0);
Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Initialize));
__ Call(ic, RelocInfo::CODE_TARGET);
@@ -1024,24 +1026,16 @@
Comment cmnt(masm_, "[ Property");
Expression* key = expr->key();
- // Record the source position for the property load.
- SetSourcePosition(expr->position());
-
// Evaluate receiver.
Visit(expr->obj());
if (key->IsPropertyName()) {
- // Do a named property load. The IC expects the property name in r2 and
- // the receiver on the stack.
- __ mov(r2, Operand(key->AsLiteral()->handle()));
- Handle<Code> ic(Builtins::builtin(Builtins::LoadIC_Initialize));
- __ Call(ic, RelocInfo::CODE_TARGET);
+ EmitNamedPropertyLoad(expr);
+ // Drop receiver left on the stack by IC.
DropAndApply(1, expr->context(), r0);
} else {
- // Do a keyed property load.
Visit(expr->key());
- Handle<Code> ic(Builtins::builtin(Builtins::KeyedLoadIC_Initialize));
- __ Call(ic, RelocInfo::CODE_TARGET);
+ EmitKeyedPropertyLoad(expr);
// Drop key and receiver left on the stack by IC.
DropAndApply(2, expr->context(), r0);
}
@@ -1383,12 +1377,13 @@
Visit(prop->obj());
ASSERT_EQ(Expression::kValue, prop->obj()->context());
if (assign_type == NAMED_PROPERTY) {
- EmitNamedPropertyLoad(prop, Expression::kValue);
+ EmitNamedPropertyLoad(prop);
} else {
Visit(prop->key());
ASSERT_EQ(Expression::kValue, prop->key()->context());
- EmitKeyedPropertyLoad(prop, Expression::kValue);
+ EmitKeyedPropertyLoad(prop);
}
+ __ push(r0);
}
// Convert to number.
« no previous file with comments | « no previous file | src/fast-codegen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698