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

Unified Diff: src/stub-cache-arm.cc

Issue 7431: Addressed review comment by Kasper:... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 2 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 | « src/stub-cache.h ('k') | src/stub-cache-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/stub-cache-arm.cc
===================================================================
--- src/stub-cache-arm.cc (revision 506)
+++ src/stub-cache-arm.cc (working copy)
@@ -148,6 +148,27 @@
}
+// Load a fast property out of a holder object (src). In-object properties
+// are loaded directly otherwise the property is loaded from the properties
+// fixed array.
+void StubCompiler::GenerateFastPropertyLoad(MacroAssembler* masm,
+ Register dst, Register src,
+ JSObject* holder, int index) {
+ // Adjust for the number of properties stored in the holder.
+ index -= holder->map()->inobject_properties();
+ if (index < 0) {
+ // Get the property straight out of the holder.
+ int offset = holder->map()->instance_size() + (index * kPointerSize);
+ __ ldr(dst, FieldMemOperand(src, offset));
+ } else {
+ // Calculate the offset into the properties array.
+ int offset = index * kPointerSize + Array::kHeaderSize;
+ __ ldr(dst, FieldMemOperand(src, JSObject::kPropertiesOffset));
+ __ ldr(dst, FieldMemOperand(dst, offset));
+ }
+}
+
+
#undef __
#define __ masm()->
@@ -208,21 +229,8 @@
// Do the right check and compute the holder register.
Register reg =
__ CheckMaps(JSObject::cast(object), r1, holder, r3, r2, &miss);
+ GenerateFastPropertyLoad(masm(), r1, reg, holder, index);
- // Adjust for the number of properties stored in the holder.
- index -= holder->map()->inobject_properties();
- if (index < 0) {
- // Get the property straight out of the holder.
- int offset = holder->map()->instance_size() + (index * kPointerSize);
- __ ldr(r1, FieldMemOperand(reg, offset));
- } else {
- // Get the properties array of the holder and get the function from
- // the field.
- int offset = index * kPointerSize + Array::kHeaderSize;
- __ ldr(r1, FieldMemOperand(reg, JSObject::kPropertiesOffset));
- __ ldr(r1, FieldMemOperand(r1, offset));
- }
-
// Check that the function really is a function.
__ tst(r1, Operand(kSmiTagMask));
__ b(eq, &miss);
@@ -619,20 +627,7 @@
// Check that the maps haven't changed.
Register reg = __ CheckMaps(object, r0, holder, r3, r1, &miss);
-
- // Adjust for the number of properties stored in the holder.
- index -= holder->map()->inobject_properties();
- if (index < 0) {
- // Get the property straight out of the holder.
- int offset = holder->map()->instance_size() + (index * kPointerSize);
- __ ldr(r0, FieldMemOperand(reg, offset));
- } else {
- // Get the properties array of the holder.
- __ ldr(r3, FieldMemOperand(reg, JSObject::kPropertiesOffset));
- // Return the value from the properties array.
- int offset = index * kPointerSize + Array::kHeaderSize;
- __ ldr(r0, FieldMemOperand(r3, offset));
- }
+ GenerateFastPropertyLoad(masm(), r0, reg, holder, index);
__ Ret();
// Handle load cache miss.
« no previous file with comments | « src/stub-cache.h ('k') | src/stub-cache-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698