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

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 and ported to x64 & 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 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 = CacheCells::UninitializedSentinel(isolate());
2279 Handle<JSGlobalPropertyCell> cell =
2280 isolate()->factory()->NewJSGlobalPropertyCell(uninitialized);
2281 RecordCacheCell(expr->id(), cell);
2282 __ Move(rbx, cell);
2283 } else {
2284 flags = NO_CALL_FUNCTION_FLAGS;
2285 }
2286
2287 CallConstructStub stub(flags);
2288 __ Call(stub.GetCode(), RelocInfo::CONSTRUCT_CALL);
2277 context()->Plug(rax); 2289 context()->Plug(rax);
2278 } 2290 }
2279 2291
2280 2292
2281 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) { 2293 void FullCodeGenerator::EmitIsSmi(CallRuntime* expr) {
2282 ZoneList<Expression*>* args = expr->arguments(); 2294 ZoneList<Expression*>* args = expr->arguments();
2283 ASSERT(args->length() == 1); 2295 ASSERT(args->length() == 1);
2284 2296
2285 VisitForAccumulatorValue(args->at(0)); 2297 VisitForAccumulatorValue(args->at(0));
2286 2298
(...skipping 2059 matching lines...) Expand 10 before | Expand all | Expand 10 after
4346 *context_length = 0; 4358 *context_length = 0;
4347 return previous_; 4359 return previous_;
4348 } 4360 }
4349 4361
4350 4362
4351 #undef __ 4363 #undef __
4352 4364
4353 } } // namespace v8::internal 4365 } } // namespace v8::internal
4354 4366
4355 #endif // V8_TARGET_ARCH_X64 4367 #endif // V8_TARGET_ARCH_X64
OLDNEW
« src/objects.h ('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