| OLD | NEW |
| 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 | 117 |
| 118 | 118 |
| 119 bool LCodeGen::GeneratePrologue() { | 119 bool LCodeGen::GeneratePrologue() { |
| 120 ASSERT(is_generating()); | 120 ASSERT(is_generating()); |
| 121 | 121 |
| 122 if (info()->IsOptimizing()) { | 122 if (info()->IsOptimizing()) { |
| 123 ProfileEntryHookStub::MaybeCallEntryHook(masm_); | 123 ProfileEntryHookStub::MaybeCallEntryHook(masm_); |
| 124 | 124 |
| 125 #ifdef DEBUG | 125 #ifdef DEBUG |
| 126 if (strlen(FLAG_stop_at) > 0 && | 126 if (strlen(FLAG_stop_at) > 0 && |
| 127 info_->function()->name()->IsEqualTo(CStrVector(FLAG_stop_at))) { | 127 info_->function()->name()->IsUtf8EqualTo(CStrVector(FLAG_stop_at))) { |
| 128 __ int3(); | 128 __ int3(); |
| 129 } | 129 } |
| 130 #endif | 130 #endif |
| 131 | 131 |
| 132 // Strict mode functions need to replace the receiver with undefined | 132 // Strict mode functions need to replace the receiver with undefined |
| 133 // when called as functions (without an explicit receiver | 133 // when called as functions (without an explicit receiver |
| 134 // object). rcx is zero for method calls and non-zero for function | 134 // object). rcx is zero for method calls and non-zero for function |
| 135 // calls. | 135 // calls. |
| 136 if (!info_->is_classic_mode() || info_->is_native()) { | 136 if (!info_->is_classic_mode() || info_->is_native()) { |
| 137 Label ok; | 137 Label ok; |
| (...skipping 2079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2217 Handle<String> class_name, | 2217 Handle<String> class_name, |
| 2218 Register input, | 2218 Register input, |
| 2219 Register temp, | 2219 Register temp, |
| 2220 Register temp2) { | 2220 Register temp2) { |
| 2221 ASSERT(!input.is(temp)); | 2221 ASSERT(!input.is(temp)); |
| 2222 ASSERT(!input.is(temp2)); | 2222 ASSERT(!input.is(temp2)); |
| 2223 ASSERT(!temp.is(temp2)); | 2223 ASSERT(!temp.is(temp2)); |
| 2224 | 2224 |
| 2225 __ JumpIfSmi(input, is_false); | 2225 __ JumpIfSmi(input, is_false); |
| 2226 | 2226 |
| 2227 if (class_name->IsEqualTo(CStrVector("Function"))) { | 2227 if (class_name->IsOneByteEqualTo(STATIC_ASCII_VECTOR("Function"))) { |
| 2228 // Assuming the following assertions, we can use the same compares to test | 2228 // Assuming the following assertions, we can use the same compares to test |
| 2229 // for both being a function type and being in the object type range. | 2229 // for both being a function type and being in the object type range. |
| 2230 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); | 2230 STATIC_ASSERT(NUM_OF_CALLABLE_SPEC_OBJECT_TYPES == 2); |
| 2231 STATIC_ASSERT(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE == | 2231 STATIC_ASSERT(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE == |
| 2232 FIRST_SPEC_OBJECT_TYPE + 1); | 2232 FIRST_SPEC_OBJECT_TYPE + 1); |
| 2233 STATIC_ASSERT(LAST_NONCALLABLE_SPEC_OBJECT_TYPE == | 2233 STATIC_ASSERT(LAST_NONCALLABLE_SPEC_OBJECT_TYPE == |
| 2234 LAST_SPEC_OBJECT_TYPE - 1); | 2234 LAST_SPEC_OBJECT_TYPE - 1); |
| 2235 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); | 2235 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); |
| 2236 __ CmpObjectType(input, FIRST_SPEC_OBJECT_TYPE, temp); | 2236 __ CmpObjectType(input, FIRST_SPEC_OBJECT_TYPE, temp); |
| 2237 __ j(below, is_false); | 2237 __ j(below, is_false); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 2248 FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); | 2248 FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); |
| 2249 __ j(above, is_false); | 2249 __ j(above, is_false); |
| 2250 } | 2250 } |
| 2251 | 2251 |
| 2252 // Now we are in the FIRST-LAST_NONCALLABLE_SPEC_OBJECT_TYPE range. | 2252 // Now we are in the FIRST-LAST_NONCALLABLE_SPEC_OBJECT_TYPE range. |
| 2253 // Check if the constructor in the map is a function. | 2253 // Check if the constructor in the map is a function. |
| 2254 __ movq(temp, FieldOperand(temp, Map::kConstructorOffset)); | 2254 __ movq(temp, FieldOperand(temp, Map::kConstructorOffset)); |
| 2255 | 2255 |
| 2256 // Objects with a non-function constructor have class 'Object'. | 2256 // Objects with a non-function constructor have class 'Object'. |
| 2257 __ CmpObjectType(temp, JS_FUNCTION_TYPE, kScratchRegister); | 2257 __ CmpObjectType(temp, JS_FUNCTION_TYPE, kScratchRegister); |
| 2258 if (class_name->IsEqualTo(CStrVector("Object"))) { | 2258 if (class_name->IsOneByteEqualTo(STATIC_ASCII_VECTOR("Object"))) { |
| 2259 __ j(not_equal, is_true); | 2259 __ j(not_equal, is_true); |
| 2260 } else { | 2260 } else { |
| 2261 __ j(not_equal, is_false); | 2261 __ j(not_equal, is_false); |
| 2262 } | 2262 } |
| 2263 | 2263 |
| 2264 // temp now contains the constructor function. Grab the | 2264 // temp now contains the constructor function. Grab the |
| 2265 // instance class name from there. | 2265 // instance class name from there. |
| 2266 __ movq(temp, FieldOperand(temp, JSFunction::kSharedFunctionInfoOffset)); | 2266 __ movq(temp, FieldOperand(temp, JSFunction::kSharedFunctionInfoOffset)); |
| 2267 __ movq(temp, FieldOperand(temp, | 2267 __ movq(temp, FieldOperand(temp, |
| 2268 SharedFunctionInfo::kInstanceClassNameOffset)); | 2268 SharedFunctionInfo::kInstanceClassNameOffset)); |
| (...skipping 1971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4240 }; | 4240 }; |
| 4241 | 4241 |
| 4242 DeferredStringCharFromCode* deferred = | 4242 DeferredStringCharFromCode* deferred = |
| 4243 new(zone()) DeferredStringCharFromCode(this, instr); | 4243 new(zone()) DeferredStringCharFromCode(this, instr); |
| 4244 | 4244 |
| 4245 ASSERT(instr->hydrogen()->value()->representation().IsInteger32()); | 4245 ASSERT(instr->hydrogen()->value()->representation().IsInteger32()); |
| 4246 Register char_code = ToRegister(instr->char_code()); | 4246 Register char_code = ToRegister(instr->char_code()); |
| 4247 Register result = ToRegister(instr->result()); | 4247 Register result = ToRegister(instr->result()); |
| 4248 ASSERT(!char_code.is(result)); | 4248 ASSERT(!char_code.is(result)); |
| 4249 | 4249 |
| 4250 __ cmpl(char_code, Immediate(String::kMaxAsciiCharCode)); | 4250 __ cmpl(char_code, Immediate(String::kMaxOneByteCharCode)); |
| 4251 __ j(above, deferred->entry()); | 4251 __ j(above, deferred->entry()); |
| 4252 __ LoadRoot(result, Heap::kSingleCharacterStringCacheRootIndex); | 4252 __ LoadRoot(result, Heap::kSingleCharacterStringCacheRootIndex); |
| 4253 __ movq(result, FieldOperand(result, | 4253 __ movq(result, FieldOperand(result, |
| 4254 char_code, times_pointer_size, | 4254 char_code, times_pointer_size, |
| 4255 FixedArray::kHeaderSize)); | 4255 FixedArray::kHeaderSize)); |
| 4256 __ CompareRoot(result, Heap::kUndefinedValueRootIndex); | 4256 __ CompareRoot(result, Heap::kUndefinedValueRootIndex); |
| 4257 __ j(equal, deferred->entry()); | 4257 __ j(equal, deferred->entry()); |
| 4258 __ bind(deferred->exit()); | 4258 __ bind(deferred->exit()); |
| 4259 } | 4259 } |
| 4260 | 4260 |
| (...skipping 1288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5549 FixedArray::kHeaderSize - kPointerSize)); | 5549 FixedArray::kHeaderSize - kPointerSize)); |
| 5550 __ bind(&done); | 5550 __ bind(&done); |
| 5551 } | 5551 } |
| 5552 | 5552 |
| 5553 | 5553 |
| 5554 #undef __ | 5554 #undef __ |
| 5555 | 5555 |
| 5556 } } // namespace v8::internal | 5556 } } // namespace v8::internal |
| 5557 | 5557 |
| 5558 #endif // V8_TARGET_ARCH_X64 | 5558 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |