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

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: We still generated the arrays with feature flag off. Fixed. Created 7 years, 7 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
« no previous file with comments | « src/arm/lithium-arm.cc ('k') | src/bootstrapper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2924 matching lines...) Expand 10 before | Expand all | Expand 10 after
2935 while (!save_iterator.Done()) { 2935 while (!save_iterator.Done()) {
2936 __ vldr(DwVfpRegister::FromAllocationIndex(save_iterator.Current()), 2936 __ vldr(DwVfpRegister::FromAllocationIndex(save_iterator.Current()),
2937 MemOperand(sp, count * kDoubleSize)); 2937 MemOperand(sp, count * kDoubleSize));
2938 save_iterator.Advance(); 2938 save_iterator.Advance();
2939 count++; 2939 count++;
2940 } 2940 }
2941 } 2941 }
2942 if (NeedsEagerFrame()) { 2942 if (NeedsEagerFrame()) {
2943 __ mov(sp, fp); 2943 __ mov(sp, fp);
2944 __ ldm(ia_w, sp, fp.bit() | lr.bit()); 2944 __ ldm(ia_w, sp, fp.bit() | lr.bit());
2945 }
2946 if (instr->has_constant_parameter_count()) {
2947 int parameter_count = ToInteger32(instr->constant_parameter_count());
2948 int32_t sp_delta = (parameter_count + 1) * kPointerSize;
2949 if (sp_delta != 0) {
2950 __ add(sp, sp, Operand(sp_delta));
2951 }
2952 } else {
2953 Register reg = ToRegister(instr->parameter_count());
2954 // The argument count parameter is a smi
2955 __ SmiUntag(reg);
2956 __ add(sp, sp, Operand(reg, LSL, kPointerSizeLog2));
2957 }
2945 2958
2946 if (instr->has_constant_parameter_count()) {
2947 int parameter_count = ToInteger32(instr->constant_parameter_count());
2948 int32_t sp_delta = (parameter_count + 1) * kPointerSize;
2949 if (sp_delta != 0) {
2950 __ add(sp, sp, Operand(sp_delta));
2951 }
2952 } else {
2953 Register reg = ToRegister(instr->parameter_count());
2954 __ add(reg, reg, Operand(1));
2955 __ add(sp, sp, Operand(reg, LSL, kPointerSizeLog2));
2956 }
2957 }
2958 __ Jump(lr); 2959 __ Jump(lr);
2959 } 2960 }
2960 2961
2961 2962
2962 void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) { 2963 void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) {
2963 Register result = ToRegister(instr->result()); 2964 Register result = ToRegister(instr->result());
2964 __ mov(ip, Operand(Handle<Object>(instr->hydrogen()->cell()))); 2965 __ mov(ip, Operand(Handle<Object>(instr->hydrogen()->cell())));
2965 __ ldr(result, FieldMemOperand(ip, JSGlobalPropertyCell::kValueOffset)); 2966 __ ldr(result, FieldMemOperand(ip, JSGlobalPropertyCell::kValueOffset));
2966 if (instr->hydrogen()->RequiresHoleCheck()) { 2967 if (instr->hydrogen()->RequiresHoleCheck()) {
2967 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); 2968 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex);
(...skipping 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after
4226 } 4227 }
4227 4228
4228 4229
4229 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { 4230 void LCodeGen::DoCallNewArray(LCallNewArray* instr) {
4230 ASSERT(ToRegister(instr->constructor()).is(r1)); 4231 ASSERT(ToRegister(instr->constructor()).is(r1));
4231 ASSERT(ToRegister(instr->result()).is(r0)); 4232 ASSERT(ToRegister(instr->result()).is(r0));
4232 ASSERT(FLAG_optimize_constructed_arrays); 4233 ASSERT(FLAG_optimize_constructed_arrays);
4233 4234
4234 __ mov(r0, Operand(instr->arity())); 4235 __ mov(r0, Operand(instr->arity()));
4235 __ mov(r2, Operand(instr->hydrogen()->property_cell())); 4236 __ mov(r2, Operand(instr->hydrogen()->property_cell()));
4236 Handle<Code> array_construct_code = 4237 Object* cell_value = instr->hydrogen()->property_cell()->value();
4237 isolate()->builtins()->ArrayConstructCode(); 4238 ElementsKind kind = static_cast<ElementsKind>(Smi::cast(cell_value)->value());
4238 4239 if (instr->arity() == 0) {
4239 CallCode(array_construct_code, RelocInfo::CONSTRUCT_CALL, instr); 4240 ArrayNoArgumentConstructorStub stub(kind);
4241 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
4242 } else if (instr->arity() == 1) {
4243 ArraySingleArgumentConstructorStub stub(kind);
4244 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
4245 } else {
4246 ArrayNArgumentsConstructorStub stub(kind);
4247 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
4248 }
4240 } 4249 }
4241 4250
4242 4251
4243 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { 4252 void LCodeGen::DoCallRuntime(LCallRuntime* instr) {
4244 CallRuntime(instr->function(), instr->arity(), instr); 4253 CallRuntime(instr->function(), instr->arity(), instr);
4245 } 4254 }
4246 4255
4247 4256
4248 void LCodeGen::DoInnerAllocatedObject(LInnerAllocatedObject* instr) { 4257 void LCodeGen::DoInnerAllocatedObject(LInnerAllocatedObject* instr) {
4249 Register result = ToRegister(instr->result()); 4258 Register result = ToRegister(instr->result());
(...skipping 1754 matching lines...) Expand 10 before | Expand all | Expand 10 after
6004 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); 6013 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize));
6005 __ ldr(result, FieldMemOperand(scratch, 6014 __ ldr(result, FieldMemOperand(scratch,
6006 FixedArray::kHeaderSize - kPointerSize)); 6015 FixedArray::kHeaderSize - kPointerSize));
6007 __ bind(&done); 6016 __ bind(&done);
6008 } 6017 }
6009 6018
6010 6019
6011 #undef __ 6020 #undef __
6012 6021
6013 } } // namespace v8::internal 6022 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-arm.cc ('k') | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698