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

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

Issue 8700008: New approach to Crankshaft decision-making (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: address comments Created 9 years 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/api.cc ('k') | src/compiler.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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 SetFunctionPosition(function()); 132 SetFunctionPosition(function());
133 Comment cmnt(masm_, "[ function compiled by full code generator"); 133 Comment cmnt(masm_, "[ function compiled by full code generator");
134 134
135 #ifdef DEBUG 135 #ifdef DEBUG
136 if (strlen(FLAG_stop_at) > 0 && 136 if (strlen(FLAG_stop_at) > 0 &&
137 info->function()->name()->IsEqualTo(CStrVector(FLAG_stop_at))) { 137 info->function()->name()->IsEqualTo(CStrVector(FLAG_stop_at))) {
138 __ stop("stop-at"); 138 __ stop("stop-at");
139 } 139 }
140 #endif 140 #endif
141 141
142 // Primitive functions are unlikely to be picked up by the stack-walking
143 // profiler, so they trigger their own optimization when they're called
144 // for the SharedFunctionInfo::kCallsUntilPrimitiveOptimization-th time.
145 if (FLAG_crankshaft &&
146 info->function()->is_primitive() &&
147 !Serializer::enabled() &&
148 !(!info->shared_info().is_null() &&
149 info->shared_info()->optimization_disabled())) {
150 if (FLAG_trace_opt) {
151 PrintF("[adding self-optimization header to %s]\n",
152 *info->function()->debug_name()->ToCString());
153 }
154 MaybeObject* maybe_cell = isolate()->heap()->AllocateJSGlobalPropertyCell(
155 Smi::FromInt(Compiler::kCallsUntilPrimitiveOpt));
156 JSGlobalPropertyCell* cell;
157 if (maybe_cell->To(&cell)) {
158 __ mov(r2, Operand(Handle<JSGlobalPropertyCell>(cell)));
159 __ ldr(r3, FieldMemOperand(r2, JSGlobalPropertyCell::kValueOffset));
160 __ sub(r3, r3, Operand(Smi::FromInt(1)), SetCC);
161 __ str(r3, FieldMemOperand(r2, JSGlobalPropertyCell::kValueOffset));
162 Handle<Code> compile_stub(
163 isolate()->builtins()->builtin(Builtins::kLazyRecompile));
164 __ Jump(compile_stub, RelocInfo::CODE_TARGET, eq);
165 }
166 }
167
142 // Strict mode functions and builtins need to replace the receiver 168 // Strict mode functions and builtins need to replace the receiver
143 // with undefined when called as functions (without an explicit 169 // with undefined when called as functions (without an explicit
144 // receiver object). r5 is zero for method calls and non-zero for 170 // receiver object). r5 is zero for method calls and non-zero for
145 // function calls. 171 // function calls.
146 if (!info->is_classic_mode() || info->is_native()) { 172 if (!info->is_classic_mode() || info->is_native()) {
147 Label ok; 173 Label ok;
148 __ cmp(r5, Operand(0)); 174 __ cmp(r5, Operand(0));
149 __ b(eq, &ok); 175 __ b(eq, &ok);
150 int receiver_offset = info->scope()->num_parameters() * kPointerSize; 176 int receiver_offset = info->scope()->num_parameters() * kPointerSize;
151 __ LoadRoot(r2, Heap::kUndefinedValueRootIndex); 177 __ LoadRoot(r2, Heap::kUndefinedValueRootIndex);
(...skipping 4234 matching lines...) Expand 10 before | Expand all | Expand 10 after
4386 *context_length = 0; 4412 *context_length = 0;
4387 return previous_; 4413 return previous_;
4388 } 4414 }
4389 4415
4390 4416
4391 #undef __ 4417 #undef __
4392 4418
4393 } } // namespace v8::internal 4419 } } // namespace v8::internal
4394 4420
4395 #endif // V8_TARGET_ARCH_ARM 4421 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/compiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698