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

Side by Side Diff: src/x64/full-codegen-x64.cc

Issue 8932004: Implement target cache for constructor calls. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments by Vyacheslav Egorov. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 2253 matching lines...) Expand 10 before | Expand all | Expand 10 after
2264 } 2264 }
2265 2265
2266 // Call the construct call builtin that handles allocation and 2266 // Call the construct call builtin that handles allocation and
2267 // constructor invocation. 2267 // constructor invocation.
2268 SetSourcePosition(expr->position()); 2268 SetSourcePosition(expr->position());
2269 2269
2270 // Load function and argument count into rdi and rax. 2270 // Load function and argument count into rdi and rax.
2271 __ Set(rax, arg_count); 2271 __ Set(rax, arg_count);
2272 __ movq(rdi, Operand(rsp, arg_count * kPointerSize)); 2272 __ movq(rdi, Operand(rsp, arg_count * kPointerSize));
2273 2273
2274 Handle<Code> construct_builtin = 2274 // Record call targets in unoptimized code, but not in the snapshot.
2275 isolate()->builtins()->JSConstructCall(); 2275 CallFunctionFlags flags;
2276 __ Call(construct_builtin, RelocInfo::CONSTRUCT_CALL); 2276 if (!Serializer::enabled()) {
2277 flags = RECORD_CALL_TARGET;
2278 Handle<Object> uninitialized =
2279 TypeFeedbackCells::UninitializedSentinel(isolate());
2280 Handle<JSGlobalPropertyCell> cell =
2281 isolate()->factory()->NewJSGlobalPropertyCell(uninitialized);
2282 RecordTypeFeedbackCell(expr->id(), cell);
2283 __ Move(rbx, cell);
2284 } else {
2285 flags = NO_CALL_FUNCTION_FLAGS;
2286 }
2287
2288 CallConstructStub stub(flags);
2289 __ Call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL);
2277 context()->Plug(rax); 2290 context()->Plug(rax);
2278 } 2291 }
2279 2292
2280 2293
2281 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) { 2294 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) {
2282 ZoneList<Expression*>* args = expr->arguments(); 2295 ZoneList<Expression*>* args = expr->arguments();
2283 ASSERT(args->length() == 1); 2296 ASSERT(args->length() == 1);
2284 2297
2285 VisitForAccumulatorValue(args->at(0)); 2298 VisitForAccumulatorValue(args->at(0));
2286 2299
(...skipping 2059 matching lines...) Expand 10 before | Expand all | Expand 10 after
4346 *context_length = 0; 4359 *context_length = 0;
4347 return previous_; 4360 return previous_;
4348 } 4361 }
4349 4362
4350 4363
4351 #undef __ 4364 #undef __
4352 4365
4353 } } // namespace v8::internal 4366 } } // namespace v8::internal
4354 4367
4355 #endif // V8_TARGET_ARCH_X64 4368 #endif // V8_TARGET_ARCH_X64
OLDNEW
« src/type-info.cc ('K') | « src/x64/debug-x64.cc ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698