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

Unified Diff: src/x64/macro-assembler-x64.cc

Issue 9073007: Store transitioned JSArray maps in global context (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Remove whitespace change Created 8 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
Index: src/x64/macro-assembler-x64.cc
diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc
index 2d6bd08139884c9980fd1c61d74675b95dc81c55..cf62b0834d94dd970454b5a90d7b2e792f56e2bc 100644
--- a/src/x64/macro-assembler-x64.cc
+++ b/src/x64/macro-assembler-x64.cc
@@ -4033,6 +4033,32 @@ void MacroAssembler::LoadContext(Register dst, int context_chain_length) {
}
}
+
+void MacroAssembler::LoadGlobalInitialConstructedArrayMap(
+ Register function_in, Register scratch, Register map_out) {
+ ASSERT(!function_in.is(map_out));
+ Label done;
+ movq(map_out, FieldOperand(function_in,
+ JSFunction::kPrototypeOrInitialMapOffset));
+ if (!FLAG_smi_only_arrays) {
+ // Load the global or builtins object from the current context.
+ movq(scratch, Operand(rsi, Context::SlotOffset(Context::GLOBAL_INDEX)));
+ movq(scratch, FieldOperand(scratch, GlobalObject::kGlobalContextOffset));
+
+ // Check that the function's map is same as the cached map.
+ cmpq(map_out,
+ Operand(scratch,
+ Context::SlotOffset(Context::SMI_JS_ARRAY_MAP_INDEX)));
+ j(not_equal, &done);
+
+ // Use the transitioned cached
Jakob Kummerow 2012/01/23 17:16:55 nit: += "map."
danno 2012/01/26 21:32:34 Done.
+ movq(map_out,
+ Operand(scratch,
+ Context::SlotOffset(Context::OBJECT_JS_ARRAY_MAP_INDEX)));
+ }
+ bind(&done);
+}
+
#ifdef _WIN64
static const int kRegisterPassedArguments = 4;
#else

Powered by Google App Engine
This is Rietveld 408576698