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

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

Issue 7283006: Do not pass the global object as the receiver to strict-mode and (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Update sputnik status. Created 9 years, 5 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/string.js ('k') | test/mjsunit/regress/regress-1360.js » ('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 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 3494 matching lines...) Expand 10 before | Expand all | Expand 10 after
3505 __ movq(rax, result_operand); 3505 __ movq(rax, result_operand);
3506 3506
3507 __ bind(&return_result); 3507 __ bind(&return_result);
3508 // Drop temp values from the stack, and restore context register. 3508 // Drop temp values from the stack, and restore context register.
3509 __ addq(rsp, Immediate(3 * kPointerSize)); 3509 __ addq(rsp, Immediate(3 * kPointerSize));
3510 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); 3510 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
3511 context()->Plug(rax); 3511 context()->Plug(rax);
3512 } 3512 }
3513 3513
3514 3514
3515 void FullCodeGenerator::EmitIsNativeOrStrictMode(ZoneList<Expression*>* args) {
3516 ASSERT(args->length() == 1);
3517
3518 // Load the function into rax.
3519 VisitForAccumulatorValue(args->at(0));
3520
3521 // Prepare for the test.
3522 Label materialize_true, materialize_false;
3523 Label* if_true = NULL;
3524 Label* if_false = NULL;
3525 Label* fall_through = NULL;
3526 context()->PrepareTest(&materialize_true, &materialize_false,
3527 &if_true, &if_false, &fall_through);
3528
3529 // Test for strict mode function.
3530 __ movq(rdx, FieldOperand(rax, JSFunction::kSharedFunctionInfoOffset));
3531 __ testb(FieldOperand(rdx, SharedFunctionInfo::kStrictModeByteOffset),
3532 Immediate(1 << SharedFunctionInfo::kStrictModeBitWithinByte));
3533 __ j(not_equal, if_true);
3534
3535 // Test for native function.
3536 __ testb(FieldOperand(rdx, SharedFunctionInfo::kNativeByteOffset),
3537 Immediate(1 << SharedFunctionInfo::kNativeBitWithinByte));
3538 __ j(not_equal, if_true);
3539
3540 // Not native or strict-mode function.
3541 __ jmp(if_false);
3542
3543 PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
3544 context()->Plug(if_true, if_false);
3545 }
3546
3547
3515 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { 3548 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) {
3516 Handle<String> name = expr->name(); 3549 Handle<String> name = expr->name();
3517 if (name->length() > 0 && name->Get(0) == '_') { 3550 if (name->length() > 0 && name->Get(0) == '_') {
3518 Comment cmnt(masm_, "[ InlineRuntimeCall"); 3551 Comment cmnt(masm_, "[ InlineRuntimeCall");
3519 EmitInlineRuntimeCall(expr); 3552 EmitInlineRuntimeCall(expr);
3520 return; 3553 return;
3521 } 3554 }
3522 3555
3523 Comment cmnt(masm_, "[ CallRuntime"); 3556 Comment cmnt(masm_, "[ CallRuntime");
3524 ZoneList<Expression*>* args = expr->arguments(); 3557 ZoneList<Expression*>* args = expr->arguments();
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after
4205 __ ret(0); 4238 __ ret(0);
4206 } 4239 }
4207 4240
4208 4241
4209 #undef __ 4242 #undef __
4210 4243
4211 4244
4212 } } // namespace v8::internal 4245 } } // namespace v8::internal
4213 4246
4214 #endif // V8_TARGET_ARCH_X64 4247 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/string.js ('k') | test/mjsunit/regress/regress-1360.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698