| OLD | NEW | 
|     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 358 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   369   ASSERT_EQ(materialize_true, materialize_false); |   369   ASSERT_EQ(materialize_true, materialize_false); | 
|   370   __ bind(materialize_true); |   370   __ bind(materialize_true); | 
|   371 } |   371 } | 
|   372  |   372  | 
|   373  |   373  | 
|   374 void FullCodeGenerator::AccumulatorValueContext::Plug( |   374 void FullCodeGenerator::AccumulatorValueContext::Plug( | 
|   375     Label* materialize_true, |   375     Label* materialize_true, | 
|   376     Label* materialize_false) const { |   376     Label* materialize_false) const { | 
|   377   NearLabel done; |   377   NearLabel done; | 
|   378   __ bind(materialize_true); |   378   __ bind(materialize_true); | 
|   379   __ Move(result_register(), Factory::true_value()); |   379   __ LoadRoot(result_register(), Heap::kTrueValueRootIndex); | 
|   380   __ jmp(&done); |   380   __ jmp(&done); | 
|   381   __ bind(materialize_false); |   381   __ bind(materialize_false); | 
|   382   __ Move(result_register(), Factory::false_value()); |   382   __ LoadRoot(result_register(), Heap::kFalseValueRootIndex); | 
|   383   __ bind(&done); |   383   __ bind(&done); | 
|   384 } |   384 } | 
|   385  |   385  | 
|   386  |   386  | 
|   387 void FullCodeGenerator::StackValueContext::Plug( |   387 void FullCodeGenerator::StackValueContext::Plug( | 
|   388     Label* materialize_true, |   388     Label* materialize_true, | 
|   389     Label* materialize_false) const { |   389     Label* materialize_false) const { | 
|   390   NearLabel done; |   390   NearLabel done; | 
|   391   __ bind(materialize_true); |   391   __ bind(materialize_true); | 
|   392   __ Push(Factory::true_value()); |   392   __ PushRoot(Heap::kTrueValueRootIndex); | 
|   393   __ jmp(&done); |   393   __ jmp(&done); | 
|   394   __ bind(materialize_false); |   394   __ bind(materialize_false); | 
|   395   __ Push(Factory::false_value()); |   395   __ PushRoot(Heap::kFalseValueRootIndex); | 
|   396   __ bind(&done); |   396   __ bind(&done); | 
|   397 } |   397 } | 
|   398  |   398  | 
|   399  |   399  | 
|   400 void FullCodeGenerator::TestContext::Plug(Label* materialize_true, |   400 void FullCodeGenerator::TestContext::Plug(Label* materialize_true, | 
|   401                                           Label* materialize_false) const { |   401                                           Label* materialize_false) const { | 
|   402   ASSERT(materialize_false == false_label_); |   402   ASSERT(materialize_false == false_label_); | 
|   403   ASSERT(materialize_true == true_label_); |   403   ASSERT(materialize_true == true_label_); | 
|   404 } |   404 } | 
|   405  |   405  | 
| (...skipping 1838 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  2244   __ j(not_equal, &non_function_constructor); |  2244   __ j(not_equal, &non_function_constructor); | 
|  2245  |  2245  | 
|  2246   // rax now contains the constructor function. Grab the |  2246   // rax now contains the constructor function. Grab the | 
|  2247   // instance class name from there. |  2247   // instance class name from there. | 
|  2248   __ movq(rax, FieldOperand(rax, JSFunction::kSharedFunctionInfoOffset)); |  2248   __ movq(rax, FieldOperand(rax, JSFunction::kSharedFunctionInfoOffset)); | 
|  2249   __ movq(rax, FieldOperand(rax, SharedFunctionInfo::kInstanceClassNameOffset)); |  2249   __ movq(rax, FieldOperand(rax, SharedFunctionInfo::kInstanceClassNameOffset)); | 
|  2250   __ jmp(&done); |  2250   __ jmp(&done); | 
|  2251  |  2251  | 
|  2252   // Functions have class 'Function'. |  2252   // Functions have class 'Function'. | 
|  2253   __ bind(&function); |  2253   __ bind(&function); | 
|  2254   __ Move(rax, Factory::function_class_symbol()); |  2254   __ LoadRoot(rax, Heap::kFunctionClassSymbolRootIndex); | 
|  2255   __ jmp(&done); |  2255   __ jmp(&done); | 
|  2256  |  2256  | 
|  2257   // Objects with a non-function constructor have class 'Object'. |  2257   // Objects with a non-function constructor have class 'Object'. | 
|  2258   __ bind(&non_function_constructor); |  2258   __ bind(&non_function_constructor); | 
|  2259   __ Move(rax, Factory::Object_symbol()); |  2259   __ LoadRoot(rax, Heap::kObjectSymbolRootIndex); | 
|  2260   __ jmp(&done); |  2260   __ jmp(&done); | 
|  2261  |  2261  | 
|  2262   // Non-JS objects have class null. |  2262   // Non-JS objects have class null. | 
|  2263   __ bind(&null); |  2263   __ bind(&null); | 
|  2264   __ LoadRoot(rax, Heap::kNullValueRootIndex); |  2264   __ LoadRoot(rax, Heap::kNullValueRootIndex); | 
|  2265  |  2265  | 
|  2266   // All done. |  2266   // All done. | 
|  2267   __ bind(&done); |  2267   __ bind(&done); | 
|  2268  |  2268  | 
|  2269   context()->Plug(rax); |  2269   context()->Plug(rax); | 
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  2704   __ movq(tmp, FieldOperand(left, HeapObject::kMapOffset)); |  2704   __ movq(tmp, FieldOperand(left, HeapObject::kMapOffset)); | 
|  2705   __ cmpb(FieldOperand(tmp, Map::kInstanceTypeOffset), |  2705   __ cmpb(FieldOperand(tmp, Map::kInstanceTypeOffset), | 
|  2706           Immediate(JS_REGEXP_TYPE)); |  2706           Immediate(JS_REGEXP_TYPE)); | 
|  2707   __ j(not_equal, &fail); |  2707   __ j(not_equal, &fail); | 
|  2708   __ cmpq(tmp, FieldOperand(right, HeapObject::kMapOffset)); |  2708   __ cmpq(tmp, FieldOperand(right, HeapObject::kMapOffset)); | 
|  2709   __ j(not_equal, &fail); |  2709   __ j(not_equal, &fail); | 
|  2710   __ movq(tmp, FieldOperand(left, JSRegExp::kDataOffset)); |  2710   __ movq(tmp, FieldOperand(left, JSRegExp::kDataOffset)); | 
|  2711   __ cmpq(tmp, FieldOperand(right, JSRegExp::kDataOffset)); |  2711   __ cmpq(tmp, FieldOperand(right, JSRegExp::kDataOffset)); | 
|  2712   __ j(equal, &ok); |  2712   __ j(equal, &ok); | 
|  2713   __ bind(&fail); |  2713   __ bind(&fail); | 
|  2714   __ Move(rax, Factory::false_value()); |  2714   __ LoadRoot(rax, Heap::kFalseValueRootIndex); | 
|  2715   __ jmp(&done); |  2715   __ jmp(&done); | 
|  2716   __ bind(&ok); |  2716   __ bind(&ok); | 
|  2717   __ Move(rax, Factory::true_value()); |  2717   __ LoadRoot(rax, Heap::kTrueValueRootIndex); | 
|  2718   __ bind(&done); |  2718   __ bind(&done); | 
|  2719  |  2719  | 
|  2720   context()->Plug(rax); |  2720   context()->Plug(rax); | 
|  2721 } |  2721 } | 
|  2722  |  2722  | 
|  2723  |  2723  | 
|  2724 void FullCodeGenerator::EmitHasCachedArrayIndex(ZoneList<Expression*>* args) { |  2724 void FullCodeGenerator::EmitHasCachedArrayIndex(ZoneList<Expression*>* args) { | 
|  2725   ASSERT(args->length() == 1); |  2725   ASSERT(args->length() == 1); | 
|  2726  |  2726  | 
|  2727   VisitForAccumulatorValue(args->at(0)); |  2727   VisitForAccumulatorValue(args->at(0)); | 
| (...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  3420   __ ret(0); |  3420   __ ret(0); | 
|  3421 } |  3421 } | 
|  3422  |  3422  | 
|  3423  |  3423  | 
|  3424 #undef __ |  3424 #undef __ | 
|  3425  |  3425  | 
|  3426  |  3426  | 
|  3427 } }  // namespace v8::internal |  3427 } }  // namespace v8::internal | 
|  3428  |  3428  | 
|  3429 #endif  // V8_TARGET_ARCH_X64 |  3429 #endif  // V8_TARGET_ARCH_X64 | 
| OLD | NEW |