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

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

Issue 10544196: Defer creating Handles for HConstants to the code generation phase. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review Created 8 years, 5 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/hydrogen-instructions.cc ('k') | src/lithium.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 } 353 }
354 354
355 355
356 XMMRegister LCodeGen::ToDoubleRegister(LOperand* op) const { 356 XMMRegister LCodeGen::ToDoubleRegister(LOperand* op) const {
357 ASSERT(op->IsDoubleRegister()); 357 ASSERT(op->IsDoubleRegister());
358 return ToDoubleRegister(op->index()); 358 return ToDoubleRegister(op->index());
359 } 359 }
360 360
361 361
362 int LCodeGen::ToInteger32(LConstantOperand* op) const { 362 int LCodeGen::ToInteger32(LConstantOperand* op) const {
363 Handle<Object> value = chunk_->LookupLiteral(op); 363 HConstant* constant = chunk_->LookupConstant(op);
364 ASSERT(chunk_->LookupLiteralRepresentation(op).IsInteger32()); 364 ASSERT(chunk_->LookupLiteralRepresentation(op).IsInteger32());
365 ASSERT(static_cast<double>(static_cast<int32_t>(value->Number())) == 365 ASSERT(constant->HasInteger32Value());
366 value->Number()); 366 return constant->Integer32Value();
367 return static_cast<int32_t>(value->Number());
368 } 367 }
369 368
370 369
371 Handle<Object> LCodeGen::ToHandle(LConstantOperand* op) const { 370 Handle<Object> LCodeGen::ToHandle(LConstantOperand* op) const {
372 Handle<Object> literal = chunk_->LookupLiteral(op); 371 HConstant* constant = chunk_->LookupConstant(op);
373 ASSERT(chunk_->LookupLiteralRepresentation(op).IsTagged()); 372 ASSERT(chunk_->LookupLiteralRepresentation(op).IsTagged());
374 return literal; 373 return constant->handle();
375 } 374 }
376 375
377 376
378 double LCodeGen::ToDouble(LConstantOperand* op) const { 377 double LCodeGen::ToDouble(LConstantOperand* op) const {
379 Handle<Object> value = chunk_->LookupLiteral(op); 378 HConstant* constant = chunk_->LookupConstant(op);
380 return value->Number(); 379 ASSERT(constant->HasDoubleValue());
380 return constant->DoubleValue();
381 } 381 }
382 382
383 383
384 bool LCodeGen::IsInteger32(LConstantOperand* op) const { 384 bool LCodeGen::IsInteger32(LConstantOperand* op) const {
385 return chunk_->LookupLiteralRepresentation(op).IsInteger32(); 385 return chunk_->LookupLiteralRepresentation(op).IsInteger32();
386 } 386 }
387 387
388 388
389 Operand LCodeGen::ToOperand(LOperand* op) const { 389 Operand LCodeGen::ToOperand(LOperand* op) const {
390 if (op->IsRegister()) return Operand(ToRegister(op)); 390 if (op->IsRegister()) return Operand(ToRegister(op));
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 Register reg = ToRegister(op); 487 Register reg = ToRegister(op);
488 if (is_tagged) { 488 if (is_tagged) {
489 translation->StoreRegister(reg); 489 translation->StoreRegister(reg);
490 } else { 490 } else {
491 translation->StoreInt32Register(reg); 491 translation->StoreInt32Register(reg);
492 } 492 }
493 } else if (op->IsDoubleRegister()) { 493 } else if (op->IsDoubleRegister()) {
494 XMMRegister reg = ToDoubleRegister(op); 494 XMMRegister reg = ToDoubleRegister(op);
495 translation->StoreDoubleRegister(reg); 495 translation->StoreDoubleRegister(reg);
496 } else if (op->IsConstantOperand()) { 496 } else if (op->IsConstantOperand()) {
497 Handle<Object> literal = chunk()->LookupLiteral(LConstantOperand::cast(op)); 497 HConstant* constant = chunk()->LookupConstant(LConstantOperand::cast(op));
498 int src_index = DefineDeoptimizationLiteral(literal); 498 int src_index = DefineDeoptimizationLiteral(constant->handle());
499 translation->StoreLiteral(src_index); 499 translation->StoreLiteral(src_index);
500 } else { 500 } else {
501 UNREACHABLE(); 501 UNREACHABLE();
502 } 502 }
503 } 503 }
504 504
505 505
506 void LCodeGen::CallCodeGeneric(Handle<Code> code, 506 void LCodeGen::CallCodeGeneric(Handle<Code> code,
507 RelocInfo::Mode mode, 507 RelocInfo::Mode mode,
508 LInstruction* instr, 508 LInstruction* instr,
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 int argc, 547 int argc,
548 LInstruction* instr, 548 LInstruction* instr,
549 LOperand* context) { 549 LOperand* context) {
550 if (context->IsRegister()) { 550 if (context->IsRegister()) {
551 if (!ToRegister(context).is(esi)) { 551 if (!ToRegister(context).is(esi)) {
552 __ mov(esi, ToRegister(context)); 552 __ mov(esi, ToRegister(context));
553 } 553 }
554 } else if (context->IsStackSlot()) { 554 } else if (context->IsStackSlot()) {
555 __ mov(esi, ToOperand(context)); 555 __ mov(esi, ToOperand(context));
556 } else if (context->IsConstantOperand()) { 556 } else if (context->IsConstantOperand()) {
557 Handle<Object> literal = 557 HConstant* constant =
558 chunk_->LookupLiteral(LConstantOperand::cast(context)); 558 chunk_->LookupConstant(LConstantOperand::cast(context));
559 __ LoadHeapObject(esi, Handle<Context>::cast(literal)); 559 __ LoadHeapObject(esi, Handle<Context>::cast(constant->handle()));
560 } else { 560 } else {
561 UNREACHABLE(); 561 UNREACHABLE();
562 } 562 }
563 563
564 __ CallRuntimeSaveDoubles(id); 564 __ CallRuntimeSaveDoubles(id);
565 RecordSafepointWithRegisters( 565 RecordSafepointWithRegisters(
566 instr->pointer_map(), argc, Safepoint::kNoLazyDeopt); 566 instr->pointer_map(), argc, Safepoint::kNoLazyDeopt);
567 } 567 }
568 568
569 569
(...skipping 4762 matching lines...) Expand 10 before | Expand all | Expand 10 after
5332 FixedArray::kHeaderSize - kPointerSize)); 5332 FixedArray::kHeaderSize - kPointerSize));
5333 __ bind(&done); 5333 __ bind(&done);
5334 } 5334 }
5335 5335
5336 5336
5337 #undef __ 5337 #undef __
5338 5338
5339 } } // namespace v8::internal 5339 } } // namespace v8::internal
5340 5340
5341 #endif // V8_TARGET_ARCH_IA32 5341 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.cc ('k') | src/lithium.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698