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

Side by Side Diff: src/ia32/lithium-codegen-ia32.cc

Issue 6909026: Additional minor cleanup regarding CallWrapper: Use the null object pattern. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 7 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/assembler.h ('k') | src/ia32/macro-assembler-ia32.h » ('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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 class SafepointGenerator : public CallWrapper { 43 class SafepointGenerator : public CallWrapper {
44 public: 44 public:
45 SafepointGenerator(LCodeGen* codegen, 45 SafepointGenerator(LCodeGen* codegen,
46 LPointerMap* pointers, 46 LPointerMap* pointers,
47 int deoptimization_index) 47 int deoptimization_index)
48 : codegen_(codegen), 48 : codegen_(codegen),
49 pointers_(pointers), 49 pointers_(pointers),
50 deoptimization_index_(deoptimization_index) {} 50 deoptimization_index_(deoptimization_index) {}
51 virtual ~SafepointGenerator() { } 51 virtual ~SafepointGenerator() { }
52 52
53 virtual void BeforeCall(int call_size) {} 53 virtual void BeforeCall(int call_size) const {}
54 54
55 virtual void AfterCall() { 55 virtual void AfterCall() const {
56 codegen_->RecordSafepoint(pointers_, deoptimization_index_); 56 codegen_->RecordSafepoint(pointers_, deoptimization_index_);
57 } 57 }
58 58
59 private: 59 private:
60 LCodeGen* codegen_; 60 LCodeGen* codegen_;
61 LPointerMap* pointers_; 61 LPointerMap* pointers_;
62 int deoptimization_index_; 62 int deoptimization_index_;
63 }; 63 };
64 64
65 65
(...skipping 2479 matching lines...) Expand 10 before | Expand all | Expand 10 after
2545 __ bind(&invoke); 2545 __ bind(&invoke);
2546 ASSERT(instr->HasPointerMap() && instr->HasDeoptimizationEnvironment()); 2546 ASSERT(instr->HasPointerMap() && instr->HasDeoptimizationEnvironment());
2547 LPointerMap* pointers = instr->pointer_map(); 2547 LPointerMap* pointers = instr->pointer_map();
2548 LEnvironment* env = instr->deoptimization_environment(); 2548 LEnvironment* env = instr->deoptimization_environment();
2549 RecordPosition(pointers->position()); 2549 RecordPosition(pointers->position());
2550 RegisterEnvironmentForDeoptimization(env); 2550 RegisterEnvironmentForDeoptimization(env);
2551 SafepointGenerator safepoint_generator(this, 2551 SafepointGenerator safepoint_generator(this,
2552 pointers, 2552 pointers,
2553 env->deoptimization_index()); 2553 env->deoptimization_index());
2554 ParameterCount actual(eax); 2554 ParameterCount actual(eax);
2555 __ InvokeFunction(function, actual, CALL_FUNCTION, &safepoint_generator); 2555 __ InvokeFunction(function, actual, CALL_FUNCTION, safepoint_generator);
2556 } 2556 }
2557 2557
2558 2558
2559 void LCodeGen::DoPushArgument(LPushArgument* instr) { 2559 void LCodeGen::DoPushArgument(LPushArgument* instr) {
2560 LOperand* argument = instr->InputAt(0); 2560 LOperand* argument = instr->InputAt(0);
2561 if (argument->IsConstantOperand()) { 2561 if (argument->IsConstantOperand()) {
2562 __ push(ToImmediate(argument)); 2562 __ push(ToImmediate(argument));
2563 } else { 2563 } else {
2564 __ push(ToOperand(argument)); 2564 __ push(ToOperand(argument));
2565 } 2565 }
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
2967 ASSERT(ToRegister(instr->context()).is(esi)); 2967 ASSERT(ToRegister(instr->context()).is(esi));
2968 ASSERT(ToRegister(instr->function()).is(edi)); 2968 ASSERT(ToRegister(instr->function()).is(edi));
2969 ASSERT(instr->HasPointerMap()); 2969 ASSERT(instr->HasPointerMap());
2970 ASSERT(instr->HasDeoptimizationEnvironment()); 2970 ASSERT(instr->HasDeoptimizationEnvironment());
2971 LPointerMap* pointers = instr->pointer_map(); 2971 LPointerMap* pointers = instr->pointer_map();
2972 LEnvironment* env = instr->deoptimization_environment(); 2972 LEnvironment* env = instr->deoptimization_environment();
2973 RecordPosition(pointers->position()); 2973 RecordPosition(pointers->position());
2974 RegisterEnvironmentForDeoptimization(env); 2974 RegisterEnvironmentForDeoptimization(env);
2975 SafepointGenerator generator(this, pointers, env->deoptimization_index()); 2975 SafepointGenerator generator(this, pointers, env->deoptimization_index());
2976 ParameterCount count(instr->arity()); 2976 ParameterCount count(instr->arity());
2977 __ InvokeFunction(edi, count, CALL_FUNCTION, &generator); 2977 __ InvokeFunction(edi, count, CALL_FUNCTION, generator);
2978 } 2978 }
2979 2979
2980 2980
2981 void LCodeGen::DoCallKeyed(LCallKeyed* instr) { 2981 void LCodeGen::DoCallKeyed(LCallKeyed* instr) {
2982 ASSERT(ToRegister(instr->context()).is(esi)); 2982 ASSERT(ToRegister(instr->context()).is(esi));
2983 ASSERT(ToRegister(instr->key()).is(ecx)); 2983 ASSERT(ToRegister(instr->key()).is(ecx));
2984 ASSERT(ToRegister(instr->result()).is(eax)); 2984 ASSERT(ToRegister(instr->result()).is(eax));
2985 2985
2986 int arity = instr->arity(); 2986 int arity = instr->arity();
2987 Handle<Code> ic = isolate()->stub_cache()-> 2987 Handle<Code> ic = isolate()->stub_cache()->
(...skipping 1242 matching lines...) Expand 10 before | Expand all | Expand 10 after
4230 RecordPosition(pointers->position()); 4230 RecordPosition(pointers->position());
4231 RegisterEnvironmentForDeoptimization(env); 4231 RegisterEnvironmentForDeoptimization(env);
4232 // Create safepoint generator that will also ensure enough space in the 4232 // Create safepoint generator that will also ensure enough space in the
4233 // reloc info for patching in deoptimization (since this is invoking a 4233 // reloc info for patching in deoptimization (since this is invoking a
4234 // builtin) 4234 // builtin)
4235 SafepointGenerator safepoint_generator(this, 4235 SafepointGenerator safepoint_generator(this,
4236 pointers, 4236 pointers,
4237 env->deoptimization_index()); 4237 env->deoptimization_index());
4238 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); 4238 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
4239 __ push(Immediate(Smi::FromInt(strict_mode_flag()))); 4239 __ push(Immediate(Smi::FromInt(strict_mode_flag())));
4240 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION, &safepoint_generator); 4240 __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION, safepoint_generator);
4241 } 4241 }
4242 4242
4243 4243
4244 void LCodeGen::DoStackCheck(LStackCheck* instr) { 4244 void LCodeGen::DoStackCheck(LStackCheck* instr) {
4245 // Perform stack overflow check. 4245 // Perform stack overflow check.
4246 NearLabel done; 4246 NearLabel done;
4247 ExternalReference stack_limit = 4247 ExternalReference stack_limit =
4248 ExternalReference::address_of_stack_limit(isolate()); 4248 ExternalReference::address_of_stack_limit(isolate());
4249 __ cmp(esp, Operand::StaticVariable(stack_limit)); 4249 __ cmp(esp, Operand::StaticVariable(stack_limit));
4250 __ j(above_equal, &done); 4250 __ j(above_equal, &done);
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
4290 LEnvironment* env = instr->deoptimization_environment(); 4290 LEnvironment* env = instr->deoptimization_environment();
4291 RecordPosition(pointers->position()); 4291 RecordPosition(pointers->position());
4292 RegisterEnvironmentForDeoptimization(env); 4292 RegisterEnvironmentForDeoptimization(env);
4293 // Create safepoint generator that will also ensure enough space in the 4293 // Create safepoint generator that will also ensure enough space in the
4294 // reloc info for patching in deoptimization (since this is invoking a 4294 // reloc info for patching in deoptimization (since this is invoking a
4295 // builtin) 4295 // builtin)
4296 SafepointGenerator safepoint_generator(this, 4296 SafepointGenerator safepoint_generator(this,
4297 pointers, 4297 pointers,
4298 env->deoptimization_index()); 4298 env->deoptimization_index());
4299 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); 4299 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
4300 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, &safepoint_generator); 4300 __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator);
4301 } 4301 }
4302 4302
4303 4303
4304 #undef __ 4304 #undef __
4305 4305
4306 } } // namespace v8::internal 4306 } } // namespace v8::internal
4307 4307
4308 #endif // V8_TARGET_ARCH_IA32 4308 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/assembler.h ('k') | src/ia32/macro-assembler-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698