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

Side by Side Diff: src/arm/lithium-codegen-arm.cc

Issue 12385014: Hydrogen stubs for array constructors (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 2926 matching lines...) Expand 10 before | Expand all | Expand 10 after
2937 while (!save_iterator.Done()) { 2937 while (!save_iterator.Done()) {
2938 __ vldr(DwVfpRegister::FromAllocationIndex(save_iterator.Current()), 2938 __ vldr(DwVfpRegister::FromAllocationIndex(save_iterator.Current()),
2939 MemOperand(sp, count * kDoubleSize)); 2939 MemOperand(sp, count * kDoubleSize));
2940 save_iterator.Advance(); 2940 save_iterator.Advance();
2941 count++; 2941 count++;
2942 } 2942 }
2943 } 2943 }
2944 if (NeedsEagerFrame()) { 2944 if (NeedsEagerFrame()) {
2945 __ mov(sp, fp); 2945 __ mov(sp, fp);
2946 __ ldm(ia_w, sp, fp.bit() | lr.bit()); 2946 __ ldm(ia_w, sp, fp.bit() | lr.bit());
2947 }
2948 if (instr->has_constant_parameter_count()) {
2949 int parameter_count = ToInteger32(instr->constant_parameter_count());
2950 int32_t sp_delta = (parameter_count + 1) * kPointerSize;
2951 if (sp_delta != 0) {
2952 __ add(sp, sp, Operand(sp_delta));
2953 }
2954 } else {
2955 Register reg = ToRegister(instr->parameter_count());
2956 __ SmiUntag(reg); // it is a smi
2957 __ add(sp, sp, Operand(reg, LSL, kPointerSizeLog2));
2958 }
2947 2959
2948 if (instr->has_constant_parameter_count()) {
2949 int parameter_count = ToInteger32(instr->constant_parameter_count());
2950 int32_t sp_delta = (parameter_count + 1) * kPointerSize;
2951 if (sp_delta != 0) {
2952 __ add(sp, sp, Operand(sp_delta));
2953 }
2954 } else {
2955 Register reg = ToRegister(instr->parameter_count());
2956 __ add(reg, reg, Operand(1));
2957 __ add(sp, sp, Operand(reg, LSL, kPointerSizeLog2));
2958 }
2959 }
2960 __ Jump(lr); 2960 __ Jump(lr);
2961 } 2961 }
2962 2962
2963 2963
2964 void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) { 2964 void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) {
2965 Register result = ToRegister(instr->result()); 2965 Register result = ToRegister(instr->result());
2966 __ mov(ip, Operand(Handle<Object>(instr->hydrogen()->cell()))); 2966 __ mov(ip, Operand(Handle<Object>(instr->hydrogen()->cell())));
2967 __ ldr(result, FieldMemOperand(ip, JSGlobalPropertyCell::kValueOffset)); 2967 __ ldr(result, FieldMemOperand(ip, JSGlobalPropertyCell::kValueOffset));
2968 if (instr->hydrogen()->RequiresHoleCheck()) { 2968 if (instr->hydrogen()->RequiresHoleCheck()) {
2969 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); 2969 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex);
(...skipping 1241 matching lines...) Expand 10 before | Expand all | Expand 10 after
4211 } 4211 }
4212 4212
4213 4213
4214 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { 4214 void LCodeGen::DoCallNewArray(LCallNewArray* instr) {
4215 ASSERT(ToRegister(instr->constructor()).is(r1)); 4215 ASSERT(ToRegister(instr->constructor()).is(r1));
4216 ASSERT(ToRegister(instr->result()).is(r0)); 4216 ASSERT(ToRegister(instr->result()).is(r0));
4217 ASSERT(FLAG_optimize_constructed_arrays); 4217 ASSERT(FLAG_optimize_constructed_arrays);
4218 4218
4219 __ mov(r0, Operand(instr->arity())); 4219 __ mov(r0, Operand(instr->arity()));
4220 __ mov(r2, Operand(instr->hydrogen()->property_cell())); 4220 __ mov(r2, Operand(instr->hydrogen()->property_cell()));
4221 Handle<Code> array_construct_code = 4221 Object* cell_value = instr->hydrogen()->property_cell()->value();
4222 isolate()->builtins()->ArrayConstructCode(); 4222 ElementsKind kind = static_cast<ElementsKind>(Smi::cast(cell_value)->value());
4223 4223 if (instr->arity() == 0) {
4224 CallCode(array_construct_code, RelocInfo::CONSTRUCT_CALL, instr); 4224 ArrayNoArgumentConstructorStub stub(kind);
4225 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
4226 } else if (instr->arity() == 1) {
4227 ArraySingleArgumentConstructorStub stub(kind);
4228 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
4229 } else {
4230 ArrayNArgumentsConstructorStub stub(kind);
4231 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
4232 }
4225 } 4233 }
4226 4234
4227 4235
4228 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { 4236 void LCodeGen::DoCallRuntime(LCallRuntime* instr) {
4229 CallRuntime(instr->function(), instr->arity(), instr); 4237 CallRuntime(instr->function(), instr->arity(), instr);
4230 } 4238 }
4231 4239
4232 4240
4233 void LCodeGen::DoInnerAllocatedObject(LInnerAllocatedObject* instr) { 4241 void LCodeGen::DoInnerAllocatedObject(LInnerAllocatedObject* instr) {
4234 Register result = ToRegister(instr->result()); 4242 Register result = ToRegister(instr->result());
(...skipping 1760 matching lines...) Expand 10 before | Expand all | Expand 10 after
5995 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); 6003 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize));
5996 __ ldr(result, FieldMemOperand(scratch, 6004 __ ldr(result, FieldMemOperand(scratch,
5997 FixedArray::kHeaderSize - kPointerSize)); 6005 FixedArray::kHeaderSize - kPointerSize));
5998 __ bind(&done); 6006 __ bind(&done);
5999 } 6007 }
6000 6008
6001 6009
6002 #undef __ 6010 #undef __
6003 6011
6004 } } // namespace v8::internal 6012 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-arm.cc ('k') | src/bootstrapper.cc » ('j') | src/bootstrapper.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698