OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/field-index.h" | 8 #include "src/field-index.h" |
9 #include "src/hydrogen.h" | 9 #include "src/hydrogen.h" |
10 #include "src/lithium.h" | 10 #include "src/lithium.h" |
(...skipping 1333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1344 HValue* shared_info = GetParameter(0); | 1344 HValue* shared_info = GetParameter(0); |
1345 | 1345 |
1346 AddIncrementCounter(counters->fast_new_closure_total()); | 1346 AddIncrementCounter(counters->fast_new_closure_total()); |
1347 | 1347 |
1348 // Create a new closure from the given function info in new space | 1348 // Create a new closure from the given function info in new space |
1349 HValue* size = Add<HConstant>(JSFunction::kSize); | 1349 HValue* size = Add<HConstant>(JSFunction::kSize); |
1350 HInstruction* js_function = Add<HAllocate>(size, HType::JSObject(), | 1350 HInstruction* js_function = Add<HAllocate>(size, HType::JSObject(), |
1351 NOT_TENURED, JS_FUNCTION_TYPE); | 1351 NOT_TENURED, JS_FUNCTION_TYPE); |
1352 | 1352 |
1353 int map_index = Context::FunctionMapIndex(casted_stub()->strict_mode(), | 1353 int map_index = Context::FunctionMapIndex(casted_stub()->strict_mode(), |
1354 casted_stub()->is_generator()); | 1354 casted_stub()->kind()); |
1355 | 1355 |
1356 // Compute the function map in the current native context and set that | 1356 // Compute the function map in the current native context and set that |
1357 // as the map of the allocated object. | 1357 // as the map of the allocated object. |
1358 HInstruction* native_context = BuildGetNativeContext(); | 1358 HInstruction* native_context = BuildGetNativeContext(); |
1359 HInstruction* map_slot_value = Add<HLoadNamedField>( | 1359 HInstruction* map_slot_value = Add<HLoadNamedField>( |
1360 native_context, static_cast<HValue*>(NULL), | 1360 native_context, static_cast<HValue*>(NULL), |
1361 HObjectAccess::ForContextSlot(map_index)); | 1361 HObjectAccess::ForContextSlot(map_index)); |
1362 Add<HStoreNamedField>(js_function, HObjectAccess::ForMap(), map_slot_value); | 1362 Add<HStoreNamedField>(js_function, HObjectAccess::ForMap(), map_slot_value); |
1363 | 1363 |
1364 // Initialize the rest of the function. | 1364 // Initialize the rest of the function. |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1788 return Pop(); | 1788 return Pop(); |
1789 } | 1789 } |
1790 | 1790 |
1791 | 1791 |
1792 Handle<Code> KeyedLoadGenericStub::GenerateCode() { | 1792 Handle<Code> KeyedLoadGenericStub::GenerateCode() { |
1793 return DoGenerateCode(this); | 1793 return DoGenerateCode(this); |
1794 } | 1794 } |
1795 | 1795 |
1796 | 1796 |
1797 } } // namespace v8::internal | 1797 } } // namespace v8::internal |
OLD | NEW |