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

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

Issue 11344012: Make so that array length property access uses a new IC that tracks the array map. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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 | « no previous file | src/ast.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/stub-cache-arm.cc
diff --git a/src/arm/stub-cache-arm.cc b/src/arm/stub-cache-arm.cc
index d3b58624c8b24058eda3cdec1742bc7ccc36c739..392b562dd36136cdeed5b7e1f70380ff6780dd49 100644
--- a/src/arm/stub-cache-arm.cc
+++ b/src/arm/stub-cache-arm.cc
@@ -2955,6 +2955,56 @@ Handle<Code> LoadStubCompiler::CompileLoadCallback(
#define __ ACCESS_MASM(masm)
+void LoadStubCompiler::GenerateLoadArrayLength(
+ MacroAssembler* masm,
+ Register holder) {
+ // ----------- S t a t e -------------
+ // -- r0 : receiver
+ // -- r2 : name
+ // -- lr : return address
+ // -----------------------------------
+
+ // Load length directly from the JS array.
+ __ ldr(r0, FieldMemOperand(holder, JSArray::kLengthOffset));
+ __ Ret();
+}
+
+
+#undef __
+#define __ ACCESS_MASM(masm())
+
+
+Handle<Code> LoadStubCompiler::CompileLoadArrayLength(
+ Handle<String> name,
+ Handle<JSObject> receiver,
+ Handle<JSObject> holder) {
+ // ----------- S t a t e -------------
+ // -- r0 : receiver
+ // -- r2 : name
+ // -- lr : return address
+ // -----------------------------------
+ Label miss;
+
+ // Check that the maps haven't changed.
+ __ JumpIfSmi(r0, &miss);
+ Register holder_reg = CheckPrototypes(
+ receiver, r0, holder, r3, r4, r1, name, &miss);
+
+ GenerateLoadArrayLength(masm(), holder_reg);
+
+ __ bind(&miss);
+ GenerateLoadMiss(masm(), Code::LOAD_IC);
+
+ // Return the generated code.
+ return GetCode(Code::CALLBACKS, name,
+ Code::ExtraICStateForeignCallbackArrayLength);
+}
+
+
+#undef __
+#define __ ACCESS_MASM(masm)
+
+
void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm,
Handle<JSFunction> getter) {
// ----------- S t a t e -------------
« no previous file with comments | « no previous file | src/ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698