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

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: 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()));
4473 __ mov(eax, GlobalObjectOperand()); 4474 __ mov(eax, GlobalObjectOperand());
4474 __ push(FieldOperand(eax, GlobalObject::kBuiltinsOffset)); 4475 __ mov(eax, FieldOperand(eax, GlobalObject::kNativeContextOffset));
4475 4476 __ mov(eax, ContextOperand(eax, expr->function()->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 } 4477 }
4483 4478
4484 4479
4485 void FullCodeGenerator::EmitCallJSRuntimeFunction(CallRuntime* expr) { 4480 void FullCodeGenerator::EmitCallJSRuntimeFunction(CallRuntime* expr) {
4486 ZoneList<Expression*>* args = expr->arguments(); 4481 ZoneList<Expression*>* args = expr->arguments();
4487 int arg_count = args->length(); 4482 int arg_count = args->length();
4488 4483
4489 SetCallPosition(expr, arg_count); 4484 SetCallPosition(expr, arg_count);
4490 CallFunctionStub stub(isolate(), arg_count, NO_CALL_FUNCTION_FLAGS); 4485 CallFunctionStub stub(isolate(), arg_count, NO_CALL_FUNCTION_FLAGS);
4491 __ mov(edi, Operand(esp, (arg_count + 1) * kPointerSize)); 4486 __ 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, 5286 Assembler::target_address_at(call_target_address,
5292 unoptimized_code)); 5287 unoptimized_code));
5293 return OSR_AFTER_STACK_CHECK; 5288 return OSR_AFTER_STACK_CHECK;
5294 } 5289 }
5295 5290
5296 5291
5297 } // namespace internal 5292 } // namespace internal
5298 } // namespace v8 5293 } // namespace v8
5299 5294
5300 #endif // V8_TARGET_ARCH_IA32 5295 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698