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

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

Issue 6880268: Sometimes avoid checking whether the receiver is an object in generated code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Removed int3. 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 | « no previous file | src/full-codegen.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 2142 matching lines...) Expand 10 before | Expand all | Expand 10 after
2153 isolate()->stub_cache()->ComputeKeyedCallInitialize(arg_count, in_loop); 2153 isolate()->stub_cache()->ComputeKeyedCallInitialize(arg_count, in_loop);
2154 __ ldr(r2, MemOperand(sp, (arg_count + 1) * kPointerSize)); // Key. 2154 __ ldr(r2, MemOperand(sp, (arg_count + 1) * kPointerSize)); // Key.
2155 EmitCallIC(ic, mode, expr->id()); 2155 EmitCallIC(ic, mode, expr->id());
2156 RecordJSReturnSite(expr); 2156 RecordJSReturnSite(expr);
2157 // Restore context register. 2157 // Restore context register.
2158 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 2158 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
2159 context()->DropAndPlug(1, r0); // Drop the key still on the stack. 2159 context()->DropAndPlug(1, r0); // Drop the key still on the stack.
2160 } 2160 }
2161 2161
2162 2162
2163 void FullCodeGenerator::EmitCallWithStub(Call* expr) { 2163 void FullCodeGenerator::EmitCallWithStub(Call* expr, CallFunctionFlags flags) {
2164 // Code common for calls using the call stub. 2164 // Code common for calls using the call stub.
2165 ZoneList<Expression*>* args = expr->arguments(); 2165 ZoneList<Expression*>* args = expr->arguments();
2166 int arg_count = args->length(); 2166 int arg_count = args->length();
2167 { PreservePositionScope scope(masm()->positions_recorder()); 2167 { PreservePositionScope scope(masm()->positions_recorder());
2168 for (int i = 0; i < arg_count; i++) { 2168 for (int i = 0; i < arg_count; i++) {
2169 VisitForStackValue(args->at(i)); 2169 VisitForStackValue(args->at(i));
2170 } 2170 }
2171 } 2171 }
2172 // Record source position for debugger. 2172 // Record source position for debugger.
2173 SetSourcePosition(expr->position()); 2173 SetSourcePosition(expr->position());
2174 InLoopFlag in_loop = (loop_depth() > 0) ? IN_LOOP : NOT_IN_LOOP; 2174 InLoopFlag in_loop = (loop_depth() > 0) ? IN_LOOP : NOT_IN_LOOP;
2175 CallFunctionStub stub(arg_count, in_loop, RECEIVER_MIGHT_BE_VALUE); 2175 CallFunctionStub stub(arg_count, in_loop, flags);
2176 __ CallStub(&stub); 2176 __ CallStub(&stub);
2177 RecordJSReturnSite(expr); 2177 RecordJSReturnSite(expr);
2178 // Restore context register. 2178 // Restore context register.
2179 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 2179 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
2180 context()->DropAndPlug(1, r0); 2180 context()->DropAndPlug(1, r0);
2181 } 2181 }
2182 2182
2183 2183
2184 void FullCodeGenerator::EmitResolvePossiblyDirectEval(ResolveEvalFlag flag, 2184 void FullCodeGenerator::EmitResolvePossiblyDirectEval(ResolveEvalFlag flag,
2185 int arg_count) { 2185 int arg_count) {
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
2311 __ bind(&done); 2311 __ bind(&done);
2312 // Push function. 2312 // Push function.
2313 __ push(r0); 2313 __ push(r0);
2314 // Push global receiver. 2314 // Push global receiver.
2315 __ ldr(r1, GlobalObjectOperand()); 2315 __ ldr(r1, GlobalObjectOperand());
2316 __ ldr(r1, FieldMemOperand(r1, GlobalObject::kGlobalReceiverOffset)); 2316 __ ldr(r1, FieldMemOperand(r1, GlobalObject::kGlobalReceiverOffset));
2317 __ push(r1); 2317 __ push(r1);
2318 __ bind(&call); 2318 __ bind(&call);
2319 } 2319 }
2320 2320
2321 EmitCallWithStub(expr); 2321 // The receiver is either the global receiver or a JSObject found by
2322 // LoadContextSlot.
2323 EmitCallWithStub(expr, NO_CALL_FUNCTION_FLAGS);
2322 } else if (fun->AsProperty() != NULL) { 2324 } else if (fun->AsProperty() != NULL) {
2323 // Call to an object property. 2325 // Call to an object property.
2324 Property* prop = fun->AsProperty(); 2326 Property* prop = fun->AsProperty();
2325 Literal* key = prop->key()->AsLiteral(); 2327 Literal* key = prop->key()->AsLiteral();
2326 if (key != NULL && key->handle()->IsSymbol()) { 2328 if (key != NULL && key->handle()->IsSymbol()) {
2327 // Call to a named property, use call IC. 2329 // Call to a named property, use call IC.
2328 { PreservePositionScope scope(masm()->positions_recorder()); 2330 { PreservePositionScope scope(masm()->positions_recorder());
2329 VisitForStackValue(prop->obj()); 2331 VisitForStackValue(prop->obj());
2330 } 2332 }
2331 EmitCallWithIC(expr, key->handle(), RelocInfo::CODE_TARGET_WITH_ID); 2333 EmitCallWithIC(expr, key->handle(), RelocInfo::CODE_TARGET_WITH_ID);
(...skipping 15 matching lines...) Expand all
2347 __ mov(r0, Operand(prop->key()->AsLiteral()->handle())); 2349 __ mov(r0, Operand(prop->key()->AsLiteral()->handle()));
2348 2350
2349 // Record source code position for IC call. 2351 // Record source code position for IC call.
2350 SetSourcePosition(prop->position()); 2352 SetSourcePosition(prop->position());
2351 2353
2352 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); 2354 Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
2353 EmitCallIC(ic, RelocInfo::CODE_TARGET, AstNode::kNoNumber); 2355 EmitCallIC(ic, RelocInfo::CODE_TARGET, AstNode::kNoNumber);
2354 __ ldr(r1, GlobalObjectOperand()); 2356 __ ldr(r1, GlobalObjectOperand());
2355 __ ldr(r1, FieldMemOperand(r1, GlobalObject::kGlobalReceiverOffset)); 2357 __ ldr(r1, FieldMemOperand(r1, GlobalObject::kGlobalReceiverOffset));
2356 __ Push(r0, r1); // Function, receiver. 2358 __ Push(r0, r1); // Function, receiver.
2357 EmitCallWithStub(expr); 2359 EmitCallWithStub(expr, NO_CALL_FUNCTION_FLAGS);
2358 } else { 2360 } else {
2359 { PreservePositionScope scope(masm()->positions_recorder()); 2361 { PreservePositionScope scope(masm()->positions_recorder());
2360 VisitForStackValue(prop->obj()); 2362 VisitForStackValue(prop->obj());
2361 } 2363 }
2362 EmitKeyedCallWithIC(expr, prop->key(), RelocInfo::CODE_TARGET_WITH_ID); 2364 EmitKeyedCallWithIC(expr, prop->key(), RelocInfo::CODE_TARGET_WITH_ID);
2363 } 2365 }
2364 } 2366 }
2365 } else { 2367 } else {
2366 { PreservePositionScope scope(masm()->positions_recorder()); 2368 { PreservePositionScope scope(masm()->positions_recorder());
2367 VisitForStackValue(fun); 2369 VisitForStackValue(fun);
2368 } 2370 }
2369 // Load global receiver object. 2371 // Load global receiver object.
2370 __ ldr(r1, GlobalObjectOperand()); 2372 __ ldr(r1, GlobalObjectOperand());
2371 __ ldr(r1, FieldMemOperand(r1, GlobalObject::kGlobalReceiverOffset)); 2373 __ ldr(r1, FieldMemOperand(r1, GlobalObject::kGlobalReceiverOffset));
2372 __ push(r1); 2374 __ push(r1);
2373 // Emit function call. 2375 // Emit function call.
2374 EmitCallWithStub(expr); 2376 EmitCallWithStub(expr, NO_CALL_FUNCTION_FLAGS);
2375 } 2377 }
2376 2378
2377 #ifdef DEBUG 2379 #ifdef DEBUG
2378 // RecordJSReturnSite should have been called. 2380 // RecordJSReturnSite should have been called.
2379 ASSERT(expr->return_is_recorded_); 2381 ASSERT(expr->return_is_recorded_);
2380 #endif 2382 #endif
2381 } 2383 }
2382 2384
2383 2385
2384 void FullCodeGenerator::VisitCallNew(CallNew* expr) { 2386 void FullCodeGenerator::VisitCallNew(CallNew* expr) {
(...skipping 2005 matching lines...) Expand 10 before | Expand all | Expand 10 after
4390 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value. 4392 __ mov(r1, Operand(r1, ASR, 1)); // Un-smi-tag value.
4391 __ add(pc, r1, Operand(masm_->CodeObject())); 4393 __ add(pc, r1, Operand(masm_->CodeObject()));
4392 } 4394 }
4393 4395
4394 4396
4395 #undef __ 4397 #undef __
4396 4398
4397 } } // namespace v8::internal 4399 } } // namespace v8::internal
4398 4400
4399 #endif // V8_TARGET_ARCH_ARM 4401 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/full-codegen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698