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

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

Issue 6368138: Support %_IsConstructCall in Crankshaft pipeline. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: don't check argc_bound twice Created 9 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 2231 matching lines...) Expand 10 before | Expand all | Expand 10 after
2242 void LCodeGen::DoTypeof(LTypeof* instr) { 2242 void LCodeGen::DoTypeof(LTypeof* instr) {
2243 Abort("Unimplemented: %s", "DoTypeof"); 2243 Abort("Unimplemented: %s", "DoTypeof");
2244 } 2244 }
2245 2245
2246 2246
2247 void LCodeGen::DoTypeofIs(LTypeofIs* instr) { 2247 void LCodeGen::DoTypeofIs(LTypeofIs* instr) {
2248 Abort("Unimplemented: %s", "DoTypeofIs"); 2248 Abort("Unimplemented: %s", "DoTypeofIs");
2249 } 2249 }
2250 2250
2251 2251
2252 void LCodeGen::DoIsConstructCall(LIsConstructCall* instr) {
2253 Register result = ToRegister(instr->result());
2254 Label true_label;
Mads Ager (chromium) 2011/02/08 07:09:44 NearLabel?
2255 Label false_label;
2256 NearLabel done;
2257
2258 EmitIsConstructCall(result);
2259 __ j(equal, &true_label);
2260
2261 __ LoadRoot(result, Heap::kFalseValueRootIndex);
2262 __ jmp(&done);
2263
2264 __ bind(&true_label);
2265 __ LoadRoot(result, Heap::kTrueValueRootIndex);
2266
2267
2268 __ bind(&done);
2269 }
2270
2271
2272 void LCodeGen::DoIsConstructCallAndBranch(LIsConstructCallAndBranch* instr) {
2273 Register temp = ToRegister(instr->TempAt(0));
2274 int true_block = chunk_->LookupDestination(instr->true_block_id());
2275 int false_block = chunk_->LookupDestination(instr->false_block_id());
2276
2277 EmitIsConstructCall(temp);
2278 EmitBranch(true_block, false_block, equal);
2279 }
2280
2281
2282 void LCodeGen::EmitIsConstructCall(Register temp) {
2283 // Get the frame pointer for the calling frame.
2284 __ movq(temp, Operand(rbp, StandardFrameConstants::kCallerFPOffset));
2285
2286 // Skip the arguments adaptor frame if it exists.
2287 Label check_frame_marker;
2288 __ SmiCompare(Operand(temp, StandardFrameConstants::kContextOffset),
2289 Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR));
2290 __ j(not_equal, &check_frame_marker);
2291 __ movq(temp, Operand(rax, StandardFrameConstants::kCallerFPOffset));
2292
2293 // Check the marker in the calling frame.
2294 __ bind(&check_frame_marker);
2295 __ SmiCompare(Operand(temp, StandardFrameConstants::kMarkerOffset),
2296 Smi::FromInt(StackFrame::CONSTRUCT));
2297 }
2298
2299
2252 void LCodeGen::DoTypeofIsAndBranch(LTypeofIsAndBranch* instr) { 2300 void LCodeGen::DoTypeofIsAndBranch(LTypeofIsAndBranch* instr) {
2253 Register input = ToRegister(instr->InputAt(0)); 2301 Register input = ToRegister(instr->InputAt(0));
2254 int true_block = chunk_->LookupDestination(instr->true_block_id()); 2302 int true_block = chunk_->LookupDestination(instr->true_block_id());
2255 int false_block = chunk_->LookupDestination(instr->false_block_id()); 2303 int false_block = chunk_->LookupDestination(instr->false_block_id());
2256 Label* true_label = chunk_->GetAssemblyLabel(true_block); 2304 Label* true_label = chunk_->GetAssemblyLabel(true_block);
2257 Label* false_label = chunk_->GetAssemblyLabel(false_block); 2305 Label* false_label = chunk_->GetAssemblyLabel(false_block);
2258 2306
2259 Condition final_branch_condition = EmitTypeofIs(true_label, 2307 Condition final_branch_condition = EmitTypeofIs(true_label,
2260 false_label, 2308 false_label,
2261 input, 2309 input,
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
2359 2407
2360 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { 2408 void LCodeGen::DoOsrEntry(LOsrEntry* instr) {
2361 Abort("Unimplemented: %s", "DoOsrEntry"); 2409 Abort("Unimplemented: %s", "DoOsrEntry");
2362 } 2410 }
2363 2411
2364 #undef __ 2412 #undef __
2365 2413
2366 } } // namespace v8::internal 2414 } } // namespace v8::internal
2367 2415
2368 #endif // V8_TARGET_ARCH_X64 2416 #endif // V8_TARGET_ARCH_X64
OLDNEW
« src/runtime.cc ('K') | « src/x64/lithium-codegen-x64.h ('k') | src/x64/lithium-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698