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

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

Issue 7741042: Make (some) functions called from builtin functions use the callback's global as receiver. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 3 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 | « no previous file | src/array.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 3562 matching lines...) Expand 10 before | Expand all | Expand 10 after
3573 ASSERT(result.is(r0)); 3573 ASSERT(result.is(r0));
3574 __ b(&done); 3574 __ b(&done);
3575 3575
3576 __ bind(&bailout); 3576 __ bind(&bailout);
3577 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); 3577 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex);
3578 __ bind(&done); 3578 __ bind(&done);
3579 context()->Plug(r0); 3579 context()->Plug(r0);
3580 } 3580 }
3581 3581
3582 3582
3583 void FullCodeGenerator::EmitIsNativeOrStrictMode(ZoneList<Expression*>* args) {
3584 ASSERT(args->length() == 1);
3585
3586 // Load the function into r0.
3587 VisitForAccumulatorValue(args->at(0));
3588
3589 // Prepare for the test.
3590 Label materialize_true, materialize_false;
3591 Label* if_true = NULL;
3592 Label* if_false = NULL;
3593 Label* fall_through = NULL;
3594 context()->PrepareTest(&materialize_true, &materialize_false,
3595 &if_true, &if_false, &fall_through);
3596
3597 // Test for strict mode function.
3598 __ ldr(r1, FieldMemOperand(r0, JSFunction::kSharedFunctionInfoOffset));
3599 __ ldr(r1, FieldMemOperand(r1, SharedFunctionInfo::kCompilerHintsOffset));
3600 __ tst(r1, Operand(1 << (SharedFunctionInfo::kStrictModeFunction +
3601 kSmiTagSize)));
3602 __ b(ne, if_true);
3603
3604 // Test for native function.
3605 __ tst(r1, Operand(1 << (SharedFunctionInfo::kNative + kSmiTagSize)));
3606 __ b(ne, if_true);
3607
3608 // Not native or strict-mode function.
3609 __ b(if_false);
3610
3611 PrepareForBailoutBeforeSplit(TOS_REG, true, if_true, if_false);
3612 context()->Plug(if_true, if_false);
3613 }
3614
3615
3616 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { 3583 void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) {
3617 Handle<String> name = expr->name(); 3584 Handle<String> name = expr->name();
3618 if (name->length() > 0 && name->Get(0) == '_') { 3585 if (name->length() > 0 && name->Get(0) == '_') {
3619 Comment cmnt(masm_, "[ InlineRuntimeCall"); 3586 Comment cmnt(masm_, "[ InlineRuntimeCall");
3620 EmitInlineRuntimeCall(expr); 3587 EmitInlineRuntimeCall(expr);
3621 return; 3588 return;
3622 } 3589 }
3623 3590
3624 Comment cmnt(masm_, "[ CallRuntime"); 3591 Comment cmnt(masm_, "[ CallRuntime");
3625 ZoneList<Expression*>* args = expr->arguments(); 3592 ZoneList<Expression*>* args = expr->arguments();
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after
4295 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. 4262 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value.
4296 __ add(pc, r1, Operand(masm_->CodeObject())); 4263 __ add(pc, r1, Operand(masm_->CodeObject()));
4297 } 4264 }
4298 4265
4299 4266
4300 #undef __ 4267 #undef __
4301 4268
4302 } } // namespace v8::internal 4269 } } // namespace v8::internal
4303 4270
4304 #endif // V8_TARGET_ARCH_ARM 4271 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/array.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698