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

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

Issue 1306993003: Call JS functions via native context instead of js builtins object. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 5 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
« no previous file with comments | « src/full-codegen/ppc/full-codegen-ppc.cc ('k') | src/full-codegen/x87/full-codegen-x87.cc » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if V8_TARGET_ARCH_X64 5 #if V8_TARGET_ARCH_X64
6 6
7 #include "src/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/codegen.h" 9 #include "src/codegen.h"
10 #include "src/compiler.h" 10 #include "src/compiler.h"
(...skipping 4463 matching lines...) Expand 10 before | Expand all | Expand 10 after
4474 ExternalReference::debug_is_active_address(isolate()); 4474 ExternalReference::debug_is_active_address(isolate());
4475 __ Move(kScratchRegister, debug_is_active); 4475 __ Move(kScratchRegister, debug_is_active);
4476 __ movzxbp(rax, Operand(kScratchRegister, 0)); 4476 __ movzxbp(rax, Operand(kScratchRegister, 0));
4477 __ Integer32ToSmi(rax, rax); 4477 __ Integer32ToSmi(rax, rax);
4478 context()->Plug(rax); 4478 context()->Plug(rax);
4479 } 4479 }
4480 4480
4481 4481
4482 void FullCodeGenerator::EmitLoadJSRuntimeFunction(CallRuntime* expr) { 4482 void FullCodeGenerator::EmitLoadJSRuntimeFunction(CallRuntime* expr) {
4483 // Push the builtins object as receiver. 4483 // Push the builtins object as receiver.
4484 __ PushRoot(Heap::kUndefinedValueRootIndex);
4485
4484 __ movp(rax, GlobalObjectOperand()); 4486 __ movp(rax, GlobalObjectOperand());
4485 __ Push(FieldOperand(rax, GlobalObject::kBuiltinsOffset)); 4487 __ movp(rax, FieldOperand(rax, GlobalObject::kNativeContextOffset));
4486 4488 __ movp(rax, ContextOperand(rax, expr->context_index()));
4487 // Load the function from the receiver.
4488 __ movp(LoadDescriptor::ReceiverRegister(), Operand(rsp, 0));
4489 __ Move(LoadDescriptor::NameRegister(), expr->name());
4490 __ Move(LoadDescriptor::SlotRegister(),
4491 SmiFromSlot(expr->CallRuntimeFeedbackSlot()));
4492 CallLoadIC(NOT_INSIDE_TYPEOF);
4493 } 4489 }
4494 4490
4495 4491
4496 void FullCodeGenerator::EmitCallJSRuntimeFunction(CallRuntime* expr) { 4492 void FullCodeGenerator::EmitCallJSRuntimeFunction(CallRuntime* expr) {
4497 ZoneList<Expression*>* args = expr->arguments(); 4493 ZoneList<Expression*>* args = expr->arguments();
4498 int arg_count = args->length(); 4494 int arg_count = args->length();
4499 4495
4500 SetCallPosition(expr, arg_count); 4496 SetCallPosition(expr, arg_count);
4501 CallFunctionStub stub(isolate(), arg_count, NO_CALL_FUNCTION_FLAGS); 4497 CallFunctionStub stub(isolate(), arg_count, NO_CALL_FUNCTION_FLAGS);
4502 __ movp(rdi, Operand(rsp, (arg_count + 1) * kPointerSize)); 4498 __ movp(rdi, Operand(rsp, (arg_count + 1) * kPointerSize));
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after
5301 Assembler::target_address_at(call_target_address, 5297 Assembler::target_address_at(call_target_address,
5302 unoptimized_code)); 5298 unoptimized_code));
5303 return OSR_AFTER_STACK_CHECK; 5299 return OSR_AFTER_STACK_CHECK;
5304 } 5300 }
5305 5301
5306 5302
5307 } // namespace internal 5303 } // namespace internal
5308 } // namespace v8 5304 } // namespace v8
5309 5305
5310 #endif // V8_TARGET_ARCH_X64 5306 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/full-codegen/ppc/full-codegen-ppc.cc ('k') | src/full-codegen/x87/full-codegen-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698