~ubuntu-branches/ubuntu/saucy/libv8/saucy

« back to all changes in this revision

Viewing changes to src/mips/lithium-gap-resolver-mips.cc

  • Committer: Package Import Robot
  • Author(s): Jérémy Lal
  • Date: 2012-04-07 16:26:13 UTC
  • mfrom: (15.1.27 sid)
  • Revision ID: package-import@ubuntu.com-20120407162613-dqo1m6w9r3fh8tst
Tags: 3.8.9.16-3
* mipsel build fixes :
  + v8_use_mips_abi_hardfloat=false, this lowers EABI requirements.
  + v8_can_use_fpu_instructions=false, detect if FPU is present.
  + set -Wno-unused-but-set-variable only on mipsel.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// Copyright 2011 the V8 project authors. All rights reserved.
 
1
// Copyright 2012 the V8 project authors. All rights reserved.
2
2
// Redistribution and use in source and binary forms, with or without
3
3
// modification, are permitted provided that the following conditions are
4
4
// met:
33
33
namespace v8 {
34
34
namespace internal {
35
35
 
36
 
static const Register kSavedValueRegister = lithiumScratchReg;
37
 
static const DoubleRegister kSavedDoubleValueRegister = lithiumScratchDouble;
 
36
static const Register kSavedValueRegister = kLithiumScratchReg;
38
37
 
39
38
LGapResolver::LGapResolver(LCodeGen* owner)
40
39
    : cgen_(owner),
175
174
  } else if (source->IsStackSlot()) {
176
175
    __ lw(kSavedValueRegister, cgen_->ToMemOperand(source));
177
176
  } else if (source->IsDoubleRegister()) {
178
 
    __ mov_d(kSavedDoubleValueRegister, cgen_->ToDoubleRegister(source));
 
177
    __ mov_d(kLithiumScratchDouble, cgen_->ToDoubleRegister(source));
179
178
  } else if (source->IsDoubleStackSlot()) {
180
 
    __ ldc1(kSavedDoubleValueRegister, cgen_->ToMemOperand(source));
 
179
    __ ldc1(kLithiumScratchDouble, cgen_->ToMemOperand(source));
181
180
  } else {
182
181
    UNREACHABLE();
183
182
  }
190
189
  ASSERT(in_cycle_);
191
190
  ASSERT(saved_destination_ != NULL);
192
191
 
193
 
  // Spilled value is in kSavedValueRegister or kSavedDoubleValueRegister.
 
192
  // Spilled value is in kSavedValueRegister or kLithiumScratchDouble.
194
193
  if (saved_destination_->IsRegister()) {
195
194
    __ mov(cgen_->ToRegister(saved_destination_), kSavedValueRegister);
196
195
  } else if (saved_destination_->IsStackSlot()) {
197
196
    __ sw(kSavedValueRegister, cgen_->ToMemOperand(saved_destination_));
198
197
  } else if (saved_destination_->IsDoubleRegister()) {
199
198
    __ mov_d(cgen_->ToDoubleRegister(saved_destination_),
200
 
            kSavedDoubleValueRegister);
 
199
            kLithiumScratchDouble);
201
200
  } else if (saved_destination_->IsDoubleStackSlot()) {
202
 
    __ sdc1(kSavedDoubleValueRegister,
 
201
    __ sdc1(kLithiumScratchDouble,
203
202
            cgen_->ToMemOperand(saved_destination_));
204
203
  } else {
205
204
    UNREACHABLE();
239
238
          // Therefore we can't use 'at'.  It is OK if the read from the source
240
239
          // destroys 'at', since that happens before the value is read.
241
240
          // This uses only a single reg of the double reg-pair.
242
 
          __ lwc1(kSavedDoubleValueRegister, source_operand);
243
 
          __ swc1(kSavedDoubleValueRegister, destination_operand);
 
241
          __ lwc1(kLithiumScratchDouble, source_operand);
 
242
          __ swc1(kLithiumScratchDouble, destination_operand);
244
243
        } else {
245
244
          __ lw(at, source_operand);
246
245
          __ sw(at, destination_operand);
252
251
    }
253
252
 
254
253
  } else if (source->IsConstantOperand()) {
255
 
    Operand source_operand = cgen_->ToOperand(source);
 
254
    LConstantOperand* constant_source = LConstantOperand::cast(source);
256
255
    if (destination->IsRegister()) {
257
 
      __ li(cgen_->ToRegister(destination), source_operand);
 
256
      Register dst = cgen_->ToRegister(destination);
 
257
      if (cgen_->IsInteger32(constant_source)) {
 
258
        __ li(dst, Operand(cgen_->ToInteger32(constant_source)));
 
259
      } else {
 
260
        __ LoadObject(dst, cgen_->ToHandle(constant_source));
 
261
      }
258
262
    } else {
259
263
      ASSERT(destination->IsStackSlot());
260
264
      ASSERT(!in_cycle_);  // Constant moves happen after all cycles are gone.
261
 
      MemOperand destination_operand = cgen_->ToMemOperand(destination);
262
 
      __ li(kSavedValueRegister, source_operand);
 
265
      if (cgen_->IsInteger32(constant_source)) {
 
266
        __ li(kSavedValueRegister,
 
267
              Operand(cgen_->ToInteger32(constant_source)));
 
268
      } else {
 
269
        __ LoadObject(kSavedValueRegister,
 
270
                      cgen_->ToHandle(constant_source));
 
271
      }
263
272
      __ sw(kSavedValueRegister, cgen_->ToMemOperand(destination));
264
273
    }
265
274
 
281
290
      ASSERT(destination->IsDoubleStackSlot());
282
291
      MemOperand destination_operand = cgen_->ToMemOperand(destination);
283
292
      if (in_cycle_) {
284
 
        // kSavedDoubleValueRegister was used to break the cycle,
 
293
        // kLithiumScratchDouble was used to break the cycle,
285
294
        // but kSavedValueRegister is free.
286
295
        MemOperand source_high_operand =
287
296
            cgen_->ToHighMemOperand(source);
292
301
        __ lw(kSavedValueRegister, source_high_operand);
293
302
        __ sw(kSavedValueRegister, destination_high_operand);
294
303
      } else {
295
 
        __ ldc1(kSavedDoubleValueRegister, source_operand);
296
 
        __ sdc1(kSavedDoubleValueRegister, destination_operand);
 
304
        __ ldc1(kLithiumScratchDouble, source_operand);
 
305
        __ sdc1(kLithiumScratchDouble, destination_operand);
297
306
      }
298
307
    }
299
308
  } else {