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

Unified Diff: src/x64/code-stubs-x64.cc

Issue 8344045: Fast elements conversions in crankshaft using generated code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 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
Index: src/x64/code-stubs-x64.cc
diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc
index 63aaee116b6cbd1efd580a9593ad0f10f2a2386d..615388b1d6cb35666a63cc16b5f33ddef9863b4a 100644
--- a/src/x64/code-stubs-x64.cc
+++ b/src/x64/code-stubs-x64.cc
@@ -5963,7 +5963,7 @@ void FastElementsConversionStub::GenerateSmiOnlyToObject(MacroAssembler* masm) {
void FastElementsConversionStub::GenerateSmiOnlyToDouble(
- MacroAssembler* masm, StrictModeFlag strict_mode) {
+ MacroAssembler* masm, Type type, StrictModeFlag strict_mode) {
// ----------- S t a t e -------------
// -- rax : value
// -- rbx : target map
@@ -6013,11 +6013,16 @@ void FastElementsConversionStub::GenerateSmiOnlyToDouble(
__ bind(&entry);
__ testq(r9, r9);
__ j(not_zero, &loop);
+
+ if (type == TRANSITION_ONLY) {
+ __ movq(rax, rdx);
+ __ Ret();
+ }
}
void FastElementsConversionStub::GenerateDoubleToObject(
- MacroAssembler* masm, StrictModeFlag strict_mode) {
+ MacroAssembler* masm, Type type, StrictModeFlag strict_mode) {
// ----------- S t a t e -------------
// -- rax : value
// -- rbx : target map
@@ -6051,7 +6056,15 @@ void FastElementsConversionStub::GenerateDoubleToObject(
__ bind(&gc_required);
__ pop(rax);
__ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
- KeyedStoreIC::GenerateRuntimeSetProperty(masm, strict_mode);
+ if (type == TRANSITION_ONLY) {
+ __ pop(rbx);
+ __ push(rdx);
+ __ push(rbx); // return address
+ __ TailCallRuntime(Runtime::kTransitionElementsDoubleToObject, 1, 1);
+ } else {
+ ASSERT(type == TRANSITION_AND_STORE);
+ KeyedStoreIC::GenerateRuntimeSetProperty(masm, strict_mode);
+ }
// Box doubles into heap numbers.
__ bind(&loop);
@@ -6115,6 +6128,11 @@ void FastElementsConversionStub::GenerateDoubleToObject(
OMIT_SMI_CHECK);
__ pop(rax);
__ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
+
+ if (type == TRANSITION_ONLY) {
+ __ movq(rax, rdx);
+ __ Ret();
+ }
}
#undef __

Powered by Google App Engine
This is Rietveld 408576698