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

Unified Diff: src/ia32/stub-cache-ia32.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 | « src/hydrogen.cc ('k') | src/ic.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/stub-cache-ia32.cc
diff --git a/src/ia32/stub-cache-ia32.cc b/src/ia32/stub-cache-ia32.cc
index f5e2d0589272047876166b353d1507dd26b554e0..cd471b1868db1e5fad6ddf0104b8eeab0ef0a7f3 100644
--- a/src/ia32/stub-cache-ia32.cc
+++ b/src/ia32/stub-cache-ia32.cc
@@ -3000,6 +3000,56 @@ Handle<Code> LoadStubCompiler::CompileLoadCallback(
#define __ ACCESS_MASM(masm)
+void LoadStubCompiler::GenerateLoadArrayLength(
+ MacroAssembler* masm,
+ Register holder) {
+ // ----------- S t a t e -------------
+ // -- ecx : name
+ // -- edx : receiver
+ // -- esp[0] : return address
+ // -----------------------------------
+
+ // Load length directly from the JS array.
+ __ mov(eax, FieldOperand(holder, JSArray::kLengthOffset));
+ __ ret(0);
+}
+
+
+#undef __
+#define __ ACCESS_MASM(masm())
+
+
+Handle<Code> LoadStubCompiler::CompileLoadArrayLength(
+ Handle<String> name,
+ Handle<JSObject> receiver,
+ Handle<JSObject> holder) {
+ // ----------- S t a t e -------------
+ // -- ecx : name
+ // -- edx : receiver
+ // -- esp[0] : return address
+ // -----------------------------------
+ Label miss;
+
+ // Check that the maps haven't changed.
+ __ JumpIfSmi(edx, &miss);
+ Register holder_reg = CheckPrototypes(
+ receiver, edx, holder, ebx, eax, edi, 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 | « src/hydrogen.cc ('k') | src/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698