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

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

Issue 9304001: Implement inlining of constructor calls. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Ported deoptimizer to x64 and ARM. Created 8 years, 10 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 4199 matching lines...) Expand 10 before | Expand all | Expand 10 after
4210 __ LoadHeapObject(temp1, current_prototype); 4210 __ LoadHeapObject(temp1, current_prototype);
4211 } 4211 }
4212 4212
4213 // Check the holder map. 4213 // Check the holder map.
4214 DoCheckMapCommon(temp1, temp2, 4214 DoCheckMapCommon(temp1, temp2,
4215 Handle<Map>(current_prototype->map()), 4215 Handle<Map>(current_prototype->map()),
4216 ALLOW_ELEMENT_TRANSITION_MAPS, instr->environment()); 4216 ALLOW_ELEMENT_TRANSITION_MAPS, instr->environment());
4217 } 4217 }
4218 4218
4219 4219
4220 void LCodeGen::DoAllocateObject(LAllocateObject* instr) {
4221 class DeferredAllocateObject: public LDeferredCode {
4222 public:
4223 DeferredAllocateObject(LCodeGen* codegen, LAllocateObject* instr)
4224 : LDeferredCode(codegen), instr_(instr) { }
4225 virtual void Generate() { codegen()->DoDeferredAllocateObject(instr_); }
4226 virtual LInstruction* instr() { return instr_; }
4227 private:
4228 LAllocateObject* instr_;
4229 };
4230
4231 DeferredAllocateObject* deferred = new DeferredAllocateObject(this, instr);
4232
4233 // TODO(mstarzinger): Implement inlined version instead of jumping to
4234 // deferred runtime call.
4235 __ jmp(deferred->entry());
4236
4237 __ bind(deferred->exit());
4238 }
4239
4240
4241 void LCodeGen::DoDeferredAllocateObject(LAllocateObject* instr) {
4242 Register result = ToRegister(instr->result());
4243 Register function = ToRegister(instr->function());
4244
4245 // TODO(3095996): Get rid of this. For now, we need to make the
4246 // result register contain a valid pointer because it is already
4247 // contained in the register pointer map.
4248 __ mov(result, zero_reg);
4249
4250 PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters);
4251 __ push(function);
4252 CallRuntimeFromDeferred(Runtime::kNewObject, 1, instr);
4253 __ StoreToSafepointRegisterSlot(v0, result);
4254 }
4255
4256
4220 void LCodeGen::DoArrayLiteral(LArrayLiteral* instr) { 4257 void LCodeGen::DoArrayLiteral(LArrayLiteral* instr) {
4221 Heap* heap = isolate()->heap(); 4258 Heap* heap = isolate()->heap();
4222 ElementsKind boilerplate_elements_kind = 4259 ElementsKind boilerplate_elements_kind =
4223 instr->hydrogen()->boilerplate_elements_kind(); 4260 instr->hydrogen()->boilerplate_elements_kind();
4224 4261
4225 // Deopt if the array literal boilerplate ElementsKind is of a type different 4262 // Deopt if the array literal boilerplate ElementsKind is of a type different
4226 // than the expected one. The check isn't necessary if the boilerplate has 4263 // than the expected one. The check isn't necessary if the boilerplate has
4227 // already been converted to FAST_ELEMENTS. 4264 // already been converted to FAST_ELEMENTS.
4228 if (boilerplate_elements_kind != FAST_ELEMENTS) { 4265 if (boilerplate_elements_kind != FAST_ELEMENTS) {
4229 __ LoadHeapObject(a1, instr->hydrogen()->boilerplate_object()); 4266 __ LoadHeapObject(a1, instr->hydrogen()->boilerplate_object());
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
4740 ASSERT(!environment->HasBeenRegistered()); 4777 ASSERT(!environment->HasBeenRegistered());
4741 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt); 4778 RegisterEnvironmentForDeoptimization(environment, Safepoint::kNoLazyDeopt);
4742 ASSERT(osr_pc_offset_ == -1); 4779 ASSERT(osr_pc_offset_ == -1);
4743 osr_pc_offset_ = masm()->pc_offset(); 4780 osr_pc_offset_ = masm()->pc_offset();
4744 } 4781 }
4745 4782
4746 4783
4747 #undef __ 4784 #undef __
4748 4785
4749 } } // namespace v8::internal 4786 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698