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

Side by Side Diff: src/full-codegen/ia32/full-codegen-ia32.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
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_IA32 5 #if V8_TARGET_ARCH_IA32
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 4451 matching lines...) Expand 10 before | Expand all | Expand 10 after
4462 DCHECK(expr->arguments()->length() == 0); 4462 DCHECK(expr->arguments()->length() == 0);
4463 ExternalReference debug_is_active = 4463 ExternalReference debug_is_active =
4464 ExternalReference::debug_is_active_address(isolate()); 4464 ExternalReference::debug_is_active_address(isolate());
4465 __ movzx_b(eax, Operand::StaticVariable(debug_is_active)); 4465 __ movzx_b(eax, Operand::StaticVariable(debug_is_active));
4466 __ SmiTag(eax); 4466 __ SmiTag(eax);
4467 context()->Plug(eax); 4467 context()->Plug(eax);
4468 } 4468 }
4469 4469
4470 4470
4471 void FullCodeGenerator::EmitLoadJSRuntimeFunction(CallRuntime* expr) { 4471 void FullCodeGenerator::EmitLoadJSRuntimeFunction(CallRuntime* expr) {
4472 // Push the builtins object as receiver. 4472 // Push undefined as receiver.
4473 __ push(Immediate(isolate()->factory()->undefined_value()));
4474
4473 __ mov(eax, GlobalObjectOperand()); 4475 __ mov(eax, GlobalObjectOperand());
4474 __ push(FieldOperand(eax, GlobalObject::kBuiltinsOffset)); 4476 __ mov(eax, FieldOperand(eax, GlobalObject::kNativeContextOffset));
4475 4477 __ mov(eax, ContextOperand(eax, expr->context_index()));
4476 // Load the function from the receiver.
4477 __ mov(LoadDescriptor::ReceiverRegister(), Operand(esp, 0));
4478 __ mov(LoadDescriptor::NameRegister(), Immediate(expr->name()));
4479 __ mov(LoadDescriptor::SlotRegister(),
4480 Immediate(SmiFromSlot(expr->CallRuntimeFeedbackSlot())));
4481 CallLoadIC(NOT_INSIDE_TYPEOF);
4482 } 4478 }
4483 4479
4484 4480
4485 void FullCodeGenerator::EmitCallJSRuntimeFunction(CallRuntime* expr) { 4481 void FullCodeGenerator::EmitCallJSRuntimeFunction(CallRuntime* expr) {
4486 ZoneList<Expression*>* args = expr->arguments(); 4482 ZoneList<Expression*>* args = expr->arguments();
4487 int arg_count = args->length(); 4483 int arg_count = args->length();
4488 4484
4489 SetCallPosition(expr, arg_count); 4485 SetCallPosition(expr, arg_count);
4490 CallFunctionStub stub(isolate(), arg_count, NO_CALL_FUNCTION_FLAGS); 4486 CallFunctionStub stub(isolate(), arg_count, NO_CALL_FUNCTION_FLAGS);
4491 __ mov(edi, Operand(esp, (arg_count + 1) * kPointerSize)); 4487 __ mov(edi, Operand(esp, (arg_count + 1) * kPointerSize));
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after
5291 Assembler::target_address_at(call_target_address, 5287 Assembler::target_address_at(call_target_address,
5292 unoptimized_code)); 5288 unoptimized_code));
5293 return OSR_AFTER_STACK_CHECK; 5289 return OSR_AFTER_STACK_CHECK;
5294 } 5290 }
5295 5291
5296 5292
5297 } // namespace internal 5293 } // namespace internal
5298 } // namespace v8 5294 } // namespace v8
5299 5295
5300 #endif // V8_TARGET_ARCH_IA32 5296 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/full-codegen/arm64/full-codegen-arm64.cc ('k') | src/full-codegen/mips/full-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698