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

« back to all changes in this revision

Viewing changes to src/mips/macro-assembler-mips.h

  • 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:
51
51
// MIPS generated code calls C code, it must be via t9 register.
52
52
 
53
53
 
54
 
// Register aliases.
55
 
// cp is assumed to be a callee saved register.
56
 
const Register lithiumScratchReg = s3;  // Scratch register.
57
 
const Register lithiumScratchReg2 = s4;  // Scratch register.
58
 
const Register condReg = s5;  // Simulated (partial) condition code for mips.
59
 
const Register roots = s6;  // Roots array pointer.
60
 
const Register cp = s7;     // JavaScript context pointer.
61
 
const Register fp = s8_fp;  // Alias for fp.
62
 
const DoubleRegister lithiumScratchDouble = f30;  // Double scratch register.
63
 
 
64
54
// Flags used for the AllocateInNewSpace functions.
65
55
enum AllocationFlags {
66
56
  // No special flags.
262
252
                 Heap::RootListIndex index,
263
253
                 Condition cond, Register src1, const Operand& src2);
264
254
 
 
255
  void LoadHeapObject(Register dst, Handle<HeapObject> object);
 
256
 
 
257
  void LoadObject(Register result, Handle<Object> object) {
 
258
    if (object->IsHeapObject()) {
 
259
      LoadHeapObject(result, Handle<HeapObject>::cast(object));
 
260
    } else {
 
261
      li(result, object);
 
262
    }
 
263
  }
265
264
 
266
265
  // ---------------------------------------------------------------------------
267
266
  // GC Support
331
330
                      Register scratch3,
332
331
                      Label* object_is_white_and_not_data);
333
332
 
334
 
  // Detects conservatively whether an object is data-only, ie it does need to
 
333
  // Detects conservatively whether an object is data-only, i.e. it does need to
335
334
  // be scanned by the garbage collector.
336
335
  void JumpIfDataObject(Register value,
337
336
                        Register scratch,
396
395
                              Register scratch,
397
396
                              Label* miss);
398
397
 
 
398
  void GetNumberHash(Register reg0, Register scratch);
399
399
 
400
400
  void LoadFromNumberDictionary(Label* miss,
401
401
                                Register elements,
411
411
  }
412
412
 
413
413
  // Check if the given instruction is a 'type' marker.
414
 
  // ie. check if it is a sll zero_reg, zero_reg, <type> (referenced as
 
414
  // i.e. check if it is a sll zero_reg, zero_reg, <type> (referenced as
415
415
  // nop(type)). These instructions are generated to mark special location in
416
416
  // the code, like some special IC code.
417
417
  static inline bool IsMarkedCode(Instr instr, int type) {
780
780
                                    Register map,
781
781
                                    Register scratch);
782
782
 
 
783
  void InitializeRootRegister() {
 
784
    ExternalReference roots_array_start =
 
785
        ExternalReference::roots_array_start(isolate());
 
786
    li(kRootRegister, Operand(roots_array_start));
 
787
  }
783
788
 
784
789
  // -------------------------------------------------------------------------
785
790
  // JavaScript invokes.
786
791
 
787
 
  // Setup call kind marking in t1. The method takes t1 as an
 
792
  // Set up call kind marking in t1. The method takes t1 as an
788
793
  // explicit first parameter to make the code more readable at the
789
794
  // call sites.
790
795
  void SetCallKind(Register dst, CallKind kind);
815
820
  void InvokeFunction(Handle<JSFunction> function,
816
821
                      const ParameterCount& actual,
817
822
                      InvokeFlag flag,
 
823
                      const CallWrapper& call_wrapper,
818
824
                      CallKind call_kind);
819
825
 
820
826
 
925
931
                                   Register scratch4,
926
932
                                   Label* fail);
927
933
 
928
 
  // Check if the map of an object is equal to a specified map (either
929
 
  // given directly or as an index into the root list) and branch to
930
 
  // label if not. Skip the smi check if not required (object is known
931
 
  // to be a heap object).
 
934
  // Compare an object's map with the specified map and its transitioned
 
935
  // elements maps if mode is ALLOW_ELEMENT_TRANSITION_MAPS. Jumps to
 
936
  // "branch_to" if the result of the comparison is "cond". If multiple map
 
937
  // compares are required, the compare sequences branches to early_success.
 
938
  void CompareMapAndBranch(Register obj,
 
939
                           Register scratch,
 
940
                           Handle<Map> map,
 
941
                           Label* early_success,
 
942
                           Condition cond,
 
943
                           Label* branch_to,
 
944
                           CompareMapMode mode = REQUIRE_EXACT_MAP);
 
945
 
 
946
  // Check if the map of an object is equal to a specified map and branch to
 
947
  // label if not. Skip the smi check if not required (object is known to be a
 
948
  // heap object). If mode is ALLOW_ELEMENT_TRANSITION_MAPS, then also match
 
949
  // against maps that are ElementsKind transition maps of the specificed map.
932
950
  void CheckMap(Register obj,
933
951
                Register scratch,
934
952
                Handle<Map> map,
935
953
                Label* fail,
936
 
                SmiCheckType smi_check_type);
 
954
                SmiCheckType smi_check_type,
 
955
                CompareMapMode mode = REQUIRE_EXACT_MAP);
 
956
 
937
957
 
938
958
  void CheckMap(Register obj,
939
959
                Register scratch,
1117
1137
 
1118
1138
  // Calls an API function.  Allocates HandleScope, extracts returned value
1119
1139
  // from handle and propagates exceptions.  Restores context.  stack_space
1120
 
  // - space to be unwound on exit (includes the call js arguments space and
 
1140
  // - space to be unwound on exit (includes the call JS arguments space and
1121
1141
  // the additional space allocated for the fast call).
1122
1142
  void CallApiFunctionAndReturn(ExternalReference function, int stack_space);
1123
1143
 
1358
1378
                      Handle<Code> code_constant,
1359
1379
                      Register code_reg,
1360
1380
                      Label* done,
 
1381
                      bool* definitely_mismatches,
1361
1382
                      InvokeFlag flag,
1362
1383
                      const CallWrapper& call_wrapper,
1363
1384
                      CallKind call_kind);