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/bailout-reason.h" | 7 #include "src/bailout-reason.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/field-index.h" | 9 #include "src/field-index.h" |
10 #include "src/hydrogen.h" | 10 #include "src/hydrogen.h" |
(...skipping 1538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1549 Add<HConstant>(factory->empty_fixed_array()); | 1549 Add<HConstant>(factory->empty_fixed_array()); |
1550 HValue* shared_info = GetParameter(0); | 1550 HValue* shared_info = GetParameter(0); |
1551 | 1551 |
1552 AddIncrementCounter(counters->fast_new_closure_total()); | 1552 AddIncrementCounter(counters->fast_new_closure_total()); |
1553 | 1553 |
1554 // Create a new closure from the given function info in new space | 1554 // Create a new closure from the given function info in new space |
1555 HValue* size = Add<HConstant>(JSFunction::kSize); | 1555 HValue* size = Add<HConstant>(JSFunction::kSize); |
1556 HInstruction* js_function = | 1556 HInstruction* js_function = |
1557 Add<HAllocate>(size, HType::JSObject(), NOT_TENURED, JS_FUNCTION_TYPE); | 1557 Add<HAllocate>(size, HType::JSObject(), NOT_TENURED, JS_FUNCTION_TYPE); |
1558 | 1558 |
1559 int map_index = Context::FunctionMapIndex(casted_stub()->strict_mode(), | 1559 int map_index = Context::FunctionMapIndex(casted_stub()->language_mode(), |
1560 casted_stub()->kind()); | 1560 casted_stub()->kind()); |
1561 | 1561 |
1562 // Compute the function map in the current native context and set that | 1562 // Compute the function map in the current native context and set that |
1563 // as the map of the allocated object. | 1563 // as the map of the allocated object. |
1564 HInstruction* native_context = BuildGetNativeContext(); | 1564 HInstruction* native_context = BuildGetNativeContext(); |
1565 HInstruction* map_slot_value = Add<HLoadNamedField>( | 1565 HInstruction* map_slot_value = Add<HLoadNamedField>( |
1566 native_context, nullptr, HObjectAccess::ForContextSlot(map_index)); | 1566 native_context, nullptr, HObjectAccess::ForContextSlot(map_index)); |
1567 Add<HStoreNamedField>(js_function, HObjectAccess::ForMap(), map_slot_value); | 1567 Add<HStoreNamedField>(js_function, HObjectAccess::ForMap(), map_slot_value); |
1568 | 1568 |
1569 // Initialize the rest of the function. | 1569 // Initialize the rest of the function. |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2216 // megamorphic case is handled as part of the default stub. | 2216 // megamorphic case is handled as part of the default stub. |
2217 DCHECK(!FLAG_vector_ics); | 2217 DCHECK(!FLAG_vector_ics); |
2218 | 2218 |
2219 // Probe the stub cache. | 2219 // Probe the stub cache. |
2220 Add<HTailCallThroughMegamorphicCache>(receiver, name); | 2220 Add<HTailCallThroughMegamorphicCache>(receiver, name); |
2221 | 2221 |
2222 // We never continue. | 2222 // We never continue. |
2223 return graph()->GetConstant0(); | 2223 return graph()->GetConstant0(); |
2224 } | 2224 } |
2225 } } // namespace v8::internal | 2225 } } // namespace v8::internal |
OLD | NEW |