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

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

Issue 6778018: Only pass isolate parameter to C helper functions that need it. (Closed)
Patch Set: Created 9 years, 8 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
« no previous file with comments | « no previous file | src/arm/deoptimizer-arm.cc » ('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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 5343 matching lines...) Expand 10 before | Expand all | Expand 10 after
5354 // Allocate a heap number. 5354 // Allocate a heap number.
5355 __ CallRuntime(Runtime::kNumberAlloc, 0); 5355 __ CallRuntime(Runtime::kNumberAlloc, 0);
5356 __ mov(r4, Operand(r0)); 5356 __ mov(r4, Operand(r0));
5357 5357
5358 __ bind(&heapnumber_allocated); 5358 __ bind(&heapnumber_allocated);
5359 5359
5360 // Convert 32 random bits in r0 to 0.(32 random bits) in a double 5360 // Convert 32 random bits in r0 to 0.(32 random bits) in a double
5361 // by computing: 5361 // by computing:
5362 // ( 1.(20 0s)(32 random bits) x 2^20 ) - (1.0 x 2^20)). 5362 // ( 1.(20 0s)(32 random bits) x 2^20 ) - (1.0 x 2^20)).
5363 if (Isolate::Current()->cpu_features()->IsSupported(VFP3)) { 5363 if (Isolate::Current()->cpu_features()->IsSupported(VFP3)) {
5364 __ PrepareCallCFunction(0, r1); 5364 __ PrepareCallCFunction(1, r0);
5365 __ CallCFunction(ExternalReference::random_uint32_function(isolate()), 0); 5365 __ mov(r0, Operand(ExternalReference::isolate_address()));
5366 __ CallCFunction(ExternalReference::random_uint32_function(isolate()), 1);
5366 5367
5367 CpuFeatures::Scope scope(VFP3); 5368 CpuFeatures::Scope scope(VFP3);
5368 // 0x41300000 is the top half of 1.0 x 2^20 as a double. 5369 // 0x41300000 is the top half of 1.0 x 2^20 as a double.
5369 // Create this constant using mov/orr to avoid PC relative load. 5370 // Create this constant using mov/orr to avoid PC relative load.
5370 __ mov(r1, Operand(0x41000000)); 5371 __ mov(r1, Operand(0x41000000));
5371 __ orr(r1, r1, Operand(0x300000)); 5372 __ orr(r1, r1, Operand(0x300000));
5372 // Move 0x41300000xxxxxxxx (x = random bits) to VFP. 5373 // Move 0x41300000xxxxxxxx (x = random bits) to VFP.
5373 __ vmov(d7, r0, r1); 5374 __ vmov(d7, r0, r1);
5374 // Move 0x4130000000000000 to VFP. 5375 // Move 0x4130000000000000 to VFP.
5375 __ mov(r0, Operand(0, RelocInfo::NONE)); 5376 __ mov(r0, Operand(0, RelocInfo::NONE));
5376 __ vmov(d8, r0, r1); 5377 __ vmov(d8, r0, r1);
5377 // Subtract and store the result in the heap number. 5378 // Subtract and store the result in the heap number.
5378 __ vsub(d7, d7, d8); 5379 __ vsub(d7, d7, d8);
5379 __ sub(r0, r4, Operand(kHeapObjectTag)); 5380 __ sub(r0, r4, Operand(kHeapObjectTag));
5380 __ vstr(d7, r0, HeapNumber::kValueOffset); 5381 __ vstr(d7, r0, HeapNumber::kValueOffset);
5381 frame_->EmitPush(r4); 5382 frame_->EmitPush(r4);
5382 } else { 5383 } else {
5384 __ PrepareCallCFunction(2, r0);
5383 __ mov(r0, Operand(r4)); 5385 __ mov(r0, Operand(r4));
5384 __ PrepareCallCFunction(1, r1); 5386 __ mov(r1, Operand(ExternalReference::isolate_address()));
5385 __ CallCFunction( 5387 __ CallCFunction(
5386 ExternalReference::fill_heap_number_with_random_function(isolate()), 1); 5388 ExternalReference::fill_heap_number_with_random_function(isolate()), 2);
5387 frame_->EmitPush(r0); 5389 frame_->EmitPush(r0);
5388 } 5390 }
5389 } 5391 }
5390 5392
5391 5393
5392 void CodeGenerator::GenerateStringAdd(ZoneList<Expression*>* args) { 5394 void CodeGenerator::GenerateStringAdd(ZoneList<Expression*>* args) {
5393 ASSERT_EQ(2, args->length()); 5395 ASSERT_EQ(2, args->length());
5394 5396
5395 Load(args->at(0)); 5397 Load(args->at(0));
5396 Load(args->at(1)); 5398 Load(args->at(1));
(...skipping 2030 matching lines...) Expand 10 before | Expand all | Expand 10 after
7427 specialized_on_rhs_ ? "_ConstantRhs" : "", 7429 specialized_on_rhs_ ? "_ConstantRhs" : "",
7428 BinaryOpIC::GetName(runtime_operands_type_)); 7430 BinaryOpIC::GetName(runtime_operands_type_));
7429 return name_; 7431 return name_;
7430 } 7432 }
7431 7433
7432 #undef __ 7434 #undef __
7433 7435
7434 } } // namespace v8::internal 7436 } } // namespace v8::internal
7435 7437
7436 #endif // V8_TARGET_ARCH_ARM 7438 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm/deoptimizer-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698